refactor:删除了DeviceDto,VariableDto,VariableTableDto,改为使用DMS.Core中的实体

This commit is contained in:
2025-10-07 17:51:24 +08:00
parent 94ad940e03
commit b753e5ea73
52 changed files with 291 additions and 463 deletions

View File

@@ -1,5 +1,6 @@
using DMS.Application.DTOs;
using DMS.Core.Enums;
using DMS.Core.Models;
namespace DMS.Application.Events
{
@@ -11,7 +12,7 @@ namespace DMS.Application.Events
/// <summary>
/// 导入的变量列表
/// </summary>
public List<VariableDto> Variables { get; }
public List<Variable> Variables { get; }
/// <summary>
/// 导入的变量数量
@@ -27,9 +28,9 @@ namespace DMS.Application.Events
/// 构造函数
/// </summary>
/// <param name="variables">导入的变量列表</param>
public BatchImportVariablesEventArgs(List<VariableDto> variables)
public BatchImportVariablesEventArgs(List<Variable> variables)
{
Variables = variables ?? new List<VariableDto>();
Variables = variables ?? new List<Variable>();
Count = Variables.Count;
ChangeTime = DateTime.Now;
}

View File

@@ -1,5 +1,5 @@
using DMS.Application.DTOs;
using DMS.Core.Enums;
using DMS.Core.Models;
namespace DMS.Application.Events
{
@@ -16,7 +16,7 @@ namespace DMS.Application.Events
/// <summary>
/// 设备DTO
/// </summary>
public DeviceDto Device { get; }
public Device Device { get; }
/// <summary>
/// 变更时间
@@ -28,7 +28,7 @@ namespace DMS.Application.Events
/// </summary>
/// <param name="changeType">变更类型</param>
/// <param name="device">设备DTO</param>
public DeviceChangedEventArgs(DataChangeType changeType, DeviceDto device)
public DeviceChangedEventArgs(DataChangeType changeType, Device device)
{
ChangeType = changeType;
Device = device;

View File

@@ -1,5 +1,6 @@
using DMS.Application.DTOs;
using DMS.Core.Enums;
using DMS.Core.Models;
namespace DMS.Application.Events
{
@@ -16,7 +17,7 @@ namespace DMS.Application.Events
/// <summary>
/// 变量DTO
/// </summary>
public VariableDto Variable { get; }
public Variable Variable { get; }
/// <summary>
/// 发生变化的属性类型
@@ -29,7 +30,7 @@ namespace DMS.Application.Events
/// <param name="changeType">变更类型</param>
/// <param name="variable">变量DTO</param>
/// <param name="propertyType">发生变化的属性类型</param>
public VariableChangedEventArgs(ActionChangeType changeType, VariableDto variable, VariablePropertyType propertyType = VariablePropertyType.All)
public VariableChangedEventArgs(ActionChangeType changeType, Variable variable, VariablePropertyType propertyType = VariablePropertyType.All)
{
ChangeType = changeType;
Variable = variable;

View File

@@ -1,5 +1,5 @@
using DMS.Application.DTOs;
using DMS.Core.Enums;
using DMS.Core.Models;
namespace DMS.Application.Events
{
@@ -16,7 +16,7 @@ namespace DMS.Application.Events
/// <summary>
/// 变量表DTO
/// </summary>
public VariableTableDto VariableTable { get; }
public VariableTable VariableTable { get; }
/// <summary>
@@ -30,7 +30,7 @@ namespace DMS.Application.Events
/// <param name="changeType">变更类型</param>
/// <param name="variableTable">变量表DTO</param>
/// <param name="device">关联的设备DTO</param>
public VariableTableChangedEventArgs(DataChangeType changeType, VariableTableDto variableTable)
public VariableTableChangedEventArgs(DataChangeType changeType, VariableTable variableTable)
{
ChangeType = changeType;
VariableTable = variableTable;

View File

@@ -1,4 +1,5 @@
using DMS.Application.DTOs;
using DMS.Core.Models;
namespace DMS.Application.Events
{
@@ -10,7 +11,7 @@ namespace DMS.Application.Events
/// <summary>
/// 变量DTO对象
/// </summary>
public VariableDto Variable { get; set; }
public Variable Variable { get; set; }
/// <summary>
/// 旧值
@@ -20,7 +21,7 @@ namespace DMS.Application.Events
/// <summary>
/// 构造函数
/// </summary>
public VariableValueChangedEventArgs(VariableDto variable, string? oldValue)
public VariableValueChangedEventArgs(Variable variable, string? oldValue)
{
Variable = variable;
OldValue = oldValue;