using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Models { public class ReturnData { public bool IsSuccess { get; set; } public T Result { get; set; } } public class HotelGroups { public int Id { get; set; } public string Name { get; set; } public int ParentId { get; set; } public string Desc { get; set; } public DateTime CreateTime { get; set; } = DateTime.Now; } public class HotelsAsync { /// /// /// public int ID { get; set; } /// /// /// public string Code { get; set; } /// /// 默认酒店 /// public string Name { get; set; } /// /// /// public string EName { get; set; } /// /// 默認酒店 /// public string TWName { get; set; } /// /// /// public string Contact { get; set; } /// /// /// public string Phone { get; set; } /// /// /// public string Address { get; set; } /// /// /// public string ValidateDate { get; set; } /// /// /// public DateTime CreatDate { get; set; } /// /// /// public string Remark { get; set; } /// /// /// public int Status { get; set; } /// /// /// public bool IsApprove { get; set; } /// /// /// public int SysHotelGroupID { get; set; } /// /// 宝来威 /// public string SysHotelGroupName { get; set; } } public class HotelDataItem { public string HotelGroupsName { get; set; } public int HotelGroupsId { get; set; } public List Hotels { get; set; } } public class AuthItem { public int AuthotypeId { get; set; } public int AuthorityId { get; set; } public string AuthorityName { get; set; } } public class HotelsItem { public List Auth { get; set; } public string HotelName { get; set; } public string Code { get; set; } public int HotelId { get; set; } } public class Userinfo { public string HeadImg { get; set; } public string Uid { get; set; } = string.Empty; } public class Datainfo { public Userinfo Userinfo { get; set; } public List HotelData { get; set; } public string Token { get; set; } } public class Root { public T Data { get; set; } public int Status { get; set; } public string Message { get; set; } } public class asyncroomtype { public int Code { get; set; } public string Name { get; set; } } # region 上面的是同步数据有关字段 未做解析 TCP 通讯类容 /// /// TCP 通讯类容 具体数据命令 请看同步目录文档 DOC-BLV-C1-V04a-20220321.docx 8.5TCP通讯格式 /// public class TCPDATA { /// /// 命令枚举 /// public enum RCU_CMD { /// /// 获取RUCS设备缓存 /// GET_RUCS_RCU_LIST,// 1 /// /// RUCS主动发送服务消息日志 /// RUCS_DEBUGLOG, // 2 RUCS_DEBUGLOG /// /// RUCS 控制下发 /// CONTROL_RCU_DEVISSUED,//3 /// /// RUCS 升级下发 /// RCU_UPGRADE_ISSUED, /// /// RUCS升级测试进度 /// RUCS_CONN_UPGRADE_PROGRESS, /// /// RUCS 升级测试结果 /// RUCS_CONN_UPGRADE_RESULTS } public class REATED_IDS { public string RELATED_MSG_ID { get; set; } public string RELATED_TCP_ID { get; set; } public string RELATED_UDP_ID { get; set; } } /// /// 每条TCP通讯生成时自动生成一个ID,有发送者+时间戳组成 /// public string TCP_ID { get; set; } /// /// 数据生成时间 /// public DateTime DATETIME { get; set; } = DateTime.Now; /// /// //跟本条数据生成有关的信息ID,如果没有关联ID则选择空白 /// public REATED_IDS REATED_IDs { get; set; } /// /// 是否记录到日志,,如无本参数则默认写入日志 /// public bool LOG_TO_DB { get; set; } /// /// //命令 /// public string CMD { get => cmd.ToString().ToUpper(); set { try { cmd = (RCU_CMD)Enum.Parse(typeof(RCU_CMD), value.ToUpper()); } catch (Exception ex) { throw new Exception("数据不规范" + ex.Message); } } } RCU_CMD cmd { get; set; } /// /// 消 息参数,根据命令不同,消息参数格式和内容也不同 /// public PARAs_Class PARAM { get; set; } /// /// 事件跟踪信息 /// public TrackingInfo TRACKING_INFO { get; set; } /// /// 事件跟踪类 /// public class TrackingInfo { /// /// 事务ID TransactionID /// public string TRANSACTION_ID { get; set; } /// /// 追踪类型 TrackingType /// public string TRACKING_TYPE { get; set; } } /// /// 消息体类 /// public class PARAs_Class { /// /// 发起方 /// public string Initiator { get; set; } = "WEB"; /// /// 数据类型 /// public string Data_Type { get; set; } /// /// 下发 测试类型 /// public int Issued_Test_Type { get; set; } /// /// 下发命令 /// public string Issued_CMD { get; set; } /// /// 下发测试消息; /// public string Issued_Test_Message { get; set; } /// /// 下发测试结果; /// public int Issued_Test_Result { get; set; } /// /// 总包数 /// public int The_Total_Packages { get; set; } /// /// 当前包 /// public int The_Current_Package { get; set; } /// /// 设备个数 返回和请求度需要用到 返回 不限制 /// public int QUANTITY { get; set; } /// /// 返回ruc信息集合 /// public RUCS_RCU[] RCU_INFO { get; set; } /// /// 返回ruc信息类 /// public class RUCS_RCU { public string IDX { get; set; } public string MAC { get; set; } public string UUID { get; set; } public string PUBLIC_IP { get; set; } public string LOCAL_IP { get; set; } public int RCU_UDP_PORT { get; set; } public int RUCS_UDP_PORT { get; set; } public DateTime LAST_UPDATE { get; set; } public string LAST_UDP_SN { get; set; } public string IS_ONLINE { get; set; } } /// /// 在线状态筛选 0 全部 不赛选 1 只返回在线 2 只返回不在线 /// public int ONLINE_STATUS { get; set; } /// /// 升级文件类型 文件类型; 1: app固件; 2: 配置; /// public int Upgrade_File_Type { get; set; } = 1; /// /// 是否立即复位 是否立即复位; 1: 立即复位; 2: 手动复位; /// public int Upgrade_Is_Reset { get; set; } = 1; /// /// Upgrade_TimeOut_ms:RCU升级超时时间; /// public int Upgrade_Time_Out_s { get; set; } = 10; /// /// 返回具有指定的mac 的ruc /// public List MAC_LIST { get; set; } /// /// 数据来源 /// //public string DataSource { get; set; } ///// ///// 数据分类 ///// //public string Data_Type { get; set; } /// /// 数据内容 /// public string Message { get; set; } /// /// 重发次数 /// public int Resend_Count { get; set; } = 5; /// /// 重发间隔 ms /// public int Resend_Time_Out_ms { get; set; } = 500; /// /// 通讯测试总包数 /// public int Conn_Test_Package_Count { get; set; } = 500; /// /// 通讯测试超时; /// public int Conn_Test_Time_Out_s { get; set; } = 500; /// /// 重发失败处理 暂定 false 不告诉我发送结果 TRUE 告知 /// public bool Resend_Fail_Handling { get; set; } /// /// 下发数据内容 /// public byte[] Issued_Data { get; set; } = new byte[0]; /// /// 下发的mac /// public string MAC { get; set; } } #endregion #region charts 绘图帮助返回类 暂未使用 /// /// charts 绘图帮助返回类 /// public class CHARTSHELP { /// /// 绘图 类型 "line" /// public string type { get; set; } = "line"; /// /// 表格名 /// public string Title { get; set; } = "line"; /// /// DATASETS 数据集 /// public class DATASETS { public string symbol { get; set; } = String.Empty; /// /// 数据名 /// public string label { get; set; } = String.Empty; /// /// 边框颜色 /// public string borderColor { get; set; } = String.Empty; /// /// 背景颜色 /// public string backgroundColor { get; set; } = String.Empty; /// /// 边框宽度 /// public int borderWidth { get; set; } = 1; /// /// 数据 /// public List data { get; set; } = new List { }; public class Data { public int x { get; set; } public int y { get; set; } } } public List ds { get; set; } = new List(); /// /// 共用的x轴 labels /// public List labels { get; set; } = new List(); } #endregion #region echarts 绘图帮助返回类 public class ECHARTS { // 图例颜色 public List color { get; set; } = new List(); public dynamic yAxis { get; set; } = new { }; public Title title { get; set; } = new Title(); /// /// 鼠标移上去显示数据 /// public dynamic tooltip { get; set; } = new { trigger = "axis" }; public XAXIS legend { get; set; } = new XAXIS(); public XAXISDATA xAxis { get; set; } = new XAXISDATA(); //public DataHelp yAxis { get; set; } = new DataHelp(); public List series { get; set; } = new List { }; public class DataHelp { /// /// 取消圆点 /// public string symbol { get; set; } = "none"; public string name { get; set; } public string type { get; set; } = "line"; public bool stillShowZeroSum { get; set; } = false; /// /// 相同 的 stack 会堆叠在一起 /// public string stack { get; set; } = null; /// /// 平滑 /// public bool smooth { get; set; } = true; public List data { get; set; } = new List(); public LINESTYLE lineStyle { get; set; } = new LINESTYLE(); public dynamic label => type == "pie" ? new { normal = new { show = true, formatter = "{b} - {c} - {d}% " } } : null; public class LINESTYLE { public NORMAL normal { get; set; } = new NORMAL(); public class NORMAL { public string color { get; set; } } } } } } public class Title { public string text { get; set; } } public class XAXISDATA { public List data { get; set; } = new List(); } public class XAXIS { public List data { get; set; } = new List(); public string icon { get; set; } = "rect"; public string type { get; set; } = "scroll"; public string orient { get; set; } = "horizontal";// "vertical"; public string top { get; set; } = "20"; public string right { get; set; } = "0"; public string left { get; set; } = "center"; } #endregion #region Mysql 修改datetime 为datetime(3) 显示毫秒 的帮助模型类 /// /// Mysql 修改datetime 为datetime(3) 显示毫秒 的帮助模型类 /// public class MysqlModel { public string tablename { get; set; } public string columnName { get; set; } public string dataType { get; set; } } #endregion #region public class Host_ { private DateTime registerDate = DateTime.Now; private string subnetMask = "255.0.0.0"; private string gateway = "192.168.1.1"; private string dns = "114.114.114.114"; private int port = 3341; private bool powerSupply = true; private int authorizedHours = -1; private int lockStatus = 2;//1锁开,2锁关 /// /// ID /// public virtual int ID { get; set; } /// /// 主机编号 /// public virtual string HostNumber { get; set; } /// /// 房间号 /// public virtual string RoomNumber { get; set; } /// /// IP /// public virtual string IP { get; set; } /// /// 局域网IP /// public virtual string LanIP { get; set; } /// /// 子网掩码 /// public virtual string SubnetMask { get { return this.subnetMask; } set { this.subnetMask = value; } } /// /// 网关 /// public virtual string Gateway { get { return this.gateway; } set { this.gateway = value; } } /// /// DNS /// public virtual string DNS { get { return this.dns; } set { this.dns = value; } } /// /// 端口 /// public virtual int Port { get { return this.port; } set { this.port = value; } } /// /// 局域网端口 /// public virtual int LanPort { get; set; } /// /// MAC /// public virtual string MAC { get; set; } /// /// 状态 0:离线 1:在线 /// public virtual bool Status { get; set; } /// /// 版本号 /// public virtual string Version { get; set; } /// /// 配置数据版本号 /// public virtual string ConfigVersion { get; set; } /// /// 备注 /// public virtual string Remark { get; set; } /// /// 注册日期 /// public virtual DateTime RegisterDate { get { return this.registerDate; } set { this.registerDate = value; } } /* /// /// 请求服务 /// public virtual bool RequestService { get; set; } /// /// 请求清理 /// public virtual bool RequestClear { get; set; } /// /// 请勿打扰 /// public virtual bool RequestDNDST { get; set; } /// /// 请求退房 /// public virtual bool RequestCheckOut { get; set; } /// /// 求救 /// public virtual bool SOS { get; set; }*/ /// /// 门锁 True/开,False/关 /// public virtual bool DoorLockStatus { get; set; } /// /// 房门状态更新时间 /// public virtual DateTime? DoorLockStatusUpdateTime { get; set; } /// /// 保险箱:0关,1开,2未接保险箱 /// public virtual int SafeStatus { get; set; } /* /// /// 当前温度 /// public virtual int CurrentTemp { get; set; } /// /// 设定温度 /// public virtual int SettingTemp { get; set; } /// /// 风速 /// public virtual int Speed { get; set; } /// /// 辅助房态 /// public virtual string RoomStatusAidIDs { get; set; } /// /// 是否连通房 /// public virtual bool IsConnectingRoom { get; set; } /// /// 连通房ID,逗号隔开 /// public virtual string ConnectingRooms { get; set; }*/ /// /// 主机温度 /// public virtual int HostTemp { get; set; } /// /// 客房电源 /// public virtual bool PowerSupply { get { return this.powerSupply; } set { this.powerSupply = value; } } /// /// 授权剩余小时 /// public virtual int AuthorizedHours { get { return this.authorizedHours; } set { this.authorizedHours = value; } } /// /// 锁状态:1开,2关 /// public virtual int LockStatus { get { return this.lockStatus; } set { this.lockStatus = value; } } /// /// 锁电压 /// public virtual float LockVoltage { get; set; } /// /// 阿里云对接产品key /// public virtual string ProductKey { get; set; } /// /// 阿里云对接设备名称 /// public virtual string DeviceName { get; set; } /// /// 阿里云对接设备密钥 /// public virtual string DeviceSecret { get; set; } /// /// 主机密钥 /// public virtual string HostSecret { get; set; } /// /// 阿里云物联网平台为该设备颁发的设备ID,作为该设备的唯一标识符。 /// public virtual string IotId { get; set; } /// /// 是否下发密钥给主机 /// public virtual bool IsPublish { get; set; } /// /// 若琪对接的webhook url,通知播放欢迎词使用 /// public virtual string RokidWebhookUrl { get; set; } /// /// 绑定小度音箱的序列号 /// public virtual string XiaoDuCUID { get; set; } /// /// TCL电视序列号 /// public virtual string TCLCUID { get; set; } /// /// 华为电视序列号 /// public virtual string HuaWeiCUID { get; set; } /// /// 是否同步房号(生产工具同步) /// public virtual bool IsSyncRoomNumber { get; set; } /// /// 是否自动升级 /// public virtual bool IsAutoUpdate { get; set; } /// /// MAC绑定时间 /// public virtual DateTime? MACBindDate { get; set; } /// /// IP类型:1自动,2手动 /// public virtual int IPType { get; set; } /// /// rcu到期时间 /// public virtual DateTime? ExpireTime { get; set; } /// /// rcu运行时间 /// public virtual DateTime? RunTime { get; set; } /// /// 设置rcu到期时间 /// public virtual DateTime? SetExpireTime { get; set; } /// /// 是否锁定 /// public virtual bool IsLock { get; set; } /// /// 季节 /// public virtual string Season { get; set; } /// /// 服务器IP /// public virtual string ServerIP { get; set; } /// /// 服务器端口 /// public virtual int ServerPort { get; set; } /// /// 最新更新日期 /// public virtual DateTime? Last_Modified_Time { get; set; } /// /// 房型 /// public virtual int RoomTypeID { get; set; } /// /// 酒店 /// public virtual int HOTELID { get; set; } /// /// 房态 /// public virtual int RoomStatusID { get; set; } #endregion } /// /// Rcu自己写入的日志文件数据 /// public class RcuData { /// /// 时间 /// public DateTime createdatetime { get; set; } /// /// 日志内容 /// public string log_content { get; set; } /// /// 日志时间 /// public string log_datetime { get; set; } /// /// 日志长度 /// public int log_len { get; set; } /// /// 日志sn /// public int log_sn { get; set; } /// /// 日志间隔 /// public int log_timespan { get; set; } /// /// 日志类型 /// public int log_type { get; set; } /// /// 是否有效 /// public bool log_valid { get; set; } /// /// log文件名 /// public string logfilename { get; set; } /// /// 项目id /// public int logprojectid { get; set; } /// /// 房间id /// public int logroomid { get; set; } /// /// mac /// public string mac { get; set; } /// /// 备注 /// public string remark { get; set; } /// /// 参数类型 /// public string type_param_1 { get; set; } /// /// 参数类型 /// public string type_param_2 { get; set; } /// /// 参数类型 /// public string type_param_3 { get; set; } /// /// 参数类型 /// public string type_param_4 { get; set; } /// /// 参数类型 /// public string type_param_5 { get; set; } /// /// 参数类型 /// public string type_param_6 { get; set; } /// /// 参数类型 /// public string type_param_7 { get; set; } /// /// 参数类型 /// public string type_param_8 { get; set; } /// /// 参数类型 /// public string type_param_9 { get; set; } /// /// 参数类型 /// public string type_param_10 { get; set; } } public class LOGFILENAME { public string logfilename { get; set; } public string sum { get; set; } } }