设备列表加入是否在线
This commit is contained in:
parent
5122193a28
commit
a474ded6a1
|
|
@ -1,4 +1,5 @@
|
||||||
using LY.App.Device;
|
using GraphQL;
|
||||||
|
using LY.App.Device;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
|
|
@ -75,6 +76,8 @@ namespace LY.App.Model
|
||||||
[SugarColumn(ColumnName = "is_move", ColumnDescription = "是否移动设备", IsNullable = true)]
|
[SugarColumn(ColumnName = "is_move", ColumnDescription = "是否移动设备", IsNullable = true)]
|
||||||
|
|
||||||
public bool isMove { get; set; }
|
public bool isMove { get; set; }
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public bool online { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,10 @@ namespace LY.App.Service
|
||||||
.WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key) || s.DeviceSN.Contains(key))
|
.WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key) || s.DeviceSN.Contains(key))
|
||||||
.OrderByDescending(s => s.Id)
|
.OrderByDescending(s => s.Id)
|
||||||
.ToPageListAsync(pageNum, pageSize, total);
|
.ToPageListAsync(pageNum, pageSize, total);
|
||||||
|
items.ForEach(async s =>
|
||||||
|
{
|
||||||
|
s.online = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(s.DeviceSN));
|
||||||
|
});
|
||||||
return new ApiResult()
|
return new ApiResult()
|
||||||
{
|
{
|
||||||
data = new
|
data = new
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue