refactor:完成重构设备的添加,删除,更新。

This commit is contained in:
2025-10-22 14:06:16 +08:00
parent e995ec7207
commit 54d040b45f
76 changed files with 1028 additions and 1161 deletions

View File

@@ -17,7 +17,7 @@ namespace DMS.Infrastructure.Services.Mqtt
private readonly ILogger<MqttBackgroundService> _logger;
private readonly IMqttServiceManager _mqttServiceManager;
private readonly IEventService _eventService;
private readonly IAppStorageService _appStorageService;
private readonly IAppDataService _appDataService;
private readonly IAppCenterService _appCenterService;
private readonly ConcurrentDictionary<int, MqttServer> _mqttServers;
private readonly SemaphoreSlim _reloadSemaphore = new(0);
@@ -26,13 +26,13 @@ namespace DMS.Infrastructure.Services.Mqtt
ILogger<MqttBackgroundService> logger,
IMqttServiceManager mqttServiceManager,
IEventService eventService,
IAppStorageService appStorageService,
IAppDataService appStorageService,
IAppCenterService appCenterService)
{
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_mqttServiceManager = mqttServiceManager ?? throw new ArgumentNullException(nameof(mqttServiceManager));
_eventService = eventService;
_appStorageService = appStorageService;
_appDataService = appStorageService;
_appCenterService = appCenterService ?? throw new ArgumentNullException(nameof(appCenterService));
_mqttServers = new ConcurrentDictionary<int, MqttServer>();
@@ -186,7 +186,7 @@ namespace DMS.Infrastructure.Services.Mqtt
_mqttServers.Clear();
// 从数据服务中心获取所有激活的MQTT服务器
var mqttServers = _appStorageService.MqttServers.Values.ToList();
var mqttServers = _appDataService.MqttServers.Values.ToList();
foreach (var mqttServer in mqttServers)
{