From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 06 六月 2023 11:51:12 +0800
Subject: [PATCH] Merge branch 'Dev-Branch'

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  451 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 415 insertions(+), 36 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 6d90181..8b4f77b 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -205,8 +205,6 @@
         }
 
         #region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-
-
         /// <summary>
         /// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
         /// </summary>
@@ -546,6 +544,13 @@
                 var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
                 if (homeList == null || homeList.Count == 0)
                 {
+                    if (DB_ResidenceData.Instance.CurrentRegion!=null && DB_ResidenceData.Instance.CurrentRegion.id != "")
+                    {
+                        Shared.Application.RunOnMainThread(() =>
+                        {
+                            MainPage.GoUserPage(false);
+                        });
+                    }
                 }
                 else
                 {
@@ -566,6 +571,10 @@
                     }
                     if (UserInfo.Current.regionList.Count == 0)
                     {
+                        Shared.Application.RunOnMainThread(() =>
+                        {
+                            MainPage.GoUserPage(false);
+                        });
                         return "null";
                     }
                     //-------濡傛灉璐﹀彿鏄娆$櫥褰�
@@ -688,6 +697,34 @@
             }
         }
         /// <summary>
+        /// 鑾峰彇浣忓畢浜や粯閾炬帴
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetHouseDeliveryUrl()
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var jsonString = HttpUtil.GetSignRequestJson(d);
+            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_GetHoserDeliverUrl, jsonString);
+            return revertObj;
+        }
+        /// <summary>
+        /// 浣忓畢浜や粯鍥炴粴
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew RollBack()
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("communityId", DB_ResidenceData.Instance.CurrentRegion.communityId);
+            d.Add("flowRecordContent", "onPro浜や粯鍥炴粴");
+            d.Add("projectFlowRecordActionEnum", "DELIVERY_ROLLBACK");
+            var jsonString = HttpUtil.GetSignRequestJson(d);
+            var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_UpdateProjectDebugStatus, jsonString);
+            return revertObj;
+        }
+
+        /// <summary>
         /// 鑾峰彇缃戝叧淇℃伅
         /// </summary>
         public string GetGatewayInfo()
@@ -728,7 +765,7 @@
         {
             var requestObj = new ChildDeleteObj()
             {
-                childAccountId = subaccount.childAccountId,
+                childId = subaccount.id,
                 homeId = subaccount.homeId
             };
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -743,12 +780,11 @@
         /// <returns></returns>
         public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId)
         {
-            var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
-            {
-                homeId = DB_ResidenceData.Instance.CurrentRegion.id,
-                childAccountId = childAccountId,
-                nickName = nickName,
-            });
+            var d = new Dictionary<string, string>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childAccountId);
+            d.Add("nickName", nickName);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
 
         }
@@ -763,7 +799,7 @@
             var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
             {
                 homeId = DB_ResidenceData.Instance.CurrentRegion.id,
-                childAccountId = childAccountId,
+                childId = childAccountId,
                 isAllowCreateScene = isAllow,
             });
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
@@ -979,11 +1015,77 @@
         public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
         {
             //娣诲姞瀛愯处鍙�
-            var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, 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);
-
         }
+        //v1.7鏇存柊鎺ュ彛
+        public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl)
+        {
+            //娣诲姞瀛愯处鍙�
+
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("nickName", nickName);
+            if (!string.IsNullOrEmpty(subAccount))
+            {
+                d.Add("account", subAccount);
+            }
+            if (!string.IsNullOrEmpty(faceUrl))
+            {
+                d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl);
+            }
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
+        }
+        /// <summary>
+        /// 鍒犻櫎鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+        /// </summary>
+        /// <param name="subAccount"></param>
+        /// <param name="nickName"></param>
+        /// <param name="faceUrl"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeleteMemberFace( string childId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson);
+        }
+        /// <summary>
+        /// 鏇存柊鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+        /// </summary>
+        public ResponsePackNew UpdataMemberFace(string childId, string faceUrl)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            d.Add("userFace", @"data:image/jpg;base64," + faceUrl);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson);
+        }
+        /// <summary>
+        /// 瀹跺涵鎴愬憳缁戝畾璐﹀彿
+        /// </summary>
+        /// <param name="childId"></param>
+        /// <param name="faceUrl"></param>
+        /// <returns></returns>
+        public ResponsePackNew SubChildBindAccount(string childId, string account)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("childId", childId);
+            d.Add("account", account);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_BindAccount, requestJson);
+        }
+        
 
         /// <summary>
         /// 淇敼浣忓畢璋冭瘯鏉冮檺
@@ -1356,23 +1458,62 @@
         {
             var requestObj = new AppVersionCheckObj()
             {
-
+                
             };
+            #if __IOS__
+            requestObj.releaseSystem = "IOS";
+            #else
+            requestObj.releaseSystem = "Android";
+            #endif
 
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson);
         }
-
-
-
         #endregion
 
-        #region 鑾峰彇澶╂皵閮ㄥ垎
+        #region 娉ㄩ攢璐﹀彿
+        /// <summary>
+        /// 鑾峰彇褰撳墠鐗堟湰娉ㄩ攢璐﹀彿妯″紡
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetUnregisterModel()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("version", MainPage.VersionString);
+            d.Add("appCode", "1588071238036582401");
+#if __IOS__
+            d.Add("releaseSystem", "IOS");
+#else
+            d.Add("releaseSystem", "Android");
+#endif
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetUnregisterModel, requestJson);
+        }
+        /// <summary>
+        /// 娉ㄩ攢璐﹀彿
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Unregister(string pwd)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("userId", UserInfo.Current.ID);
+            d.Add("pwd", pwd);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_Unregister, requestJson);
+        }
+#endregion
+
+#region 鑾峰彇澶╂皵閮ㄥ垎
         /// <summary>
         /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
         /// </summary>
         public void GetCityWeatherInfo(string lon, string lat)
         {
+            if (lon == "0" || lat == "0")
+                return;
+            MainPage.cityInfo.lon = lon;
+            MainPage.cityInfo.lat = lat;
+
             System.Threading.Tasks.Task.Run(() =>
             {
                 while (true)
@@ -1415,6 +1556,7 @@
                             MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString();
                             MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString();
                             MainPage.CityWeatherAction?.Invoke();
+                            HDL_ON.UI.HomePage.LoadEvent_RefreshAir();
                             break;
                         }
                         catch (Exception ex)
@@ -1422,16 +1564,8 @@
                             MainPage.Log($"get weather error : {ex.Message}");
                         }
                     }
