完成新建设备的单元 测试包括,添加变量表,和添加菜单

This commit is contained in:
2025-07-24 15:07:03 +08:00
parent b0d5db3626
commit ac38128e4d
33 changed files with 497 additions and 416 deletions

View File

@@ -5,6 +5,5 @@ public enum MenuType
MainMenu,
DeviceMenu,
VariableTableMenu,
AddVariableTableMenu,
MqttMenu
}

View File

@@ -49,6 +49,11 @@ public interface IRepositoryManager : IDisposable
/// </summary>
IUserRepository Users { get; set; }
/// <summary>
/// 初始化数据库
/// </summary>
IInitializeRepository InitializeRepository { get; set; }
/// <summary>
/// 开始一个新的数据库事务。
/// </summary>

View File

@@ -0,0 +1,10 @@
namespace DMS.Core.Interfaces.Repositories;
public interface IInitializeRepository
{
void InitializeTables();
void InitializeTableIndex();
bool IsAnyTable(string tableName);
bool IsAnyIndex(string indexName);
void InitializeMenus();
}

View File

@@ -62,4 +62,7 @@ public class Device
/// 此设备包含的变量表集合。
/// </summary>
public List<VariableTable> VariableTables { get; set; } = new();
public string CpuType { get; set; }
public DeviceType DeviceType { get; set; }
}

View File

@@ -1,3 +1,5 @@
using DMS.Core.Enums;
namespace DMS.Core.Models;
/// <summary>
@@ -9,7 +11,15 @@ public class MenuBean
public int? ParentId { get; set; }
public string Header { get; set; }
public string Icon { get; set; }
public string TargetViewKey { get; set; }
/// <summary>
/// 菜单的类型,例如菜单关联的是设备还是变量表或者是MQTT
/// </summary>
public MenuType MenuType { get; set; }
/// <summary>
/// 菜单关联的数据ID例如设备Id变量表Id
/// </summary>
public int TargetId { get; set; }
public string NavigationParameter { get; set; }
public int DisplayOrder { get; set; }
}

View File

@@ -27,7 +27,7 @@ public class Variable
/// <summary>
/// 在设备中的地址 (例如: DB1.DBD0, M100.0)。
/// </summary>
public string Address { get; set; }
public string S7Address { get; set; }
/// <summary>
/// 变量的信号类型,例如启动信号、停止信号。