You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.3 KiB
C#

9 months ago
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace POSV.DevOps.Entity
{
/// <summary>
/// MQTT消息类型
/// </summary>
public enum MqttNotifyEnum
{
None,
,
,
,
线,
,
,
,
}
/// <summary>
/// MQTT消息实体
/// </summary>
[Serializable]
[JsonObject(MemberSerialization.OptIn)]
public class MqttNotify
{
/// <summary>
/// 消息类型
/// </summary>
[JsonProperty(PropertyName = "type")]
public string Type { get; set; }
[JsonIgnore]
public MqttNotifyEnum NotifyType { get; set; }
/// <summary>
/// 消息子类型
/// </summary>
[JsonProperty(PropertyName = "sub_type")]
public string SubType { get; set; } = string.Empty;
/// <summary>
/// 消息发送时间 yyyy-MM-dd HH:mm:ss
/// </summary>
[JsonProperty(PropertyName = "send_date")]
public string SendDate { get; set; } = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
/// <summary>
/// 内容
/// </summary>
[JsonProperty(PropertyName = "data")]
public string Data { get; set; } = string.Empty;
}
}