From 9acd3887f1f8db40d59f991b1726a61aa7c7637c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 五月 2021 15:13:56 +0800
Subject: [PATCH] Merge branch 'CJL' into wxr4

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  688 ++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 531 insertions(+), 157 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 66f61fc..408f9cf 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -37,34 +37,48 @@
         {
         }
 
+        #region kaede ___________浼犳劅鍣ㄥ巻鍙叉暟鎹甠_________________
         /// <summary>
         /// 鑾峰彇浼犳劅鍣ㄥ巻鍙叉暟鎹�
         /// </summary>
-        /// <param name="subnetId"></param>
-        /// <param name="deviceId"></param>
-        /// <param name="bigClass"></param>
-        /// <param name="minClass"></param>
-        /// <param name="queryType"></param>
-        /// <param name="loopId"></param>
-        /// <param name="nowMonth"></param>
-        /// <param name="mac"></param>
+        /// <param name="qType">鏃堕棿鏌ヨ绫诲瀷锛歨our=杩�24灏忔椂銆亀eek=杩戜竴鍛ㄣ�乵onth = 杩戜竴鏈� </param>
+        /// <param name="deviceId">璁惧ID</param>
+        /// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param>
         /// <returns></returns>
-        public ResponsePack GetSensorHistory(int subnetId, int deviceId, int bigClass, int minClass, int queryType, int loopId, int nowMonth, string mac)
+        public ResponsePackNew GetSensorHistory(string qType, string deviceId,string deviceKey)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("SubnetID", subnetId);
-            d.Add("DeviceID", deviceId);
-            d.Add("LargeType", bigClass);
-            d.Add("SmallType", minClass);
-            d.Add("QueryType", queryType);
-            d.Add("loopId", loopId);
-            d.Add("NowMonth", nowMonth);
-            d.Add("MAC", DB_ResidenceData.Instance.residenceGatewayMAC);
-            d.Add("LocalTimeZone", 8);
-            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
-            return RequestHttps("https://developer.hdlcontrol.com/api/GetSensorPushHistory", jsonString, true);
+            d.Add("type", qType);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId",  deviceId );
+            d.Add("key",  "value" );
 
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
         }
+        /// <summary>
+        /// 鑾峰彇瀹夐槻浼犳劅鍣ㄥ巻鍙叉暟鎹�
+        /// </summary>
+        /// <param name="deviceId">璁惧ID</param>
+        /// <param name="pageSize">椤甸潰澶у皬</param>
+        /// <param name="pageNo">椤靛彿</param>
+        /// <returns></returns>
+        public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
+        }
+
+
+
+
+        #endregion
 
         //public string GetRequestResultMsg(string resultCode)
         //{
@@ -106,7 +120,7 @@
         /// 鍒锋柊Token
         /// </summary>
         /// <returns></returns>
-        public bool RefreshToken()
+        public string RefreshToken()
         {
             var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj()
             {
@@ -120,9 +134,8 @@
                 UserInfo.Current.RefreshToken = revertData.refreshToken;
                 UserInfo.Current.LastTime = DateTime.Now;
                 UserInfo.Current.SaveUserInfo();
-                return true;
             }
-            return false;
+            return revertObj.Code;
         }
 
         #endregion
@@ -135,6 +148,11 @@
         {
             try
             {
+                if (strUrl.Contains("app/home/deliver") == false)
+                {
+                    //闈炴硶鐨刄RL 杩斿洖涓�涓嚜瀹氫箟鐨勭姸鎬佺爜
+                    return new ResponsePackNew() { Code = "-100" };
+                }
                 var client = new RestSharp.RestClient(strUrl);
 
                 var request = new RestSharp.RestRequest(RestSharp.Method.GET);
@@ -159,7 +177,7 @@
         }
 
         #region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-       
+
 
         /// <summary>
         /// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
@@ -305,7 +323,7 @@
         /// 鑾峰彇鐢ㄦ埛淇℃伅
         /// </summary>
         /// <returns></returns>
-        public void GetUserInfo(bool bGetHeadImage = true)
+        public string GetUserInfo(bool bGetHeadImage = true)
         {
             var requestJson = HttpUtil.GetSignRequestJson(new NullObj());
             var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_GetMemberInfo, requestJson);
@@ -339,57 +357,7 @@
                 UserInfo.Current.SaveUserInfo();
                 MainPage.Log("鑾峰彇鐢ㄦ埛淇℃伅鎴愬姛銆�");
             }
-
-
-            //    Dictionary<string, object> d = new Dictionary<string, object>();
-            //var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(d);
-            //var revertObj = RequestHttps($"{severAddress}/ZigbeeUsers/GetAccountInfo", requestJson, true);
-
-            //if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS)
-            //{
-            //    var dataStr = JObject.FromObject(revertObj.ResponseData);
-            //    //"DistributedMark": "96439601-fd26-4768-8440-1d9dfa32c109",  < !--甯愬彿Id-- >
-            //     UserInfo.Current.userEmailInfo = dataStr.GetValue("Email").ToString();
-            //     UserInfo.Current.userMobileInfo = dataStr.GetValue("Phone").ToString();
-            //    FileStream fs = null;
-            //    try
-            //    {
-            //        var headImageString = dataStr.GetValue("HeadImage").ToString();
-            //        if (!string.IsNullOrEmpty(headImageString))
-            //        {
-            //            var jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(headImageString);
-            //            var headImageBytes = Newtonsoft.Json.JsonConvert.DeserializeObject<byte[]>(jsonString);
-            //             UserInfo.Current.headImagePageBytes = headImageBytes;
-            //            var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/", "headImage.png");
-            //            fs = new FileStream(filePath, FileMode.Create, FileAccess.Write);
-            //            fs.Write(headImageBytes, 0, headImageBytes.Length);
-            //            fs.Flush();
-            //             UserInfo.Current.headImagePagePath = filePath;
-            //        }
-            //    }
-            //    catch (Exception ex)
-            //    {
-            //        MainPage.Log($"download headImage error : {ex.Message}");
-            //    }
-            //    finally
-            //    {
-            //        if (fs != null)
-            //        {
-            //            fs.Close();
-            //        }
-            //    }
-            //    // "GesturePwd": null,  < !--鎵嬪娍瀵嗙爜-- >
-            //    // "StringPwd": null , < !--瀛楃涓插瘑鐮�-- >
-            //     UserInfo.Current.userName = dataStr.GetValue("UserName").ToString();
-
-            //    Application.RunOnMainThread(() =>
-            //    {
-            //    });
-
-            //     UserInfo.Current.SaveUserInfo();
-            //    MainPage.Log("鑾峰彇鐢ㄦ埛淇℃伅鎴愬姛銆�");
-            //}
-
+            return resultObj.Code;
         }
 
         /// <summary>
@@ -497,35 +465,44 @@
             if (resultObj.Code == StateCode.SUCCESS)
             {
                 UserInfo.Current.regionList = new List<RegionInfoRes>();
-                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
+                var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
                 if (homeList == null || homeList.Count == 0)
                 {
                 }
                 else
                 {
-                    foreach (var mHome in homeList)
+                    foreach (var home in homeList)
                     {
-                        var home = new RegionInfoRes()
+                        //var home = new RegionInfoRes()
+                        //{
+                        //    RegionID = mHome.Id,
+                        //    Name = mHome.homeName,
+                        //    IsOthreShare = mHome.IsOtherShare,
+                        //    accountType = mHome.accountType,
+                        //    isRemoteControl = mHome.isRemoteControl,
+                        //    isBindGateway = mHome.isBindGateway,
+                        //    longitude = mHome.longitude,
+                        //    latitude = mHome.latitude,
+                        //    deliverstatus = mHome.deliverstatus,
+                        //    homeType = mHome.homeType,
+                        //    regionUrl = mHome.regionUrl,
+                        //    emqUrl = mHome.emqUrl,
+                        //    homeRegionName = mHome.homeRegionName,
+                        //    homeRegionId = mHome.homeRegionId,
+                        //    Address = mHome.homeAddress,
+                        //    isAllowCreateScene = mHome.isAllowCreateScene,
+                        //};
+                        if (home.isBindGateway)
                         {
-                            RegionID = mHome.Id,
-                            Name = mHome.homeName,
-                            IsOthreShare = mHome.IsOtherShare,
-                            accountType = mHome.accountType,
-                            isRemoteControl = mHome.isRemoteControl,
-                            longitude = mHome.longitude,
-                            latitude = mHome.latitude,
-                            deliverstatus = mHome.deliverstatus,
-                            homeType = mHome.homeType,
-                            regionUrl = mHome.regionUrl,
-                            emqUrl = mHome.emqUrl,
-                            homeRegionName = mHome.homeRegionName,
-                            homeRegionId = mHome.homeRegionId,
-                            Address = mHome.homeAddress,
-                        };
-                        UserInfo.Current.regionList.Add(home);
+                            UserInfo.Current.regionList.Add(home);
+                        }
+                    }
+                    if(UserInfo.Current.regionList.Count== 0)
+                    {
+                        return "null";
                     }
                     //-------濡傛灉璐﹀彿鏄娆$櫥褰�
-                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
+                    if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id))
                     {
                         //鍒锋柊褰撳墠浣忓畢
                         DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0];
@@ -537,7 +514,7 @@
                     else
                     {
                         //浣忓畢琚垹闄�
-                        var findHome = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID);
+                        var findHome = UserInfo.Current.regionList.Find((obj) => obj.id == DB_ResidenceData.Instance.CurrentRegion.id);
                         if (findHome == null)
                         {
                             Shared.Application.RunOnMainThread(() =>
@@ -548,7 +525,7 @@
                                 UserInfo.Current.SaveUserInfo();
                                 Action action = () =>
                                 {
-                                    MainPage.GoUserPage();
+                                    MainPage.GoUserPage(true);
                                 };
                                 new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
                             });
@@ -579,7 +556,7 @@
         {
             var requestObj = new AddOrUpdateHomeObj()
             {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
             };
 
             if (editId == 0)
@@ -588,7 +565,7 @@
             }
             else if (editId == 1)
             {
-                requestObj.Address = editName;
+                requestObj.homeAddress = editName;
             }
 
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -598,35 +575,27 @@
         /// <summary>
         /// 鑾峰彇鍒锋柊褰撳墠浣忓畢鐨勭綉鍏冲垪琛�
         /// </summary>
-        public void GetHomeGatewayList()
+        public string GetHomeGatewayList()
         {
             try
             {
-                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
-                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
+                if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id)) return "";
+                var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.id;
                 var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
                 var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
                 if (revertObj.Code == StateCode.SUCCESS)
                 {
                     var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString());
-                    if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.RegionID)
+                    if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.id)
                     {
                         if (mHomeGatewayRes != null)
                         {
                             if (mHomeGatewayRes.Count > 0)
                             {
                                 DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
-                                if(mHomeGatewayRes[0].gatewayStatus == "ON_LINE")
-                                {
-                                    //DriverLayer.Control.Ins.IsRemote = true;
-                                    DriverLayer.Control.Ins.GatewayOnline = true;
-                                }
-                                else
-                                {
-                                    DriverLayer.Control.Ins.GatewayOnline = false;
-                                }
+                                DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
                                 DB_ResidenceData.Instance.SaveResidenceData();
-                                return;
+                                return revertObj.Code;
                             }
                         }
                         //鍏朵綑鎯呭喌娓呯┖缃戝叧淇℃伅
@@ -638,11 +607,34 @@
                 {
                     //鎻愮ず閿欒
                 }
+                return revertObj.Code;
             }
             catch
             {
-
+                return "";
             }
+        }
+        /// <summary>
+        /// 鑾峰彇缃戝叧淇℃伅
+        /// </summary>
+        public string GetGatewayInfo()
+        {
+            if (DB_ResidenceData.Instance.HomeGateway == null)
+                return StateCode.NETWORK_ERROR;
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            var jsonString = HttpUtil.GetSignRequestJson(d);
+            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGatewayInfo, jsonString);
+            if (revertObj.Code == StateCode.SUCCESS)
+            {
+                var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
+                if (mHomeGatewayRes != null)
+                {
+                    DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
+                }
+            }
+            return revertObj.Code;
         }
 
         /// <summary>
@@ -651,7 +643,7 @@
         /// <returns></returns>
         public ResponsePackNew GetResidenceMemberAccount()
         {
-            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID });
+            var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id });
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson);
         }
 
@@ -680,7 +672,7 @@
         {
             var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
             {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                 childAccountId = childAccountId,
                 nickName = nickName,
             });
@@ -697,7 +689,7 @@
         {
             var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
             {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                 childAccountId = childAccountId,
                 isAllowCreateScene = isAllow,
             });
@@ -738,12 +730,13 @@
         {
             var requestJson = HttpUtil.GetSignRequestJson(new GetShareObj()
             {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
                 childAccountId = childAccountId,
             });
 
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_GetList, requestJson);
         }
+       
         #endregion
 
         ///// <summary>
@@ -877,26 +870,27 @@
         public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
         {
             //娣诲姞瀛愯处鍙�
-            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, account = subAccount, nickName = nickName };
+            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, account = subAccount, nickName = nickName };
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
 
         }
 
-        ///// <summary>
-        ///// 鑾峰彇浣忓畢涓嬬殑鎴愬憳璐﹀彿淇℃伅
-        ///// </summary>
-        ///// <returns></returns>
-        //public ResponsePack GetResidenceMemberAccountInfo(string account)
-        //{
-        //    Dictionary<string, object> d = new Dictionary<string, object>();
-        //    d.Add("Account", account);
-        //    string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
-        //    return RequestHttps($"{severAddress}/ZigbeeUsers/GetSubAccountInfo", jsonString, true);
-        //}
+        /// <summary>
+        /// 淇敼浣忓畢璋冭瘯鏉冮檺
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew ChangeResidenceDebugPerm(bool debugPerm)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("debugPerm", debugPerm);
+            string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+        }
 
-       
-        
+
+
 
         #endregion
         /// <summary>
