调整 .gitignore 以适配 backends 目录结构
将 MiGu.Server 相关忽略规则迁移至 backends/MiGu.Server,并新增对 .tmp-build* 和 /.cursor/rules 的忽略,优化敏感数据与临时文件的管理。
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
namespace MiGu.Server.Configs;
|
||||
|
||||
public record DeviceDriverBinding(string Id, string DeviceType, string DriverName, string Version);
|
||||
|
||||
public record DeviceInstance(
|
||||
string Id, string Name, string DeviceType, string Protocol, string Address,
|
||||
string DriverId, bool Enabled);
|
||||
|
||||
public record DeviceHealthPolicy(int HeartbeatSec, int OfflineSec);
|
||||
|
||||
public record AlarmRule(string Level, string Condition);
|
||||
public record AlarmPolicy(bool Enabled, List<AlarmRule> Rules);
|
||||
|
||||
public record DeviceManagementConfig(
|
||||
List<DeviceDriverBinding> Drivers,
|
||||
List<DeviceInstance> Devices,
|
||||
DeviceHealthPolicy HealthPolicy,
|
||||
AlarmPolicy AlarmPolicy)
|
||||
{
|
||||
public static DeviceManagementConfig Default() => new(
|
||||
Drivers: new List<DeviceDriverBinding>
|
||||
{
|
||||
new("drv-elev", "电梯", "OpcUaElevatorDriver", "1.2.0"),
|
||||
new("drv-chrg", "充电桩", "ModbusChargerDriver", "1.0.5"),
|
||||
new("drv-cam", "摄像头", "OnvifCameraDriver", "2.1.0")
|
||||
},
|
||||
Devices: new List<DeviceInstance>
|
||||
{
|
||||
new("dev-elev-1", "#1 电梯", "电梯", "opc-ua", "opc.tcp://10.0.2.20:4840", "drv-elev", true),
|
||||
new("dev-chrg-1", "充电桩-A1", "充电桩", "modbus-tcp", "10.0.2.30:502", "drv-chrg", true)
|
||||
},
|
||||
HealthPolicy: new DeviceHealthPolicy(5, 30),
|
||||
AlarmPolicy: new AlarmPolicy(true, new List<AlarmRule>
|
||||
{
|
||||
new("warn", "offline>30s"),
|
||||
new("error", "driverException")
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user