using System;
using TouchSocket.Sockets;
using PropertyChanged;

namespace Rdh.SocketServer.Client.Models
{
    [AddINotifyPropertyChangedInterface]
    public class Pocket
    {
        public Pocket() { }
        public Pocket(SocketClient client, EleMedKitData? data) 
        {
            this.ClientIP = client.IP;
            this.ClientId = client.ID;
            if (data == null) 
            {
                Data = new EleMedKitData() { Message = "数据无效" };
            }
            else 
            {
                Data = data;
            }
        }
        public string ClientId { get; set; }
        public string ClientIP { get; set; }
        public int ClientPort { get; set; }

        public DateTime ReceivedTime { get; set; } = System.DateTime.Now;
        public bool IsHandled { get; set; }
        public EleMedKitData Data { get; set; }
        public IRequestInfo RequestInfo { get; set; }
    }
}
