fix 单独的设备分页类型
This commit is contained in:
@@ -20,7 +20,10 @@ public class DevicesController : ControllerBase
|
||||
private readonly IDeviceConnectService _deviceConnectService;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public DevicesController(IDeviceService deviceService, IDeviceTemplateService deviceTemplateService, IDeviceConnectService deviceConnectService, IConfiguration configuration)
|
||||
public DevicesController(IDeviceService deviceService,
|
||||
IDeviceTemplateService deviceTemplateService,
|
||||
IDeviceConnectService deviceConnectService,
|
||||
IConfiguration configuration)
|
||||
{
|
||||
_deviceService = deviceService;
|
||||
_deviceTemplateService = deviceTemplateService;
|
||||
@@ -56,7 +59,7 @@ public class DevicesController : ControllerBase
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<DeviceResponse>> GetPageAsync([FromQuery] DevicePageRequest request)
|
||||
public async Task<Pagination<DevicePageResponse>> GetPageAsync([FromQuery] DevicePageRequest request)
|
||||
{
|
||||
return await _deviceService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
80
Src/Dlhis.Basic/Device/Response/DevicePageResponse.cs
Normal file
80
Src/Dlhis.Basic/Device/Response/DevicePageResponse.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
|
||||
namespace Dlhis.Basic.Device.Response;
|
||||
|
||||
public class DevicePageResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备code
|
||||
/// </summary>
|
||||
public Guid Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备唯一码,IP/MAC/SNO
|
||||
/// </summary>
|
||||
public string UniqueNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 心跳间隔
|
||||
/// </summary>
|
||||
public int HeartbeatInterval { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 品牌
|
||||
/// </summary>
|
||||
public string Brand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 供应商
|
||||
/// </summary>
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备功能 DeviceFuncEnumType
|
||||
/// </summary>
|
||||
public List<DeviceFuncEnumType> Funcs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
|
||||
|
||||
return FuncsStr.ToObject<List<DeviceFuncEnumType>>();
|
||||
}
|
||||
}
|
||||
|
||||
public string FuncsStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署点
|
||||
/// </summary>
|
||||
public string DeployPlace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署坐标
|
||||
/// </summary>
|
||||
public string DeployPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署方向
|
||||
/// </summary>
|
||||
public string DeployDirection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 模板code
|
||||
/// </summary>
|
||||
public Guid TemplateCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接信息
|
||||
/// </summary>
|
||||
public string ConnectionInfo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
public bool Enable { get; set; }
|
||||
}
|
||||
@@ -6,7 +6,7 @@ namespace Dlhis.Basic.Device.Services;
|
||||
|
||||
public interface IDeviceService : IScopeDependency
|
||||
{
|
||||
Task<Pagination<DeviceResponse>> GetPageAsync(DevicePageRequest request);
|
||||
Task<Pagination<DevicePageResponse>> GetPageAsync(DevicePageRequest request);
|
||||
|
||||
Task SaveAsync(DeviceSaveRequest request);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class DeviceService : IDeviceService
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<Pagination<DeviceResponse>> GetPageAsync(DevicePageRequest request)
|
||||
public async Task<Pagination<DevicePageResponse>> GetPageAsync(DevicePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Select(device => new DeviceResponse
|
||||
|
||||
Reference in New Issue
Block a user