From bd428f23e1eb103c19ebbf1f0165f9e2e7b0a9d0 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 09 五月 2023 09:11:18 +0800 Subject: [PATCH] Merge branch 'Dev-Wxr' into Dev-Branch --- HDL_ON/DAL/Server/HttpServerRequest.cs | 322 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 286 insertions(+), 36 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 4ba45b6..bb8c83c 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -544,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 { @@ -564,6 +571,10 @@ } if (UserInfo.Current.regionList.Count == 0) { + Shared.Application.RunOnMainThread(() => + { + MainPage.GoUserPage(false); + }); return "null"; } //-------濡傛灉璐﹀彿鏄娆$櫥褰� @@ -686,6 +697,20 @@ } } /// <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> public string GetGatewayInfo() @@ -726,7 +751,7 @@ { var requestObj = new ChildDeleteObj() { - childAccountId = subaccount.childAccountId, + childId = subaccount.id, homeId = subaccount.homeId }; var requestJson = HttpUtil.GetSignRequestJson(requestObj); @@ -741,12 +766,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 +785,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,11 +1001,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> /// 淇敼浣忓畢璋冭瘯鏉冮檺 @@ -1457,7 +1547,7 @@ MainPage.Log($"get weather error : {ex.Message}"); } } - System.Threading.Thread.Sleep(1000); + System.Threading.Thread.Sleep(5000); } Shared.Application.RunOnMainThread(() => { @@ -2078,7 +2168,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); @@ -2086,6 +2176,7 @@ d.Add("extDevId", extDevId); d.Add("name", deviceName); d.Add("code", pairCode); + d.Add("productBrandIdentity", productBrandIdentity); var requestJson = HttpUtil.GetSignRequestJson(d); @@ -2326,7 +2417,7 @@ #endregion -#region Kaede --鍦烘櫙鍔熻兘-------------------------- + #region Kaede --鍦烘櫙鍔熻兘-------------------------- /// <summary> /// 鑾峰彇鍦烘櫙鍒楄〃 /// 鎴块棿ID鍙┖锛岄粯璁ゆ煡璇綇瀹呬笅鎵�鏈夋埧闂� @@ -2458,9 +2549,9 @@ var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code; } -#endregion + #endregion -#region Kaede --鎴块棿鍔熻兘-------------------------- + #region Kaede --鎴块棿鍔熻兘-------------------------- /// <summary> /// 鑾峰彇鎴块棿鍒楄〃 /// </summary> @@ -2535,10 +2626,10 @@ return pack; } -#endregion + #endregion -#region Kaede -- 瀹夐槻鎺ュ彛____________________________ + #region Kaede -- 瀹夐槻鎺ュ彛____________________________ /// <summary> /// 鑾峰彇瀹夐槻鍒楄〃 /// </summary> @@ -2702,10 +2793,10 @@ return pack; } -#endregion + #endregion -#region Kaede --绗笁鏂瑰搧鐗屽姛鑳�-------------------------- + #region Kaede --绗笁鏂瑰搧鐗屽姛鑳�-------------------------- /// <summary> /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛� /// </summary> @@ -2735,13 +2826,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; } @@ -2817,9 +2906,9 @@ return pack; } -#endregion + #endregion -#region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________ + #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________ /// <summary> /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙� /// 2021-07-07 鏂版柟妗堟帴鍙h皟鏁村鎺� @@ -2832,10 +2921,10 @@ var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); } -#endregion + #endregion -#region 鈻� 鍙瀵硅_________________________ + #region 鈻� 鍙瀵硅_________________________ /// <summary> /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋� /// </summary> @@ -2867,9 +2956,25 @@ } -#endregion + /// <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); -#region 鈻� 闂ㄩ攣鐩稿叧____________________________ + var requestJson = HttpUtil.GetSignRequestJson(d); + var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson); + + return pack; + } + + #endregion + + #region 鈻� 闂ㄩ攣鐩稿叧____________________________ /// <summary> /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�) @@ -2939,7 +3044,8 @@ } #endregion -#region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________ + + #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________ /// <summary> /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃 /// </summary> @@ -3003,7 +3109,7 @@ var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson); } -#endregion + #endregion /// <summary> /// 缁戝畾source闈㈡澘 @@ -3066,12 +3172,7 @@ } - - - - - -#region 鍏変紡鍌ㄨ兘 + #region 鍏変紡鍌ㄨ兘 /// <summary> /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛� /// </summary> @@ -3096,7 +3197,156 @@ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson); return pack; } -#endregion + #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