@@ -936,6 +930,9 @@
         {
             try
             {
+                //鍏堟竻绌烘帹閫両D锛岄伩鍏嶄娇鐢ㄧ紦瀛樼殑PushId涓哄叾瀹冭处鍙风殑鎯呭喌锛屽鑷存煡璇㈠埌鍏跺畠璐﹀彿鐨勬帹閫佽褰�
+                OnAppConfig.Instance.PushId = "";
+
                 string deviceType = PhoneDeviceType.Android.ToString();
 #if __IOS__
                 deviceType = PhoneDeviceType.IOS.ToString();
@@ -1786,7 +1783,7 @@
         public ResponsePackNew GetDeviceList()
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             //d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);
             //d.Add("roomId", DB_ResidenceData.residenceData.residecenInfo.RegionID);//鍙帶鍙傛暟锛屽綋闇�瑕佸垎椤佃幏鍙栵紝鎬庝箞鐭ラ亾鍒嗛〉鎬绘暟
             //d.Add("searchType", DB_ResidenceData.residenceData.residecenInfo.RegionID);
@@ -1797,13 +1794,63 @@
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
         }
         /// <summary>
+        /// 鑾峰彇鎸囧畾绗笁鏂瑰搧鐗岀殑缁戝畾杩囩殑璁惧鍒楄〃
+        /// </summary>
+        /// <param name="productPlatform"></param>
+        /// <param name="productBrand"></param>
+        /// <returns></returns>
+        public ResponsePackNew Get3TyBrandBindDeviceList(string productPlatform, string productBrand)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("productPlatform", productPlatform);
+            d.Add("productBrand", productBrand);
+            d.Add("networkConfig", true);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
+        }
+        /// <summary>
+        /// 鑾峰彇鎸囧畾绗笁鏂瑰搧鐗岀殑璁惧鍒楄〃
+        /// </summary>
+        /// <param name="productPlatform"></param>
+        /// <param name="productBrand"></param>
+        /// <returns></returns>
+        public ResponsePackNew Get3TyBrandDeviceList(string productPlatform,string productBrand)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("categoryType", 1);
+            d.Add("productPlatform", productPlatform);
+            d.Add("productBrand", productBrand);
+            d.Add("networkConfig", true);
+            
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyBrandDevcieList, requestJson);
+        }
+
+        /// <summary>
+        /// 鑾峰彇璁惧璇︽儏
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetDeviceInfo(string functionId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceIds", new List<string>() { functionId });
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieInfoList, requestJson);
+        }
+
+        /// <summary>
         /// 鑾峰彇璁惧璇︽儏鍒楄〃
         /// </summary>
         /// <returns></returns>
         public ResponsePackNew GetDeviceInfoList(List<string> functionIds)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds", functionIds);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1816,10 +1863,11 @@
         public ResponsePackNew RefreshDeviceStatus(List<string> functionIds)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds", functionIds);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
+            MainPage.Log($"璇诲彇璁惧鐘舵�侊細{requestJson}");
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_RefreshDeviceStatus, requestJson);
         }
 
@@ -1830,11 +1878,12 @@
         public ResponsePackNew ControlDevice(List<ApiAlinkControlActionObj> actionObjs)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
-            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway == null ? "0" : DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
             d.Add("actions", actionObjs);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
+            MainPage.Log($"{requestJson}");
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
         }
         /// <summary>
@@ -1845,8 +1894,8 @@
         public ResponsePackNew UpdataDevcieInfo(Function function)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
-            d.Add("deviceId", function.deviceId);//DriverLayer.Control.Ins.GatewayId);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", function.deviceId);
             d.Add("name", function.name);
             d.Add("collect", function.collect);
             d.Add("roomIds", function.roomIds);
@@ -1855,12 +1904,28 @@
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
         }
         /// <summary>
+        /// 鏇存柊璁惧缁戝畾鎴块棿淇℃伅
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", function.deviceId);
+            d.Add("roomIds", function.roomIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+        }
+
+
+        /// <summary>
         /// 璁惧缁戝畾鎴块棿
         /// </summary>
         public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds", deviceIds);
             d.Add("roomIds", roomIds);
 
