From d53e6af2c5f17838fa79659614b15a2a1f383399 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 31 三月 2023 10:04:58 +0800 Subject: [PATCH] 1 --- Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs | 159 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 134 insertions(+), 25 deletions(-) diff --git a/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs b/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs index 27aef8f..30d6d74 100644 --- a/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs +++ b/Crabtree/SmartHome/HDL/Operation/ResponseEntity/Timer.cs @@ -1,19 +1,86 @@ 锘縰sing System; using Shared.SimpleControl; +using System.Collections.Generic; namespace Shared { [Serializable] public class Timer { - public string RequestVersion = MainPage.RequestVersion; + //public string RequestVersion = MainPage.RequestVersion; - public string RequestSource = MainPage.RequestSource; + //public string RequestSource = MainPage.RequestSource; + + public static List<Function> deviceList = new List<Function> (); /// <summary> /// 瀹氭椂鍣ㄧ殑鍞竴ID /// </summary> - public string Id { get; set; } + public string id { get; set; } + /// <summary> + /// 鐢ㄦ埛Id + /// </summary> + public string userId { get; set; } + /// <summary> + /// 瀹氭椂鍣ㄥ娉ㄥ悕 + /// </summary> + public string timerName { get; set; } + + /// <summary> + /// 浣忓畢ID + /// </summary> + public string gatewayId { get; set; } + /// <summary> + /// 缃戝叧ID + /// </summary> + public string homeId { get; set; } + + /// <summary> + /// 鎵ц鏃堕棿鐐� + /// </summary> + public string executeUtcTime { get; set; } + + /// <summary> + /// 閲嶅鍛ㄦ湡 + /// </summary> + public List<int> whichDay = new List<int> (); + + /// <summary> + /// 鏄惁鍚敤(榛樿寮�鍚�) + /// </summary> + public bool isEnable = true; + + /// <summary> + /// 瀹氭椂鍣ㄩ噸澶嶇被鍨� + /// </summary> + public TimerType timerType { get; set; } + + /// <summary> + /// 鎺у埗鐨勮澶囨暟鎹� + /// </summary> + public DeviceDate controlData = new DeviceDate (); + + /// <summary> + /// 鎴块棿鍚嶇О + /// </summary> + public string RoomName = "ALL"; + + /// <summary> + /// 鏃跺尯 + /// </summary> + public int TimeZone { get; set; } + } + + /// <summary> + /// 鏃ф湇鍔″櫒杩佺Щ杩囨潵鐨勫璞� + /// </summary> + [Serializable] + public class Timer_Old + { + /// <summary> + /// 瀹氭椂鍣ㄧ殑鍞竴ID + /// </summary> + public string Guid { get; set; } /// <summary> /// 瀹氭椂鍣ㄥ娉ㄥ悕 @@ -23,7 +90,7 @@ /// <summary> /// 缃戝叧ID /// </summary> - public string RegionID { get; set; } + public int RegionID { get; set; } /// <summary> /// 鎵ц鏃堕棿鐐� @@ -48,7 +115,7 @@ /// <summary> /// 鎺у埗鐨勮澶囨暟鎹� /// </summary> - public string ControlDeviceData =""; + public string ControlDeviceData = ""; /// <summary> /// 鎴块棿鍚嶇О @@ -65,15 +132,72 @@ public enum TimerType { EveryDay = 0, //姣忓ぉ - WorkingDay, //宸ヤ綔鏃� - Weekend, //鍛ㄦ湯 - Week, //鎸囧畾鏄熸湡鍑� + WorkingDay = 1, //宸ヤ綔鏃� + Weekend = 2, //鍛ㄦ湯 + Week = 3, //鎸囧畾鏄熸湡鍑� Period, //鎸囧畾鏃堕棿娈� AppointDay, //鎸囧畾鏃� - + } - #region 閫氳 + + [Serializable] + public class DeviceDate + { + + /// <summary> + /// 浣忓畢ID + /// </summary> + public string gatewayId { get; set; } + /// <summary> + /// 缃戝叧ID + /// </summary> + public string homeId { get; set; } + + public List<Fun> actions = new List<Fun> (); + } + [Serializable] + public class Fun + { + /// <summary> + /// 璁惧ID + /// </summary> + public long deviceId = 0; + /// <summary> + /// 浜戦泙瀹氫箟spk + /// </summary> + public string spk = string.Empty; + /// <summary> + /// spk锛堣澶囷級鐨勫睘鎬у垪琛� + /// </summary> + public List<Attributes> attributes = new List<Attributes> (); + public Bus bus = new Bus (); + } + [Serializable] + public class Attributes + { + + /// <summary> + /// "key":"on_off", + /// </summary> + public string key = "on_off"; + /// <summary> + /// "value":on/off + /// </summary> + public string value = string.Empty; + } + [Serializable] + public class Bus + { + public string addresses = string.Empty; + public string loopId = string.Empty; + } + + + + /// <summary> + /// 鏃у钩鍙板畾鏃跺櫒鐨勬帶鍒舵暟鎹� + /// </summary> public class DeviceInfo { public string DevicePath { get; set; } @@ -98,22 +222,7 @@ } public string Name; } - // AddTimer 娣诲姞瀹氭椂鍣� - //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType - //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity - // EditTimer 缂栬緫瀹氭椂鍣� - //褰撳畾鏃跺櫒閲嶅绫诲瀷涓烘瘡鏃ャ�佸伐浣滄棩銆佸懆鏈紝鍙~鍏匱imerType - //濡傛灉鏈寚瀹氭槦鏈熷嚑Week锛屽~鍏匬eriodicity - //GetOneTimerInfo 璇诲彇涓�涓畾鏃跺櫒淇℃伅 - //濉厖Id 瀛楁灏辫浜� - - //GetTimerList 璇诲彇瀹氭椂鍣ㄥ垪琛� 濉厖 GatewayId瀛楁 - - //IsEnableTimer 鍚敤鎴栫鐢ㄥ畾鏃跺櫒 濉厖Id 瀛楁灏辫浜� - - //DeleteTimer 鍒犻櫎瀹氭椂鍣� 濉厖Id 瀛楁灏辫浜� - #endregion } -- Gitblit v1.8.0