using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MessagePack;
using MongoDB.Bson;

namespace CommonEntity
{
    public class KafkaKey
    {
        /// <summary>
        /// 自己用 的系统的主题 
        /// </summary>
        public static string BLWLog_RCU_Topic = "blwlog-rcu-udppackage-topic";

        /// <summary>
        /// 新数据会分区
        /// </summary>
        public static string BLWLog_RCU_Topic_Partition = "blwlog-data-topic";
        //public static string BLWLog_RCU_Topic_Partition = "firsttopic";


        /// <summary>
        /// 宝镜系统使用的数据
        /// </summary>
        //public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-udppackage-topic";
        public static string BLWLog4BaoJing_RCU_Topic = "blwlog4BaoJing-rcu-heartbeat-topic";

        #region 日志系统
        /// <summary>
        /// 新的 TS写的日志系统
        /// 心跳包
        /// </summary>
        public static string BLWLog4NodeJs_RCU_Topic = "blwlog4Nodejs-rcu-heartbeat-topic";
        public static string BLWLog4NodeJs_RCU_OnOffLine_Topic = "blwlog4Nodejs-rcu-onoffline-topic-0";
        public static string BLWLog4NodeJs_RCU_Action_Topic = "blwlog4Nodejs-rcu-action-topic";
        public static string Blwlog4Nodejs_oldrcu_heartbeat_topic = "blwlog4Nodejs-oldrcu-heartbeat-topic";

        /// <summary>
        /// 注册
        /// </summary>
        public static string  blwlog4Nodejs_rcu_register_topic= "blwlog4Nodejs-rcu-register-topic";
        public static string  blwlog4Nodejs_rcu_upgrade_topic= "blwlog4Nodejs-rcu-upgrade-topic";

        #endregion

        /// <summary>
        /// 选住使用kafka数据
        /// </summary>
        public static string BLWLog4XuanZhu_RCU_Topic = "blwlog4XuanZhu-rcu-topic";

        /// <summary>
        /// 设备动作数据
        /// </summary>
        public static string UDPPackage_ActionData = "action_change_push";


        /// <summary>
        /// 设备状态变化数据
        /// </summary>
        public static string UDPPackageDeviceStatus = "statuschanges";

        public static string UDPPackageKey = "blwlog-rcu-topic";
        public static string UDPPackageForkSystemKey = "forksystem";
        public static string UDPPackageStepMonitor = "stepmonitor";
        public static string UDPPackagePowerMonitor = "power";
        public static string UDPPackageWholeDataMonitor = "original-power-data";
        public static string IotMonitor = "iot";

        public static string RCUOnLineStatus = "rcu-status";
        public static string TakeCardStatus = "takecard-status";
        public static string ServiceInfoStatus = "serviceinfo-status";
        public static string InvokceThirdHttpInterface = "invoke3httpinterface";
        public static string PMSLogMonitor = "pms";



        public static string RCUNewVersion_RestartReason = "restart-reason";
        public static string RCUNewVersion_TakeCard = "takecard";
        public static string RCUNewVersion_0E = "0X0E";
        public static string RCUNewVersion_Register = "0X01";
        public static string RCUNewTimerData = "0X34";
    }
    //public class UDPPackage
    //{
    //    public string? CommandType { get; set; }
    //    public long TotalCount { get; set; }
    //    public Dictionary<string, long> FenLei { get; set; }
    //    public string? RemoveTime { get; set; }
    //}
    [MessagePackObject]
    public class UDPPackage
    {
        [Key(0)]
        public string? CommandType { get; set; }
        [Key(1)]
        public long TotalCount { get; set; }
        [Key(2)]
        public Dictionary<string, long> FenLei { get; set; }
        [Key(3)]
        public string? RemoveTime { get; set; }

        [Key(4)]
        public Dictionary<string, string> ExtraData { get; set; }

    }


    [MessagePackObject()]
    public class StepInfo
    {
        [Key(0)]
        public string MessageId { get; set; }

        [Key(1)]
        public string? TriggerTime { get; set; }

        [Key(2)]
        public double Step { get; set; }

        [Key(3)]
        public string? StepDescription { get; set; }

        [Key(4)]
        public byte[]? Content { get; set; }
        [Key(5)]
        public long EveryMessageId { get; set; }
        [Key(6)]
        public long Monitor_0E_01 { get; set; }

        [Key(7)]
        public string? HotelCode { get; set; }
        [Key(8)]
        public string? HostNumber { get; set; }
    }

    [MessagePackObject()]
    public class DingShiReportDate
    {
        [Key(0)]
        /// <summary>
        /// HostID
        /// </summary>
        public int HostID { get; set; }

