|
|
|
@ -19,23 +19,42 @@ namespace Common.Shared.Application.DaHua |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>方法名(平台定义,不同大类可能不同)</summary> |
|
|
|
/// <summary>方法名(平台定义,不同大类可能不同)</summary> |
|
|
|
[JsonPropertyName("method")] |
|
|
|
[JsonPropertyName("method")] |
|
|
|
public string? Method { get; set; } |
|
|
|
public string Method { get; set; } = string.Empty; // 改为非空,符合必填要求 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>序号(非唯一标识,平台侧递增)</summary> |
|
|
|
/// <summary>序号(非唯一标识,平台侧递增)</summary> |
|
|
|
[JsonPropertyName("id")] |
|
|
|
[JsonPropertyName("id")] |
|
|
|
public long? Id { get; set; } |
|
|
|
public long Id { get; set; } // 改为非空,符合必填要求 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>子系统名称(与你订阅时的 subsystem.name/magic 对应)</summary> |
|
|
|
/// <summary>子系统名称(与你订阅时的 subsystem.name/magic 对应)</summary> |
|
|
|
[JsonPropertyName("subsystem")] |
|
|
|
[JsonPropertyName("subsystem")] |
|
|
|
public string? Subsystem { get; set; } |
|
|
|
public string Subsystem { get; set; } = string.Empty; // 改为非空,符合必填要求 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>域 ID(级联域标识)</summary> |
|
|
|
/// <summary>域 ID(级联域标识)</summary> |
|
|
|
[JsonPropertyName("domainId")] |
|
|
|
[JsonPropertyName("domainId")] |
|
|
|
public string? DomainId { get; set; } |
|
|
|
public string? DomainId { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>实际负载(不同大类结构不同,统一先接成 JsonElement)</summary> |
|
|
|
/// <summary>实际负载(不同大类结构不同)</summary> |
|
|
|
[JsonPropertyName("info")] |
|
|
|
[JsonPropertyName("info")] |
|
|
|
public AlarmVO Info { get; set; } |
|
|
|
public AlarmVO Info { get; set; } = new AlarmVO(); // 初始化避免空引用 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 忽略JSON中存在但实体类未定义的字段(如userIds、sid、uuid等) |
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public object? UserIds { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public object? Sid { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public object? InfoArray { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public object? Protocol { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public object? SupplementFlag { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
|
|
|
|
|
|
|
public string? Uuid { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -45,79 +64,86 @@ namespace Common.Shared.Application.DaHua |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// <summary>设备编码</summary> |
|
|
|
/// <summary>设备编码</summary> |
|
|
|
[JsonPropertyName("deviceCode")] |
|
|
|
[JsonPropertyName("deviceCode")] |
|
|
|
public string? DeviceCode { get; set; } |
|
|
|
public string? DeviceCode { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>设备名称</summary> |
|
|
|
/// <summary>设备名称</summary> |
|
|
|
[JsonPropertyName("deviceName")] |
|
|
|
[JsonPropertyName("deviceName")] |
|
|
|
public string? DeviceName { get; set; } |
|
|
|
public string? DeviceName { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>通道序号</summary> |
|
|
|
/// <summary>通道序号</summary> |
|
|
|
[JsonPropertyName("channelSeq")] |
|
|
|
[JsonPropertyName("channelSeq")] |
|
|
|
public int? ChannelSeq { get; set; } |
|
|
|
public int? ChannelSeq { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>通道名称</summary> |
|
|
|
/// <summary>通道名称</summary> |
|
|
|
[JsonPropertyName("channelName")] |
|
|
|
[JsonPropertyName("channelName")] |
|
|
|
public string? ChannelName { get; set; } |
|
|
|
public string? ChannelName { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>单元类型(必填:平台字段 unitType)</summary> |
|
|
|
/// <summary>单元类型(必填:平台字段 unitType)</summary> |
|
|
|
[JsonPropertyName("unitType")] |
|
|
|
[JsonPropertyName("unitType")] |
|
|
|
public int UnitType { get; set; } |
|
|
|
public int UnitType { get; set; } // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>单元序号(必填:平台字段 unitSeq)</summary> |
|
|
|
/// <summary>单元序号(非必填:平台字段 unitSeq)</summary> |
|
|
|
[JsonPropertyName("unitSeq")] |
|
|
|
[JsonPropertyName("unitSeq")] |
|
|
|
public int UnitSeq { get; set; } |
|
|
|
public int? UnitSeq { get; set; } // 改为可空,非必填(关键修改) |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警唯一编码(幂等键之一)</summary> |
|
|
|
/// <summary>报警唯一编码(幂等键之一)</summary> |
|
|
|
[JsonPropertyName("alarmCode")] |
|
|
|
[JsonPropertyName("alarmCode")] |
|
|
|
public string AlarmCode { get; set; } = string.Empty; |
|
|
|
public string AlarmCode { get; set; } = string.Empty; // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警状态:1 产生;2 消失(幂等键之一)</summary> |
|
|
|
/// <summary>报警状态:1 产生;2 消失(幂等键之一)</summary> |
|
|
|
[JsonPropertyName("alarmStat")] |
|
|
|
[JsonPropertyName("alarmStat")] |
|
|
|
public int AlarmStat { get; set; } |
|
|
|
public int AlarmStat { get; set; } // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警类型</summary> |
|
|
|
/// <summary>报警类型</summary> |
|
|
|
[JsonPropertyName("alarmType")] |
|
|
|
[JsonPropertyName("alarmType")] |
|
|
|
public int AlarmType { get; set; } |
|
|
|
public int AlarmType { get; set; } // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警级别</summary> |
|
|
|
/// <summary>报警级别</summary> |
|
|
|
[JsonPropertyName("alarmGrade")] |
|
|
|
[JsonPropertyName("alarmGrade")] |
|
|
|
public int AlarmGrade { get; set; } |
|
|
|
public int AlarmGrade { get; set; } // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警时间(秒级时间戳,平台可能传字符串或数字,建议按字符串接收)</summary> |
|
|
|
/// <summary>报警时间(秒级时间戳,平台可能传字符串或数字)</summary> |
|
|
|
[JsonPropertyName("alarmDate")] |
|
|
|
[JsonPropertyName("alarmDate")] |
|
|
|
public string AlarmDate { get; set; } = string.Empty; |
|
|
|
public string AlarmDate { get; set; } = string.Empty; // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警图片相对路径(如需取图需按平台 OSS 规则拼接)</summary> |
|
|
|
/// <summary>报警图片相对路径</summary> |
|
|
|
[JsonPropertyName("alarmPicture")] |
|
|
|
[JsonPropertyName("alarmPicture")] |
|
|
|
public string? AlarmPicture { get; set; } |
|
|
|
public string? AlarmPicture { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>报警图片大小(字节)</summary> |
|
|
|
/// <summary>报警图片大小(字节)</summary> |
|
|
|
[JsonPropertyName("alarmPictureSize")] |
|
|
|
[JsonPropertyName("alarmPictureSize")] |
|
|
|
public long? AlarmPictureSize { get; set; } |
|
|
|
public long? AlarmPictureSize { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>备注信息</summary> |
|
|
|
/// <summary>备注信息</summary> |
|
|
|
[JsonPropertyName("memo")] |
|
|
|
[JsonPropertyName("memo")] |
|
|
|
public string? Memo { get; set; } |
|
|
|
public string? Memo { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>节点类型:1 设备;2 通道</summary> |
|
|
|
/// <summary>节点类型:1 设备;2 通道</summary> |
|
|
|
[JsonPropertyName("nodeType")] |
|
|
|
[JsonPropertyName("nodeType")] |
|
|
|
public int NodeType { get; set; } |
|
|
|
public int NodeType { get; set; } // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>节点编码(设备或通道编码)</summary> |
|
|
|
/// <summary>节点编码(设备或通道编码)</summary> |
|
|
|
[JsonPropertyName("nodeCode")] |
|
|
|
[JsonPropertyName("nodeCode")] |
|
|
|
public string NodeCode { get; set; } = string.Empty; |
|
|
|
public string NodeCode { get; set; } = string.Empty; // 保持非空,必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>组织编码</summary> |
|
|
|
/// <summary>组织编码</summary> |
|
|
|
[JsonPropertyName("orgCode")] |
|
|
|
[JsonPropertyName("orgCode")] |
|
|
|
public string? OrgCode { get; set; } |
|
|
|
public string? OrgCode { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>组织名称</summary> |
|
|
|
/// <summary>组织名称</summary> |
|
|
|
[JsonPropertyName("orgName")] |
|
|
|
[JsonPropertyName("orgName")] |
|
|
|
public string? OrgName { get; set; } |
|
|
|
public string? OrgName { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>扩展字段(不同类型报警差异字段)</summary> |
|
|
|
/// <summary>扩展字段(不同类型报警差异字段)</summary> |
|
|
|
[JsonPropertyName("extend")] |
|
|
|
[JsonPropertyName("extend")] |
|
|
|
public JsonElement? Extend { get; set; } |
|
|
|
public JsonElement? Extend { get; set; } // 保持可空,非必填 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 忽略JSON中存在但文档未定义的扩展字段(isSave、isEvent等) |
|
|
|
|
|
|
|
[JsonIgnore] |
|
|
|
|
|
|
|
public bool? IsSave { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[JsonIgnore] |
|
|
|
|
|
|
|
public bool? IsEvent { get; set; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public sealed class SubscribeDataDto |
|
|
|
public sealed class SubscribeDataDto |
|
|
|
|