按照软件设计文档开始重构代码01

This commit is contained in:
2025-07-21 14:35:17 +08:00
parent a7b0a5d108
commit 29a2d44319
127 changed files with 12265 additions and 1586 deletions

View File

@@ -1,49 +1,13 @@
using System;
using SqlSugar;
namespace DMS.Infrastructure.Entities;
/// <summary>
/// 表示数据库中的变量数据历史实体。
/// </summary>
[SugarTable("VarDataHistory")]
[SugarTable("VariableHistories")]
public class DbVariableHistory
{
/// <summary>
/// 历史记录唯一标识符。
/// </summary>
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
/// <summary>
/// 变量名称。
/// </summary>
public string Name { get; set; }
/// <summary>
/// 节点ID用于标识变量在设备或系统中的唯一路径。
/// </summary>
[SugarColumn(IsNullable = true)]
public string NodeId { get; set; } = String.Empty;
/// <summary>
/// 变量当前原始数据值。
/// </summary>
public string DataValue { get; set; } = String.Empty;
/// <summary>
/// 关联的DbVariableData的ID。
/// </summary>
public long Id { get; set; }
public int VariableId { get; set; }
/// <summary>
/// 关联的DbVariableData实体。
/// </summary>
[Navigate(NavigateType.ManyToOne, nameof(VariableId))]
public DbVariable? Variable { get; set; }
/// <summary>
/// 历史记录的时间戳。
/// </summary>
public DateTime Timestamp { get; set; } = DateTime.Now;
public string Value { get; set; }
public DateTime Timestamp { get; set; }
}