细节调整

This commit is contained in:
yanghongwei 2025-09-11 00:51:53 +08:00
parent 5fb29db7e9
commit a61dfeddb0
1 changed files with 3 additions and 5 deletions

View File

@ -47,12 +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);
foreach (var item in items)
items.ForEach(async s =>
{ {
var status = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(s.DeviceSN)); item.online = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(item.DeviceSN));
s.online = status; }
});
return new ApiResult() return new ApiResult()
{ {
data = new data = new