refactor:完成重构设备的添加,删除,更新。
This commit is contained in:
67
DMS.Application/Services/AppDataService.cs
Normal file
67
DMS.Application/Services/AppDataService.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using System.Collections.Concurrent;
|
||||
using DMS.Application.DTOs;
|
||||
using DMS.Application.Interfaces;
|
||||
using DMS.Core.Models;
|
||||
using DMS.Core.Models.Triggers;
|
||||
|
||||
namespace DMS.Application.Services;
|
||||
|
||||
public class AppDataService : IAppDataService
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有设备数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, Device> Devices { get; } = new();
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有变量表数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, VariableTable> VariableTables { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有变量数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, Variable> Variables { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有菜单数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, MenuBean> Menus { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有菜单数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, MenuBean> MenuTrees { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有MQTT服务器数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, MqttServer> MqttServers { get; } = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有MQTT变量别名的数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, MqttAlias> MqttAliases { get; } = new();
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有历史记录
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, VariableHistoryDto> VariableHistories { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有日志数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, NlogDto> Nlogs { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有触发器定义数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, Trigger> Triggers { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 安全字典,用于存储所有触发器与变量关联数据
|
||||
/// </summary>
|
||||
public ConcurrentDictionary<int, TriggerVariable> TriggerVariables { get; } = new();
|
||||
}
|
||||
Reference in New Issue
Block a user