using System;
using Volo.Abp.Domain.Entities;

namespace JiShe.CollectBus.IotSystems.MessageReceiveds
{
    public class MessageReceived: AggregateRoot<Guid>,IReceived
    {
        public string MessageId { get; set; } = string.Empty;
        /// <summary>
        /// 客服端标识
        /// </summary>
        public string ClientId { get; set; } = string.Empty;

        /// <summary>
        /// 客服端IP
        /// </summary>
        public string ClientIp { get; set; } = string.Empty;

        /// <summary>
        /// 客服端端口
        /// </summary>
        public int ClientPort { get; set; } 

        /// <summary>
        /// 客服端报文
        /// </summary>
        public string MessageHexString { get; set; } = string.Empty;

        /// <summary>
        /// 设备号
        /// </summary>
        public string DeviceNo { get; set; } = string.Empty;

        /// <summary>
        /// 接收指令时间
        /// </summary>
        public string ReceivedTime { get; set; } = string.Empty;
    }

    public class MessageReceivedLogin: MessageReceived
    {
        public bool IsAck { get; set; } = false;

        public DateTime? AckTime { get; set; }
    }

    public class MessageReceivedHeartbeat : MessageReceived
    {
        public bool IsAck { get; set; } = false;

        public DateTime? AckTime { get; set; }
    }

    public class MessageProtocolAnalysis<T> : MessageReceived
    {
        public T Data { get; set; } = default!;
    }
}
