refactor:删除MqttServerDto,将使用MqttServerDto的全部转为使用MqttServer

This commit is contained in:
2025-10-06 19:32:45 +08:00
parent c85f89db33
commit 94ad940e03
17 changed files with 174 additions and 222 deletions

View File

@@ -118,7 +118,7 @@ public class DataLoaderService : IDataLoaderService
if (_appDataStorageService.MqttServers.TryGetValue(variableMqttAlias.MqttServerId, out var mqttServer))
{
variableMqttAlias.MqttServer = _mapper.Map<MqttServer>(mqttServer);
variableMqttAlias.MqttServer = mqttServer;
mqttServer.VariableAliases?.Add(variableMqttAlias);
}
}
@@ -209,11 +209,11 @@ public class DataLoaderService : IDataLoaderService
public async Task LoadAllMqttServersAsync()
{
_appDataStorageService.MqttServers.Clear();
var mqttServerDtos =await _mqttAppService.GetAllMqttServersAsync();
var mqttServers =await _mqttAppService.GetAllMqttServersAsync();
// 加载MQTT服务器数据到内存
foreach (var mqttServerDto in mqttServerDtos)
foreach (var mqttServer in mqttServers)
{
_appDataStorageService.MqttServers.TryAdd(mqttServerDto.Id, mqttServerDto);
_appDataStorageService.MqttServers.TryAdd(mqttServer.Id, mqttServer);
}
}