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.
58 lines
1.6 KiB
58 lines
1.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CoreAgent.WebSocketTransport.Models
|
|
{
|
|
/// <summary>
|
|
/// 协议消息模型
|
|
/// 用于封装和传输协议相关的消息数据
|
|
/// </summary>
|
|
public class ProtocolMessage
|
|
{
|
|
/// <summary>
|
|
/// 消息类型标识
|
|
/// 默认为 "Protocol",表示协议类型消息
|
|
/// </summary>
|
|
public string Type { get; set; } = "Protocol";
|
|
|
|
/// <summary>
|
|
/// 消息载荷数据
|
|
/// 包含具体的协议日志数据
|
|
/// </summary>
|
|
public ProtocolPayload Payload { get; set; }
|
|
|
|
/// <summary>
|
|
/// 初始化协议消息的新实例
|
|
/// </summary>
|
|
/// <param name="messages">协议日志消息数组</param>
|
|
public ProtocolMessage(MessageTransferProtocolLog[] messages)
|
|
{
|
|
Payload = new ProtocolPayload(messages);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 协议消息载荷
|
|
/// 包含具体的协议日志数据内容
|
|
/// </summary>
|
|
public class ProtocolPayload
|
|
{
|
|
/// <summary>
|
|
/// 协议日志消息数组
|
|
/// 存储要传输的协议日志数据
|
|
/// </summary>
|
|
public MessageTransferProtocolLog[] Message { get; set; } = Array.Empty<MessageTransferProtocolLog>();
|
|
|
|
/// <summary>
|
|
/// 初始化协议载荷的新实例
|
|
/// </summary>
|
|
/// <param name="messages">协议日志消息数组</param>
|
|
public ProtocolPayload(MessageTransferProtocolLog[] messages)
|
|
{
|
|
Message = messages;
|
|
}
|
|
}
|
|
}
|