        /// <summary>
        /// 设备类型
        /// </summary>
        [Key(1)]
        public string DeviceType { get; set; }

        /// <summary>
        /// 设备地址
        /// </summary>
        [Key(2)]
        public string Address { get; set; }
        /// <summary>
        /// 状态：1开，2关
        /// </summary>

        [Key(3)]
        public int Status { get; set; }
        /// <summary>
        /// 亮度
        /// </summary>
        [Key(4)]
        public int Brightness { get; set; }
        /// <summary>
        /// 当前温度
        /// </summary>
        [Key(5)]
        public int CurrentTemp { get; set; }
        /// <summary>
        /// 设定温度
        /// </summary>
        [Key(6)]
        public int SettingTemp { get; set; }
        /// <summary>
        /// 风速
        /// </summary>
        [Key(7)]
        public int FanSpeed { get; set; }
        /// <summary>
        /// 模式
        /// </summary>
        [Key(8)]
        public int Mode { get; set; }
        /// <summary>
        /// 阀门
        /// </summary>
        [Key(9)]
        public int Valve { get; set; }
    }


    /// <summary>
    /// 能耗实体类
    /// </summary>
    [MessagePackObject()]
    public class NengHao_Repeat
    {
        [Key(0)]
        public string? address { get; set; }

        [Key(1)]
        public double dianya { get; set; }

        [Key(2)]
        public double dianliu { get; set; }

        [Key(3)]
        public double gonglv { get; set; }

        [Key(4)]
        public double nenghao { get; set; }

        [Key(5)]
        public double zongnenghao { get; set; }
    }

    [MessagePackObject()]
    public class NengHao
    {
        [Key(0)]
        public long HotelCode { get; set; }

        [Key(1)]
        public string? HostNumber { get; set; }

        [Key(2)]
        public string? Mac { get; set; }

        [Key(3)]
        public string? EndPoint { get; set; }

        [Key(4)]
        public string? Version { get; set; }

        [Key(5)]
        public int IsTakeCard { get; set; }

        [Key(6)]
        public List<NengHao_Repeat> NengHaoList { get; set; }

        #region 过期的数据
        //[Key(6)]
        //public double V { get; set; }

        //[Key(7)]
        //public double A { get; set; }

        //[Key(8)]
        //public double P { get; set; }

        ///// <summary>
        ///// 能耗
        ///// </summary>
        //[Key(9)]
        //public double Energy_Consumption { get; set; }

        ///// <summary>
        ///// 总能耗
        ///// </summary>
        //[Key(10)]
        //public double Sum_Energy_Consumption { get; set; }
        #endregion

        [Key(7)]
        public long CreateTime { get; set; }

        [Key(8)]
        public string? ReportTime { get; set; }

        [Key(9)]
        public string? RoomNumber { get; set; }

        [Key(10)]
        public int CarbonVIP { get; set; }

        [Key(11)]
        public List<DingShiReportDate>? AllDeviceData { get; set; }

        [Key(12)]
        public int IdentityInfo { get; set; }


        /// <summary>
        ///短离长离 
        ///我们这里叫卡事件
        /// </summary>
        [Key(13)]
        public ushort CardEvent { get; set; }


        /// <summary>
        /// PMS 状态
        /// </summary>
        [Key(14)]
        public string? PMS_Status { get; set; }

        [Key(15)]
        public int IsInsertCard { get; set; }

        [Key(16)]
        public int Bright_G { get; set; }
    }

    [MessagePackObject()]
    public class NewRoomtusPush
    {
        /// <summary>
        /// 酒店编码
        /// </summary>
        [Key(0)]
        public long code { get; set; }

        [Key(1)]
        public string hostnumber { get; set; }
        /// <summary>
        /// 房号
        /// </summary>
        [Key(2)]
        public string roomNumber { get; set; }
        /// <summary>
        /// 回路地址
        /// </summary>

        [Key(3)]
        public string address { get; set; }
        /// <summary>
        /// 回路名称
        /// </summary>
        [Key(4)]
        public string name { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Key(5)]
        public int status { get; set; }

        /// <summary>
        /// 亮度
        /// </summary>
        [Key(6)]
        public int brightness { get; set; }
        /// <summary>
        /// 当前温度
        /// </summary>
        [Key(7)]
        public int currentTemp { get; set; }
        /// <summary>
        /// 设定温度
        /// </summary>
        [Key(8)]
        public int settingTemp { get; set; }
        /// <summary>
        /// 风速
        /// </summary>
        [Key(9)]
        public int fanSpeed { get; set; }
        /// <summary>
        /// 模式
        /// </summary>
        [Key(10)]
        public int mode { get; set; }
        /// <summary>
        /// 阀门
        /// </summary>
        [Key(11)]
        public int valve { get; set; }

