You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
4.3 KiB
122 lines
4.3 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Text.Json; |
|
using System.Text.Json.Serialization; |
|
using System.Threading.Tasks; |
|
|
|
namespace Alarm.Application.ResponeDto |
|
{ |
|
/// <summary> |
|
/// ICC 回调的通用消息封包 |
|
/// </summary> |
|
public class EventEnvelopeDto |
|
{ |
|
/// <summary>事件大类:alarm | business | state | perception</summary> |
|
[JsonPropertyName("category")] |
|
public string Category { get; set; } = string.Empty; |
|
|
|
/// <summary>方法名(平台定义,不同大类可能不同)</summary> |
|
[JsonPropertyName("method")] |
|
public string? Method { get; set; } |
|
|
|
/// <summary>序号(非唯一标识,平台侧递增)</summary> |
|
[JsonPropertyName("id")] |
|
public long? Id { get; set; } |
|
|
|
/// <summary>子系统名称(与你订阅时的 subsystem.name/magic 对应)</summary> |
|
[JsonPropertyName("subsystem")] |
|
public string? Subsystem { get; set; } |
|
|
|
/// <summary>域 ID(级联域标识)</summary> |
|
[JsonPropertyName("domainId")] |
|
public string? DomainId { get; set; } |
|
|
|
/// <summary>实际负载(不同大类结构不同,统一先接成 JsonElement)</summary> |
|
[JsonPropertyName("info")] |
|
public AlarmVO Info { get; set; } |
|
} |
|
|
|
/// <summary> |
|
/// 报警负载 AlarmVO(字段按大华文档命名) |
|
/// </summary> |
|
public class AlarmVO |
|
{ |
|
/// <summary>设备编码</summary> |
|
[JsonPropertyName("deviceCode")] |
|
public string? DeviceCode { get; set; } |
|
|
|
/// <summary>设备名称</summary> |
|
[JsonPropertyName("deviceName")] |
|
public string? DeviceName { get; set; } |
|
|
|
/// <summary>通道序号</summary> |
|
[JsonPropertyName("channelSeq")] |
|
public int? ChannelSeq { get; set; } |
|
|
|
/// <summary>通道名称</summary> |
|
[JsonPropertyName("channelName")] |
|
public string? ChannelName { get; set; } |
|
|
|
/// <summary>单元类型(必填:平台字段 unitType)</summary> |
|
[JsonPropertyName("unitType")] |
|
public int UnitType { get; set; } |
|
|
|
/// <summary>单元序号(必填:平台字段 unitSeq)</summary> |
|
[JsonPropertyName("unitSeq")] |
|
public int UnitSeq { get; set; } |
|
|
|
/// <summary>报警唯一编码(幂等键之一)</summary> |
|
[JsonPropertyName("alarmCode")] |
|
public string AlarmCode { get; set; } = string.Empty; |
|
|
|
/// <summary>报警状态:1 产生;2 消失(幂等键之一)</summary> |
|
[JsonPropertyName("alarmStat")] |
|
public int AlarmStat { get; set; } |
|
|
|
/// <summary>报警类型</summary> |
|
[JsonPropertyName("alarmType")] |
|
public int AlarmType { get; set; } |
|
|
|
/// <summary>报警级别</summary> |
|
[JsonPropertyName("alarmGrade")] |
|
public int AlarmGrade { get; set; } |
|
|
|
/// <summary>报警时间(秒级时间戳,平台可能传字符串或数字,建议按字符串接收)</summary> |
|
[JsonPropertyName("alarmDate")] |
|
public string AlarmDate { get; set; } = string.Empty; |
|
|
|
/// <summary>报警图片相对路径(如需取图需按平台 OSS 规则拼接)</summary> |
|
[JsonPropertyName("alarmPicture")] |
|
public string? AlarmPicture { get; set; } |
|
|
|
/// <summary>报警图片大小(字节)</summary> |
|
[JsonPropertyName("alarmPictureSize")] |
|
public long? AlarmPictureSize { get; set; } |
|
|
|
/// <summary>备注信息</summary> |
|
[JsonPropertyName("memo")] |
|
public string? Memo { get; set; } |
|
|
|
/// <summary>节点类型:1 设备;2 通道</summary> |
|
[JsonPropertyName("nodeType")] |
|
public int NodeType { get; set; } |
|
|
|
/// <summary>节点编码(设备或通道编码)</summary> |
|
[JsonPropertyName("nodeCode")] |
|
public string NodeCode { get; set; } = string.Empty; |
|
|
|
/// <summary>组织编码</summary> |
|
[JsonPropertyName("orgCode")] |
|
public string? OrgCode { get; set; } |
|
|
|
/// <summary>组织名称</summary> |
|
[JsonPropertyName("orgName")] |
|
public string? OrgName { get; set; } |
|
|
|
/// <summary>扩展字段(不同类型报警差异字段)</summary> |
|
[JsonPropertyName("extend")] |
|
public JsonElement? Extend { get; set; } |
|
} |
|
} |