添加了数据库相关了类,和枚举类型相关的类,并且将枚举类型绑定到前段

This commit is contained in:
2025-06-20 18:53:29 +08:00
parent 5dfce624c4
commit 908dc60439
29 changed files with 437 additions and 151 deletions

View File

@@ -1,4 +1,8 @@
using System.Net.Sockets;
using PMSWPF.Enums;
using SqlSugar;
using SqlSugar.DbConvert;
using ProtocolType = PMSWPF.Enums.ProtocolType;
namespace PMSWPF.Data.Entities;
@@ -9,9 +13,18 @@ public class DbDevice
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//数据库是自增才配自增
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
[SugarColumn(IsNullable = true)]
public string? Description { get; set; }
public string Ip { get; set; }
public bool IsActive { get; set; }
public bool IsRuning { get; set; }
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
public DeviceType DeviceType { get; set; }
[Navigate(NavigateType.OneToMany, nameof(DbVariableTable.DeviceId))]
[SugarColumn(IsNullable = true)]
public List<DbVariableTable>? VariableTables { get; set; }
[SugarColumn(ColumnDataType="varchar(20)",SqlParameterDbType=typeof(EnumToStringConvert))]
public ProtocolType ProtocolType { get; set; }
}