2025-09-09 15:28:07 +08:00
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
|
using DMS.Application.DTOs;
|
|
|
|
|
|
using DMS.Application.Interfaces;
|
2025-10-06 17:25:05 +08:00
|
|
|
|
using DMS.Core.Models;
|
2025-09-09 15:28:07 +08:00
|
|
|
|
|
|
|
|
|
|
namespace DMS.Application.Services;
|
|
|
|
|
|
|
|
|
|
|
|
public class AppDataStorageService : IAppDataStorageService
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有设备数据
|
|
|
|
|
|
/// </summary>
|
2025-10-07 17:51:24 +08:00
|
|
|
|
public ConcurrentDictionary<int, Device> Devices { get; } = new();
|
2025-09-09 15:28:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有变量表数据
|
|
|
|
|
|
/// </summary>
|
2025-10-07 17:51:24 +08:00
|
|
|
|
public ConcurrentDictionary<int, VariableTable> VariableTables { get; } = new();
|
2025-09-09 15:28:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有变量数据
|
|
|
|
|
|
/// </summary>
|
2025-10-07 17:51:24 +08:00
|
|
|
|
public ConcurrentDictionary<int, Variable> Variables { get; } = new();
|
2025-09-09 15:28:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有菜单数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ConcurrentDictionary<int, MenuBeanDto> Menus { get; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有菜单数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ConcurrentDictionary<int, MenuBeanDto> MenuTrees { get; } = new();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有MQTT服务器数据
|
|
|
|
|
|
/// </summary>
|
2025-10-06 19:32:45 +08:00
|
|
|
|
public ConcurrentDictionary<int, MqttServer> MqttServers { get; } = new();
|
2025-09-09 17:47:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有MQTT变量别名的数据
|
|
|
|
|
|
/// </summary>
|
2025-10-11 18:07:01 +08:00
|
|
|
|
public ConcurrentDictionary<int, MqttAlias> MqttAliases { get; } = new();
|
2025-09-11 18:09:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有历史记录
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ConcurrentDictionary<int, VariableHistoryDto> VariableHistories { get; } = new();
|
2025-09-09 15:28:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有日志数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ConcurrentDictionary<int, NlogDto> Nlogs { get; } = new();
|
2025-09-23 05:48:21 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 安全字典,用于存储所有触发器定义数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ConcurrentDictionary<int, TriggerDefinitionDto> Triggers { get; } = new();
|
2025-09-09 15:28:07 +08:00
|
|
|
|
}
|