@@ -1873,7 +1938,7 @@
         public string UnbindDeviceToRoom(string deviceId, string roomId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds", new List<string>() { deviceId });
             d.Add("roomIds", new List<string>() { roomId });
 
@@ -1886,7 +1951,7 @@
         public string EditDeviceName(string deviceId, string deviceName)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", deviceId);
             d.Add("name", deviceName);
 
@@ -1899,7 +1964,7 @@
         public ResponsePackNew CollectDevice(string deviceId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds",new List<string>() { deviceId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1911,7 +1976,7 @@
         public ResponsePackNew CancelCollectDevice(string deviceId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceIds", new List<string>() { deviceId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1930,7 +1995,7 @@
         public ResponsePackNew GetSceneList(string roomId = null)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             if (roomId != null)
             {
                 d.Add("roomId", roomId);
@@ -1952,6 +2017,21 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
         }
+
+        /// <summary>
+        /// 鑾峰彇鍦烘櫙璇︽儏鍒楄〃
+        /// </summary>
+        /// <param name="seceneId">鍦烘櫙ID</param>
+        /// <returns></returns>
+        public ResponsePackNew GetSceneListInfo(List<string> seceneIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("userSceneIds", seceneIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
+        }
+
         /// <summary>
         /// 娣诲姞鍦烘櫙
         /// </summary>
@@ -1959,11 +2039,15 @@
         public ResponsePackNew AddScene(Scene scene)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("scenes", new List<Scene>() { scene });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
-            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddSecne, requestJson);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddSecne, requestJson);
+
+            MainPage.Log($"{pack.Data}");
+
+            return pack;
         }
         /// <summary>
         /// 缂栬緫鍦烘櫙
@@ -1973,7 +2057,7 @@
         public ResponsePackNew EditScene(Scene scene)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("scenes", new List<Scene>() { scene });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1986,7 +2070,7 @@
         public string DeleteScene(string userSceneId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("userSceneIds", new List<string>() { userSceneId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1999,7 +2083,7 @@
         public string ExecuteScene(string userSceneId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("userSceneIds", new List<string>() { userSceneId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2013,7 +2097,7 @@
         public string CollectScene(string userSceneId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("userSceneIds", new List<string>() { userSceneId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2027,7 +2111,7 @@
         public string CancelCollectScene(string userSceneId)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("userSceneIds", new List<string>() { userSceneId });
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2044,11 +2128,12 @@
         public ResponsePackNew GetRoomList(string GetType = "All")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             if (GetType != "All")
             {
                 d.Add("roomType", GetType);
             }
+            d.Add("pageSize", "1000");
             var requestJson = HttpUtil.GetSignRequestJson(d);
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetRoomList, requestJson);
             
@@ -2062,7 +2147,7 @@
         public ResponsePackNew AddRoom(List<SpatialInfo> rooms)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("rooms", rooms);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2081,7 +2166,7 @@
         public ResponsePackNew UpdateRoom(List<SpatialInfo> rooms)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("rooms", rooms);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2101,7 +2186,7 @@
         public ResponsePackNew DeleteRoom(List<string> roomIds)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
-            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("ids", roomIds);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2110,5 +2195,294 @@
         }
 
         #endregion
+
+
+        #region Kaede -- 瀹夐槻鎺ュ彛____________________________
+        /// <summary>
+        /// 鑾峰彇瀹夐槻鍒楄〃
+        /// </summary>
+        public ResponsePackNew GetSecurityList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_List, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇瀹夐槻璇︽儏
+        /// </summary>
+        /// <param name="sidList">瀹夐槻sid闆嗗悎</param>
+        /// <param name="userSecurityIds">瀹夐槻浜戠id</param>
+        /// <returns></returns>
+        public ResponsePackNew GetSecurityInfo(List<string> sidList, List<string> userSecurityIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            //sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
+            d.Add("sids", sidList);
+            d.Add("userSecurityIds", userSecurityIds);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Info, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 娣诲姞瀹夐槻
+        /// </summary>
+        public ResponsePackNew AddSecurity(List<SecurityAlarm> securities)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            d.Add("securitys", securities);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Add, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 缂栬緫瀹夐槻
+        /// </summary>
+        public ResponsePackNew EditSecurity(List<SecurityAlarm> securities)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            d.Add("securitys", securities);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Edit, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鍒犻櫎瀹夐槻
+        /// </summary>
+        /// <param name="sidList">瀹夐槻sid</param>
+        /// <param name="userSecurityIds">瀹夐槻浜戠id</param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteSecurity(List<string> sidList, List<string> userSecurityIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            //sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
+            d.Add("sids", sidList);
+            d.Add("userSecurityIds", userSecurityIds);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Delete, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 璇诲彇瀹夐槻闃插尯鐘舵��
+        /// </summary>
+        /// <param name="sidList">瀹夐槻sid</param>
+        /// <param name="userSecurityIds">瀹夐槻浜戠id</param>
+        /// <returns></returns>
+        public ResponsePackNew ReadSecurityStatus(List<string> sidList, List<string> userSecurityIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            //sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
+            d.Add("sids", sidList);
+            d.Add("userSecurityIds", userSecurityIds);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusRead, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 璁剧疆瀹夐槻闃插尯鐘舵��
+        /// </summary>
+        public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("securitys", securityStates);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 瀹夐槻bypass璁剧疆
+        /// </summary>
+        public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("securitys", securityBypassStates);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassSet, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 瀹夐槻bypass璇诲彇
+        /// </summary>
+        /// <param name="sidList">瀹夐槻sid</param>
+        /// <param name="userSecurityIds">瀹夐槻浜戠id</param>
+        /// <returns></returns>
+        public ResponsePackNew ReadSecurityBypass(List<string> sidList, List<string> userSecurityIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+            //sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
+            d.Add("sids", sidList);
+            d.Add("userSecurityIds", userSecurityIds);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassRead, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鏌ヨ瀹夐槻鎵�鏈夎褰�
+        /// </summary>
+        public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListSecurityLog, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鏌ヨ瀹夐槻鎶ヨ璁板綍
+        /// </summary>
+        public ResponsePackNew GetSecurityAlarmLogList(string pageSize, string pageNo)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListAlarmLog, requestJson);
+            return pack;
+        }
+
+        #endregion
+
+
+        #region Kaede --绗笁鏂瑰搧鐗屽姛鑳�--------------------------
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛�
+        /// </summary>
+        public ResponsePackNew Get3tyBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList, requestJson);
+
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缁戝畾鐨勭涓夋柟鍝佺墝鍒楄〃
+        /// </summary>
+        public ResponsePackNew Get3tyBindBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBindBrandList, requestJson);
+
+            return pack;
+        }
+
+        #endregion
+
+        #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
+        /// <summary>
+        /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
+        /// </summary>
+        public ResponsePackNew EZGetChildToken()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
+        }
+        #endregion
+
+
+        #region 鈻� 鍙瀵硅_________________________
+        /// <summary>
+        /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew CheckFlVideo()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson);
+            return pack;
+        }
+        #endregion
+
+        #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
+        /// <summary>
+        /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetSpeakerList()
+        {
+            var requestJson = HttpUtil.GetSignRequestJson(new GetSpeakerObj
+            {
+                homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+            });
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_List_Get, requestJson);
+        }
+
+        /// <summary>
+        /// 缂栬緫闊崇鎺堟潈澶囨敞
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdateSpeakerRemark(UpdateSpeakerRemarkObj remarkObj)
+        {
+            var requestJson = HttpUtil.GetSignRequestJson(remarkObj);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_Remark_Update, requestJson);
+        }
+
+        /// <summary>
+        /// 瑙i櫎闊崇缁戝畾
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UnbindSpeaker(string tokenId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("tokenId", tokenId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_Unbind, requestJson);
+        }
+
+        /// <summary>
+        /// 鑾峰彇闊崇鍒嗛厤鐨勮澶囧拰鍦烘櫙鍒楄〃
+        /// </summary>
+        /// <param name="getType">0 鏄煡璇㈠叏閮� 1鏄煡璇㈣澶� 2鏄煡璇㈠満鏅�</param>
+        /// <param name="tokenId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetSpeakerDeviceList(int getType, string tokenId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            d.Add("tokenId", tokenId);
+            if (getType > 0)
+            {
+                d.Add("isDevice", getType == 1);
+            }
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Get, requestJson);
+        }
+
+        /// <summary>
+        /// 鏇存柊闊崇鎺у埗鐨勮澶囧拰鍦烘櫙鐩爣
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdateSpeakerDeviceList(UpdateSpeakerDeviceListObj updateSpeakerDeviceListObj)
+        {
+            var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0