Compare commits
No commits in common. "d5236e060bfbf685e7e363beea6fda60d2b4dc90" and "652d8dcb47d14e0e5db43f093238708b5005e4c6" have entirely different histories.
d5236e060b
...
652d8dcb47
@ -1 +1 @@
|
|||||||
Subproject commit 46e75b4e1cb8bd737c0921d58177516f65a54eaa
|
Subproject commit 0e0cddec079409dae5d1384c3738a0eeefa4c507
|
||||||
@ -14,6 +14,9 @@ namespace JiShe.IoT.CommonServices.Dto
|
|||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 类型名称
|
/// 类型名称
|
||||||
|
/// MalignantLoadLevelEnum 恶性负载等级
|
||||||
|
/// DurationOfAutomaticClosingEnum 自动合闸时长类型
|
||||||
|
/// MalignLoadTypeEnum 恶性负载类型
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public string TypeName { get; set; }
|
public string TypeName { get; set; }
|
||||||
|
|||||||
@ -14,17 +14,20 @@ namespace JiShe.IoT.CommonServices
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ICommonService
|
public interface ICommonService
|
||||||
{
|
{
|
||||||
|
#region 公共依赖接口
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化所有固定的枚举下拉框字典
|
/// 初始化所有固定的枚举下拉框字典
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
void InitSelectTypetList();
|
Task InitSelectTypetList();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据type名称获取下拉框数据,主要是枚举等
|
/// 根据type名称获取下拉框数据,主要是枚举等
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<SelectResult> GetSelectResultList(SelectResultListInput input);
|
Task<List<SelectResult>> GetSelectResultList(SelectResultListInput input);
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,41 +0,0 @@
|
|||||||
using JiShe.IoT.CommonServices.Dto;
|
|
||||||
using JiShe.ServicePro.Commons;
|
|
||||||
using JiShe.ServicePro.Core;
|
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace JiShe.IoT.CommonServices
|
|
||||||
{
|
|
||||||
public class CommonService : IoTAppService, ICommonService
|
|
||||||
{
|
|
||||||
private static ConcurrentDictionary<string, List<SelectResult>> _selectListType = new();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 初始化所有固定的枚举下拉框字典
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public void InitSelectTypetList()
|
|
||||||
{
|
|
||||||
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
|
||||||
var typeList = assemblies.SelectMany(x => x.GetTypes()).Where(x => x.IsDefined(typeof(SelectResultAttribute), false));
|
|
||||||
|
|
||||||
foreach (var typeInfoItem in typeList)
|
|
||||||
{
|
|
||||||
|
|
||||||
_selectListType.TryAdd(typeInfoItem.Name, CommonHelper.GetEnumAttributeList(typeInfoItem));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据type名称获取下拉框数据,主要是枚举等
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public List<SelectResult> GetSelectResultList(SelectResultListInput input)
|
|
||||||
{
|
|
||||||
List<SelectResult> selectResults = _selectListType.TryGetValue(input.TypeName, out var list) ? list : new List<SelectResult>();
|
|
||||||
|
|
||||||
return selectResults;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,3 @@
|
|||||||
using JiShe.IoT.CommonServices;
|
|
||||||
using JiShe.IoT.Jobs.ToMysql;
|
using JiShe.IoT.Jobs.ToMysql;
|
||||||
using JiShe.IoT.Jobs.ToRedis;
|
using JiShe.IoT.Jobs.ToRedis;
|
||||||
using JiShe.ServicePro.CTWingManagement;
|
using JiShe.ServicePro.CTWingManagement;
|
||||||
@ -11,7 +10,6 @@ using JiShe.ServicePro.IoTDBManagement;
|
|||||||
using JiShe.ServicePro.OneNETManagement;
|
using JiShe.ServicePro.OneNETManagement;
|
||||||
using JiShe.ServicePro.TemplateManagement;
|
using JiShe.ServicePro.TemplateManagement;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Volo.Abp;
|
|
||||||
|
|
||||||
namespace JiShe.IoT
|
namespace JiShe.IoT
|
||||||
{
|
{
|
||||||
@ -58,11 +56,5 @@ namespace JiShe.IoT
|
|||||||
context.Services.AddHostedService<CacheDeviceDataToRedisJob>();
|
context.Services.AddHostedService<CacheDeviceDataToRedisJob>();
|
||||||
context.Services.AddHostedService<CacheFocusDataToRedisJob>();
|
context.Services.AddHostedService<CacheFocusDataToRedisJob>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnApplicationInitialization(ApplicationInitializationContext context)
|
|
||||||
{
|
|
||||||
var commonService = context.ServiceProvider.GetRequiredService<ICommonService>();
|
|
||||||
commonService.InitSelectTypetList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,4 +46,8 @@
|
|||||||
<ProjectReference Include="..\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj" />
|
<ProjectReference Include="..\JiShe.IoT.Domain\JiShe.IoT.Domain.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="CommonServices\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,32 +0,0 @@
|
|||||||
using JiShe.IoT.CommonServices;
|
|
||||||
using JiShe.IoT.CommonServices.Dto;
|
|
||||||
using JiShe.ServicePro.Commons;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace JiShe.IoT.Controllers
|
|
||||||
{
|
|
||||||
public class CommonController:IoTController
|
|
||||||
{
|
|
||||||
private readonly ICommonService _commonService;
|
|
||||||
public CommonController(ICommonService commonService)
|
|
||||||
{
|
|
||||||
_commonService = commonService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据type名称获取下拉框数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="input"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
[HttpGet("get-select-list")]
|
|
||||||
[SwaggerOperation(summary: "根据type名称获取下拉框数据", Tags = new[] { "Common" })]
|
|
||||||
public List<SelectResult> GetSelectResultList(SelectResultListInput input)
|
|
||||||
{
|
|
||||||
return _commonService.GetSelectResultList(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,10 +1,7 @@
|
|||||||
using JiShe.ServicePro.SwaggerConfigs;
|
|
||||||
|
|
||||||
namespace JiShe.IoT.Controllers
|
namespace JiShe.IoT.Controllers
|
||||||
{
|
{
|
||||||
/* Inherit your controllers from this class.
|
/* Inherit your controllers from this class.
|
||||||
*/
|
*/
|
||||||
[ApiExplorerSettings(GroupName = nameof(SwaggerGroupEnum.IoTAdmin))]
|
|
||||||
public abstract class IoTController : AbpController
|
public abstract class IoTController : AbpController
|
||||||
{
|
{
|
||||||
protected IoTController()
|
protected IoTController()
|
||||||
Loading…
x
Reference in New Issue
Block a user