using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Waste.Application.ThirdApiInfo
{
    /// <summary>
    /// 心跳包上报数据
    /// </summary>
    public class DevHeartRequestDto
    {
        /// <summary>
        /// 机器码
        /// </summary>
        public string ECode { get; set; } = "";
        /// <summary>
        /// IMEI
        /// </summary>
        public string IMEI { get; set; } = "";
        /// <summary>
        /// ICCID
        /// </summary>
        public string ICCID { get; set; } = "";
        /// <summary>
        /// IMSI
        /// </summary>
        public string IMSI { get; set; } = "";
        /// <summary>
        /// 信号强度
        /// </summary>
        public int GSLQ { get; set; } = 0;
        /// <summary>
        /// 纬度
        /// </summary>
        public decimal Latitude { get; set; } = 0;
        /// <summary>
        /// 经度
        /// </summary>
        public decimal Longitude { get; set; } = 0;
    }
    /// <summary>
    /// 注册注册信息返回值
    /// </summary>
    public class DevRegInfoResponseDto
    {
        /// <summary>
        /// 设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用，5-未知
        /// </summary>
        public int status { get; set; } = 0;
        /// <summary>
        /// 波特率
        /// </summary>
        public int baudrate { get; set; } = 9600;
        /// <summary>
        /// 串口号
        /// </summary>
        public string serialno { get; set; } = "/dev/ttyS3";
        /// <summary>
        /// websocket地址
        /// </summary>
        public string WebSocketUrl { get; set; } = "wss://api.device.suzhou.ljflytjl.cn/device_rpc";

        /// <summary>
        /// 时间戳
        /// </summary>
        public int timestamp { get; set; }
        /// <summary>
        /// 随机数
        /// </summary>
        public int noncestr { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId { get; set; }
        /// <summary>
        /// secret
        /// </summary>
        public string Secret { get; set; }
        /// <summary>
        /// secrethash
        /// </summary>
        public string SecretHash { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string DeviceId { get; set; } = "";
    }
    /// <summary>
    /// 更新上报结果
    /// </summary>
    public class UpdateStatusDto
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public string ResultId { get; set; } = "";

        /// <summary>
        /// 机器码
        /// </summary>
        public string ECode { get; set; } = "";
        /// <summary>
        /// 上报状态,1-成功,0-失败
        /// </summary>
        public int status { get; set; } = 0;
    }

    /// <summary>
    /// 获取设备信息请求数据,并上报数据
    /// </summary>
    public class GetDevInfoRequestDto: DevHeartRequestDto
    {
        /// <summary>
        /// 记录ID
        /// </summary>
        public string ResultId { get; set; } = "";
        /// <summary>
        /// 串口数据
        /// </summary>
        public string data { get; set; } = "";
    }
    /// <summary>
    /// 获取设备信息响应数据
    /// </summary>
    public class GetDevInfoResponseDto
    {
        /// <summary>
        /// 解析数据是否正常
        /// </summary>
        public bool IsSuccessed { get; set; } = false;
        /// <summary>
        /// 时间戳
        /// </summary>
        public int timestamp { get; set; }
        /// <summary>
        /// 随机数
        /// </summary>
        public int noncestr { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public string UserId { get; set; }
        /// <summary>
        /// secret
        /// </summary>
        public string Secret { get; set; }
        /// <summary>
        /// secrethash
        /// </summary>
        public string SecretHash { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string DeviceId { get; set; } = "";
        /// <summary>
        /// 上报地址
        /// </summary>
        public string PostUrl { get; set; } = "";
        /// <summary>
        /// 垃圾桶编号
        /// </summary>
        public string trash { get; set; } = "";
        /// <summary>
        /// 垃圾类型
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 体重
        /// </summary>
        public double Weight { get; set; }

        /// <summary>
        /// 设备状态,0-使用中,1-异常,2-检修,3-检修结束,4-启用，5-未知
        /// </summary>
        public int status { get; set; } = 0;

        /// <summary>
        /// 数据扫描时间,UNIX时间戳
        /// </summary>
        public int ScanningTime { get; set; }
        /// <summary>
        /// 签名
        /// </summary>
        public string sign { get; set; }
        /// <summary>
        /// 记录ID
        /// </summary>
        public Guid ResultId { get; set; }
    }
    /// <summary>
    /// 日志上报
    /// </summary>
    public class BugModel
    {
        /// <summary>
        /// 机器码
        /// </summary>
        public string ecode { get; set; }
        /// <summary>
        /// 位置
        /// </summary>
        public string ExceptionPos { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string ExceptionInfo { get; set; }
    }
    /// <summary>
    /// wifi模块发送的数据
    /// </summary>
    public class WifiRequestC2SDto
    {
        /// <summary>
        /// 参数,包含sn和测量数据
        /// </summary>
        public string @params { get; set; }
    }
    /// <summary>
    /// wifi模块发送的数据解析
    /// </summary>
    public class WifiRequestS2SDto
    {
        /// <summary>
        /// 设备机器码
        /// </summary>
        public string sn { get; set; }

        /// <summary>
        /// 包头,固定为A9
        /// </summary>
        public string Header { get; set; } = "";

        /// <summary>
        /// 分隔符,固定为00
        /// </summary>
        public string splitstr { get; set; } = "";
        /// <summary>
        /// 解密出的16进制数据
        /// </summary>
        public string data { get; set; } = "";

        /// <summary>
        /// 数据是否验证通过
        /// </summary>
        public bool ischecked { get; set; } = true;
        /// <summary>
        /// 是否为心跳包
        /// </summary>
        public bool IsHeart { get; set; } = false;
        /// <summary>
        /// 结果集
        /// </summary>
        public byte[] databyte { get; set; }
    }
    /// <summary>
    /// 消息发送
    /// </summary>
    public class SendMessageS2SDto
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public Guid DeviceId { get; set; }
        /// <summary>
        /// 垃圾类别
        /// </summary>
        public string WasteType { get; set; }
        /// <summary>
        /// 重量,单位KG
        /// </summary>
        public string Weight { get; set; }
        /// <summary>
        /// 垃圾桶编号
        /// </summary>
        public string TrashCode { get; set; }
        /// <summary>
        /// 上报时间
        /// </summary>
        public DateTime Time { get; set; }
    }
}
