refactor:将DataLoaderService中的LoadAll*Async方法移到对应的管理服务中

- 将LoadAllDevicesAsync方法移到DeviceManagementService
 - 将LoadAllVariableTablesAsync方法移到VariableTableManagementService
 - 将LoadAllVariablesAsync方法移到VariableManagementService
 - 将LoadAllMenusAsync方法移到MenuManagementService
 - 将LoadAllMqttServersAsync方法移到MqttManagementService
 - 将LoadAllNlogsAsync方法移到LogManagementService
 - 更新DataLoaderService以使用管理服务提供的方法
 - 修改IDataLoaderService接口以移除这些方法
 - 保持与LoadAllTriggersAsync相同的模式
 - 遵循单一职责原则,提高代码一致性" (提交修改并添加描述性的提交信息)
This commit is contained in:
2025-10-18 17:59:21 +08:00
parent 595139fb02
commit 740688d575
16 changed files with 169 additions and 200 deletions

View File

@@ -89,5 +89,18 @@ public class LogManagementService : ILogManagementService
}
}
/// <summary>
/// 异步加载所有日志数据到内存中。
/// </summary>
public async Task LoadAllNlogsAsync(int count)
{
_appStorageService.Nlogs.Clear();
var nlogDtos = await _nlogAppService.GetLatestLogsAsync(count);
// 加载日志数据到内存
foreach (var nlogDto in nlogDtos)
{
_appStorageService.Nlogs.TryAdd(nlogDto.Id, nlogDto);
}
}
}