From 86c5efb3d78c3fe294da95872b43bac1ce324c08 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 16 三月 2023 10:43:41 +0800
Subject: [PATCH] 修复功能信息修改直接返回两次回调问题

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  201 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 166 insertions(+), 35 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 2ac0547..7d4034e 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -726,7 +726,7 @@
         {
             var requestObj = new ChildDeleteObj()
             {
-                childAccountId = subaccount.childAccountId,
+                childId = subaccount.id,
                 homeId = subaccount.homeId
             };
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -741,12 +741,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);
 
         }
@@ -761,7 +760,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);
@@ -977,10 +976,60 @@
         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>
@@ -1354,23 +1403,60 @@
         {
             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)
         {
+            MainPage.cityInfo.lon = lon;
+            MainPage.cityInfo.lat = lat;
+
             System.Threading.Tasks.Task.Run(() =>
             {
                 while (true)
@@ -1965,6 +2051,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>
@@ -1996,8 +2094,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);
             }
 
@@ -2027,7 +2127,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);
@@ -2035,12 +2135,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;
+        }
 
 
 
@@ -2114,6 +2230,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);
@@ -2243,9 +2374,9 @@
         }
 
 
-        #endregion
+#endregion
 
-        #region Kaede --鍦烘櫙鍔熻兘--------------------------
+#region Kaede --鍦烘櫙鍔熻兘--------------------------
         /// <summary>
         /// 鑾峰彇鍦烘櫙鍒楄〃
         /// 鎴块棿ID鍙┖锛岄粯璁ゆ煡璇綇瀹呬笅鎵�鏈夋埧闂�
@@ -2377,9 +2508,9 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code;
         }
-        #endregion
+#endregion
 
-        #region Kaede --鎴块棿鍔熻兘--------------------------
+#region Kaede --鎴块棿鍔熻兘--------------------------
         /// <summary>
         /// 鑾峰彇鎴块棿鍒楄〃
         /// </summary>
@@ -2454,10 +2585,10 @@
             return pack;
         }
 
-        #endregion
+#endregion
 
 
-        #region Kaede -- 瀹夐槻鎺ュ彛____________________________
+#region Kaede -- 瀹夐槻鎺ュ彛____________________________
         /// <summary>
         /// 鑾峰彇瀹夐槻鍒楄〃
         /// </summary>
@@ -2621,10 +2752,10 @@
             return pack;
         }
 
-        #endregion
+#endregion
 
 
-        #region Kaede --绗笁鏂瑰搧鐗屽姛鑳�--------------------------
+#region Kaede --绗笁鏂瑰搧鐗屽姛鑳�--------------------------
         /// <summary>
         /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛�
         /// </summary>
@@ -2736,9 +2867,9 @@
             return pack;
         }
 
-        #endregion
+#endregion
 
-        #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
+#region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
         /// <summary>
         /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
         /// 2021-07-07 鏂版柟妗堟帴鍙h皟鏁村鎺�
@@ -2751,10 +2882,10 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
         }
-        #endregion
+#endregion
 
 
-        #region 鈻� 鍙瀵硅_________________________
+#region 鈻� 鍙瀵硅_________________________
         /// <summary>
         /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋�
         /// </summary>
@@ -2786,9 +2917,9 @@
 
         }
 
-        #endregion
+#endregion
 
-        #region 鈻� 闂ㄩ攣鐩稿叧____________________________
+#region 鈻� 闂ㄩ攣鐩稿叧____________________________
 
         /// <summary>
         /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�)
@@ -2857,8 +2988,8 @@
             return listSortLog;
         }
 
-        #endregion
-        #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
+#endregion
+#region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
         /// <summary>
         /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
         /// </summary>
@@ -2922,7 +3053,7 @@
             var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
         }
-        #endregion
+#endregion
 
         /// <summary>
         /// 缁戝畾source闈㈡澘
@@ -2990,7 +3121,7 @@
 
 
 
-        #region 鍏変紡鍌ㄨ兘
+#region 鍏変紡鍌ㄨ兘
         /// <summary>
         /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
         /// </summary>
@@ -3015,7 +3146,7 @@
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson);
             return pack;
         }
-        #endregion
+#endregion
 
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0