fix func字段处理
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Dlhis.Entity.Device.Enums;
|
||||
using Kurisu.AspNetCore.Utils.Extensions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Dlhis.Basic.Device.Response;
|
||||
|
||||
@@ -32,9 +34,20 @@ public class DeviceResponse
|
||||
public string Supplier { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备功能
|
||||
/// 设备功能 DeviceFuncEnumType
|
||||
/// </summary>
|
||||
public List<DeviceFuncEnumType> Funcs { get; set; }
|
||||
public List<DeviceFuncEnumType> Funcs
|
||||
{
|
||||
get
|
||||
{
|
||||
if (FuncsStr.IsEmpty()) FuncsStr = "[]";
|
||||
|
||||
return FuncsStr.ToObject<List<DeviceFuncEnumType>>();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public string FuncsStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 部署点
|
||||
|
||||
@@ -24,7 +24,11 @@ public class DeviceService : IDeviceService
|
||||
public async Task<Pagination<DeviceResponse>> GetPageAsync(DevicePageRequest request)
|
||||
{
|
||||
var page = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Select<DeviceResponse>()
|
||||
.Select(device => new DeviceResponse
|
||||
{
|
||||
FuncsStr = device.Funcs.ToString()
|
||||
|
||||
}, true)
|
||||
.ToPageListAsync(request);
|
||||
|
||||
return page;
|
||||
|
||||
Reference in New Issue
Block a user