-                    System.Threading.Thread.Sleep(1000);
+                    System.Threading.Thread.Sleep(5000);
                 }
-                Shared.Application.RunOnMainThread(() =>
-                {
-                    try
-                    {
-                        HDL_ON.UI.HomePage.LoadEvent_RefreshAir();
-                    }
-                    catch { }
-                });
             });
         }
         ///// <summary>
@@ -1967,6 +2101,18 @@
 
         #region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��
         /// <summary>
+        /// 鑾峰彇涔愭瀛愯处鍙穞oken
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetLcSubAccountToken()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetLcSubToken, requestJson);
+        }
+        /// <summary>
         /// 鑾峰彇璁惧鍒楄〃
         /// </summary>
         /// <returns></returns>
@@ -1998,8 +2144,10 @@
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("productPlatform", productPlatform);
             d.Add("productBrand", productBrand);
-            if (productBrand != "MegaHealth")
+            if (productBrand == "MegaHealth" || productBrand == "IMOU")
             {
+            }
+            else { 
                 d.Add("networkConfig", true);
             }
 
@@ -2029,7 +2177,7 @@
         /// <param name="productPlatform"></param>
         /// <param name="productBrand"></param>
         /// <returns></returns>
-        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName, string pairCode = "")
+        public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName,string productBrandIdentity, string pairCode = "")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -2037,12 +2185,28 @@
             d.Add("extDevId", extDevId);
             d.Add("name", deviceName);
             d.Add("code", pairCode);
+            d.Add("productBrandIdentity", productBrandIdentity);
 
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
         }
 
+        /// <summary>
+        /// 鍒犻櫎绗笁鏂硅澶�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Delete3tyDevice(string deviceId)
+        {
+
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Remove3tyDevcie, requestJson);
+            return responsePackNew;
+        }
 
 
 
@@ -2116,6 +2280,21 @@
             d.Add("name", function.name);
             d.Add("collect", function.collect);
             d.Add("roomIds", function.roomIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+        }
+        /// <summary>
+        /// 缂栬緫璁惧淇℃伅
+        /// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew UpdataDevcieName(Function function,string name)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", function.deviceId);
+            d.Add("name", name);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
@@ -2245,7 +2424,7 @@
         }
 
 
-        #endregion
+#endregion
 
         #region Kaede --鍦烘櫙鍔熻兘--------------------------
         /// <summary>
@@ -2656,13 +2835,11 @@
         /// <returns></returns>
         public ResponsePackNew Search3tyIotDevice(string companyId)
         {
-
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("companyId", companyId);
             var requestJson = HttpUtil.GetSignRequestJson(d);
 
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Search3tyIotDevice, requestJson);
-
             return pack;
         }
 
@@ -2788,6 +2965,22 @@
 
         }
 
+        /// <summary>
+        /// 鑾峰彇绗笁鏂规敞鍐岀殑id
+        /// </summary>
+        /// <param homeId="homeId">浣忓畢id</param>
+        /// <returns></returns>
+        public ResponsePackNew GetExtUserId(string homeId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", homeId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson);
+
+            return pack;
+        }
+
         #endregion
 
         #region 鈻� 闂ㄩ攣鐩稿叧____________________________
@@ -2858,8 +3051,50 @@
             //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code);
             return listSortLog;
         }
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetDoorTempPassword(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetTempPasswrod, requestJson);
+        }
+        /// <summary>
+        /// 鍒涘缓闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew CreateDoorTempPassword(string deviceId,string beginTime,string endTime)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("beginTime", beginTime);
+            d.Add("endTime", endTime);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CreateTempPasswrod, requestJson);
+        }
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew DelDoorTempPassword(string deviceId, string pwdId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("pwdId", pwdId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DelTempPasswrod, requestJson);
+        }
 
         #endregion
+
         #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
         /// <summary>
         /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
@@ -2987,11 +3222,6 @@
         }
 
 
-
-
-
-
-
         #region 鍏変紡鍌ㄨ兘
         /// <summary>
         /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
@@ -3019,5 +3249,154 @@
         }
         #endregion
 
+
+        #region 缇ゆ帶锛岀粍鍚堣皟鍏�
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶绫诲瀷
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlTypes(string spk)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("spk", spk);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetGroupControlList()
+        {
+            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_GetGroupControlListByHome, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var ids = new List<string>()
+            {
+                userDeviceGroupControlIds,
+            };
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(List<string> ids)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        public ResponsePackNew AddGroupControl(List<GroupControl> groupControls)
+        {
+            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("infos", groupControls);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        public ResponsePackNew DelGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 缂栬緫缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew EditGroupControl(List<GroupControl> groupControls)
+        {
+            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("infos", groupControls);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_UpdateGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 缇ゆ帶鎺у埗
+        /// </summary>
+        public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlId", userDeviceGroupControlId);
+            List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>();
+            dd.Add(pair);
+            d.Add("status",dd);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 鍙栨秷鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CancelCollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson);
+            return pack;
+        }
+
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0