From 4f2dbd1f6a1ec2d9c3c39b4a37b0b7c9ddece4aa Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期四, 23 九月 2021 15:24:01 +0800 Subject: [PATCH] 主页刷新优化 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 102 +++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 74 insertions(+), 28 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 4ad531b..32868bd 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -482,7 +482,7 @@ /// <summary> /// 鑾峰彇浣忓畢鍒楄〃 /// </summary> - public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL) + public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL,string homeId = "") { var requestJson = HttpUtil.GetSignRequestJson(new GetHomeListObj() { homeType = homeType.ToString() }); var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson); @@ -497,28 +497,17 @@ { foreach (var home in homeList) { - //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) { UserInfo.Current.regionList.Add(home); + //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹� + if (!string.IsNullOrEmpty(homeId)) + { + if (homeId.Contains(home.id)) + { + DB_ResidenceData.Instance.CurrentRegion = home; + } + } } } if(UserInfo.Current.regionList.Count== 0) @@ -945,8 +934,9 @@ 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); + var jsonString = HttpUtil.GetSignRequestJson(d,d); + var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString); + return pack; } @@ -1051,7 +1041,7 @@ /// <summary> /// 鏌ヨ鎺ㄩ�佷俊鎭垪琛� /// </summary> - /// <param name="queryType">0鍏ㄩ儴 1鍒嗕韩涓庡姛鑳� 2鎶ヨ绫� 3绯荤粺淇℃伅</param> + /// <param name="queryType">0鍏ㄩ儴 1鍒嗕韩涓庡姛鑳� 2鎶ヨ绫� 3绯荤粺淇℃伅 4鐗╀笟閫氱煡</param> /// <returns></returns> public ResponsePackNew PushSerivceGetPushmessagelist(int queryType = 0) { @@ -1069,13 +1059,18 @@ { pushType = PushType.Prompt.ToString(); } - + else if (queryType == 4) + { + pushType = PushType.Property.ToString(); + } var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() { pushId = OnAppConfig.Instance.PushId, - pushType = pushType + pushType = pushType, + homeId = DB_ResidenceData.Instance.CurrentRegion.id, }); - return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson); + //2021-08-28 鏀逛负鍒嗛〉鏌ヨ + return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist_Paging, requestJson); } /// <summary> @@ -1968,7 +1963,7 @@ d.Add("actions", actionObjs); var requestJson = HttpUtil.GetSignRequestJson(d); - MainPage.Log($"{requestJson}"); + MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}"); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); } /// <summary> @@ -2384,6 +2379,7 @@ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("securitys", securityStates); var requestJson = HttpUtil.GetSignRequestJson(d); + MainPage.Log($"api瀹夐槻鎺у埗锛歿requestJson}"); var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson); return pack; } @@ -2478,10 +2474,13 @@ #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________ /// <summary> /// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙� + /// 2021-07-07 鏂版柟妗堟帴鍙h皟鏁村鎺� /// </summary> public ResponsePackNew EZGetChildToken() { Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("platform", "1"); var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); } @@ -2490,7 +2489,7 @@ #region 鈻� 鍙瀵硅_________________________ /// <summary> - /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃 + /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋� /// </summary> /// <returns></returns> public ResponsePackNew CheckFlVideo() @@ -2639,5 +2638,52 @@ } #endregion + + /// <summary> + /// 浜鸿劯褰曞叆 + /// </summary> + /// <param name="imageBytes"></param> + /// <returns></returns> + public ResponsePackNew FaceSetting(string imageBytes) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("userFace", @"data:image/jpg;base64,"+imageBytes); + d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); + + //MainPage.Log(imageBytes); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_InputUserFace, requestJson); + } + + + /// <summary> + /// 淇敼浣忔埛浜鸿劯鍏抽棴鐘舵�� + /// 1锛氬紑鍚姸鎬� 2锛氬叧闂姸鎬� + /// 3:娓呴櫎浜鸿劯鏁版嵁 + /// </summary> + public ResponsePackNew EditFaceFunction(int status) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("faceClose", status); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SwitchFaceFunction, requestJson); + } + + + /// <summary> + /// 鑾峰彇浣忔埛璇︽儏 + /// </summary> + /// <returns></returns> + public ResponsePackNew GetCustomerInfo() + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); + + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson); + } } } \ No newline at end of file -- Gitblit v1.8.0