using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections.Generic; namespace CoreAgent.Domain.Models.Protocol; /// /// 协议日志实体类 /// public record class ProtocolLog { /// /// 消息ID /// [JsonProperty("message_id")] public int? MessageId { get; set; } /// /// 消息头信息 /// [JsonProperty("headers")] public string[]? Headers { get; set; } /// /// 消息内容 /// [JsonProperty("message")] public string Message { get; set; } /// /// 消息类型 /// [JsonProperty("type")] public string? Type { get; set; } /// /// 消息名称 /// [JsonProperty("name")] public string? Name { get; set; } /// /// 协议版本 /// [JsonProperty("version")] public string? Version { get; set; } /// /// 时间戳 /// [JsonProperty("time")] public double? Time { get; set; } /// /// UTC时间戳 /// [JsonProperty("utc")] public double? Utc { get; set; } /// /// 日志明细 /// [JsonProperty("logs")] public JToken? Logs { get; set; } /// /// 初始化协议日志实体类的新实例 /// /// 消息内容 /// 消息类型 /// 协议版本 /// 时间戳 /// UTC时间戳 /// 日志明细 /// 消息ID /// 消息头信息 public ProtocolLog( string message, string? type, string? version, double? time, double? utc, JToken? logs, int? messageId, string[]? headers) { Message = message; Type = type; Version = version; Name = type; Utc = utc; Time = time; Logs = logs; MessageId = messageId ?? 0; Headers = headers; } }