设备状态调整

This commit is contained in:
yanghongwei 2025-09-11 00:01:46 +08:00
parent a474ded6a1
commit 1175c776bf
1 changed files with 3 additions and 1 deletions

View File

@ -47,9 +47,11 @@ namespace LY.App.Service
.WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key) || s.DeviceSN.Contains(key))
.OrderByDescending(s => s.Id)
.ToPageListAsync(pageNum, pageSize, total);
items.ForEach(async s =>
{
s.online = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(s.DeviceSN));
var key= RedisKeyList.DeviceStatus(s.DeviceSN);
s.online = await _redisService.ExistsAsync(key);
});
return new ApiResult()
{