        [Key(12)]
        public long createtime { get; set; }
    }



    [MessagePackObject()]
    public class OtherServiceInfo
    {
        [Key(0)]
        public string? HotelCode { get; set; }

        [Key(1)]
        public string? HostNumber { get; set; }

        [Key(2)]
        public string? Address { get; set; }

        [Key(3)]
        public ushort StatusReceiver { get; set; }

        [Key(4)]
        public DateTime LastUpdateTime { get; set; }
    }


    [MessagePackObject()]
    public class Interface3Log
    {
        [Key(0)]
        public string? HotelCode { get; set; }

        [Key(1)]
        public string? HostNumber { get; set; }

        [Key(2)]
        public string? RoomNumber { get; set; }

        [Key(3)]
        public HttpActionData? ActionData { get; set; }

        [Key(4)]
        public DateTime TriggerTime { get; set; }

        [Key(5)]
        public string? CommandType { get; set; }
    }

    [MessagePackObject()]
    public class HttpActionData
    {
        [Key(0)]
        public double Step { get; set; }

        [Key(1)]
        public string? RequestData { get; set; }

        [Key(2)]
        public string? ResponseData { get; set; }
    }



    public class Interface3Log_db
    {
        public ObjectId _id { get; set; }
        public string? HotelCode { get; set; }
        public string? HostNumber { get; set; }
        public string? RoomNumber { get; set; }
        public HttpActionData? ActionData { get; set; }
        public DateTime TriggerTime { get; set; }
        public string? CommandType { get; set; }
    }

    public class StepInfo_db
    {
        public ObjectId _id { get; set; }
        public string MessageId { get; set; }
        public DateTime? TriggerTime { get; set; }
        public string? TriggerTimeString { get; set; }
        public double Step { get; set; }
        public string? StepDescription { get; set; }
        public byte[]? Content { get; set; }

        public long EveryMessageId { get; set; }
        public long Monitor_0E_01 { get; set; }

        public string? HotelCode { get; set; }
        public string? HostNumber { get; set; }
    }
    public class UDPPackage_db
    {
        public ObjectId _id { get; set; }
        public string? CommandType { get; set; }
        public long TotalCount { get; set; }
        public Dictionary<string, long> FenLei { get; set; }
        public Dictionary<string, string> ExtraData { get; set; }
        public DateTime RemoveTime { get; set; }
        public string? RemoveTimeString { get; set; }
    }

    public class NengHao_db
    {
        public ObjectId _id { get; set; }
        public long HotelCode { get; set; }
        public string? HostNumber { get; set; }
        public string? Mac { get; set; }
        public string? EndPoint { get; set; }
        public string? Version { get; set; }
        public bool IsTakeCard { get; set; }

        public List<NengHao_Repeat> NengHaoList { get; set; }
        //public double V { get; set; }
        //public double A { get; set; }
        //public double P { get; set; }
        //public double Energy_Consumption { get; set; }
        //public double Sum_Energy_Consumption { get; set; }
        public long CreateTime { get; set; }
        public DateTime ReportTime { get; set; }

        public string? RoomNumber { get; set; }
        public int CarbonVIP { get; set; }

        public List<DingShiReportDate>? AllDeviceData { get; set; }
        public int IdentityInfo { get; set; }
    }


    public class OtherServiceInfo_db
    {
        public ObjectId _id { get; set; }
        public string? HotelCode { get; set; }
        public string? HostNumber { get; set; }
        public string? Address { get; set; }
        public ushort StatusReceiver { get; set; }
        public DateTime LastUpdateTime { get; set; }
    }

    public class QueryDate
    {
        public string? HotelCode { get; set; }
        public string? HostNumber { get; set; }

        public string? Mac { get; set; }
        public string Start_Time { get; set; }
        public string End_Time { get; set; }
        public int PageSize { get; set; }
        public int PageIndex { get; set; }
    }
    public class TimerData
    {
        public int interval_Minutes { get; set; }
    }


    public class Root
    {
        public List<DataItem> data { get; set; }
    }
    public class DataItem
    {
        /// <summary>
        /// 
        /// </summary>
        public string ExtendedLocation { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string OriginQuery { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string appinfo { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int disp_type { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string fetchkey { get; set; }
        /// <summary>
        /// 本地局域网
        /// </summary>
        public string location { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string origip { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string origipquery { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string resourceid { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int role_id { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int shareImage { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int showLikeShare { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string showlamp { get; set; }
        /// <summary>
        /// IP地址查询
        /// </summary>
        public string titlecont { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string tplt { get; set; }
    }
}
