From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 01 十二月 2021 16:32:57 +0800 Subject: [PATCH] 2021-12-01-01 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 224 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 191 insertions(+), 33 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index c1a0d9e..8f2d089 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -727,6 +727,24 @@ return result != null && result.Code == StateCode.SUCCESS; } + /// <summary> + /// 绠$悊鍛樻潈闄愯縼绉� + /// </summary> + /// <param name="i_childAccountId">鎴愬憳璐﹀彿id</param> + /// <returns></returns> + public bool AdminAuthorityMigration(string i_childAccountId) + { + var pra2 = new + { + homeId = DB_ResidenceData.Instance.CurrentRegion.id, + childAccountId = i_childAccountId + }; + var requestJson = HttpUtil.GetSignRequestJson(pra2); + var result = HttpUtil.RequestHttpsPost(NewAPI.API_Post_AdminAuthorityMigration, requestJson); + + return result != null && result.Code == StateCode.SUCCESS; + } + #region 鏂版暟鎹垎浜� /// <summary> /// 娣诲姞鍒嗕韩 @@ -986,7 +1004,15 @@ deviceName = OnAppConfig.Instance.PhoneName, deviceType = deviceType, produce = isProduce, + }; + mAddpushinfoObj.languageType = Utlis.GetPostLanguageType(); + +#if DEBUG + //List<string> communityCodes = new List<string>(); + //communityCodes.Add(""); + //mAddpushinfoObj.communityCodes = communityCodes; +#endif //var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj); var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj); @@ -1023,7 +1049,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) { @@ -1041,13 +1067,18 @@ { pushType = PushType.Prompt.ToString(); } - + else if (queryType == 4) + { + pushType = PushType.Notice.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> @@ -1175,16 +1206,13 @@ /// </summary> /// <param name="msgId"></param> /// <returns></returns> - public bool PushSerivceDeleteMessage(string msgId) + public bool PushSerivceDeleteMessage(PushMsgIdObj mPushMsgIdObj) { if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; - + if (mPushMsgIdObj == null) return false; try { - var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj() - { - msgId = msgId - }); + var requestJson = HttpUtil.GetSignRequestJson(mPushMsgIdObj); var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Deletepushinfo, requestJson); if (revertObj.Code == StateCode.SUCCESS) @@ -1243,6 +1271,18 @@ { IsBackground = true }.Start(); } + /// <summary> + /// 鑾峰彇鐗╀笟鍏憡璇︽儏 + /// </summary> + /// <param name="noticeId"></param> + /// <returns></returns> + public ResponsePackNew GetPropertyNoticeDetails(string noticeId) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("noticeId", noticeId); + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_GetNoticeInfo, requestJson); + } #endregion #region 妫�娴嬫洿鏂� @@ -1263,13 +1303,13 @@ - #endregion +#endregion - #region 鑾峰彇澶╂皵閮ㄥ垎 +#region 鑾峰彇澶╂皵閮ㄥ垎 /// <summary> - /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅 + /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅 /// </summary> - public void GetCityInfo(string lon, string lat) + public void GetCityWeatherInfo(string lon, string lat) { System.Threading.Tasks.Task.Run(() => { @@ -1332,11 +1372,64 @@ }); }); } + ///// <summary> + ///// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅 + ///// </summary> + ///// <param name="lon"></param> + ///// <param name="lat"></param> + //public void GetCityInfo() + //{ + // if (DB_ResidenceData.Instance.CurrentRegion.longitude == 0 && DB_ResidenceData.Instance.CurrentRegion.latitude == 0) + // { + // return; + // } + // string lon = DB_ResidenceData.Instance.CurrentRegion.longitude.ToString(); + // string lat = DB_ResidenceData.Instance.CurrentRegion.latitude.ToString(); + // System.Threading.Tasks.Task.Run(() => + // { + // while (true) + // { + // var webClient = new WebClient(); + // string url = $"https://developer.hdlcontrol.com/Weather/Weather/FindCity/?lon={lon}&lat={lat}"; + // string responseString = null; + // try + // { + // responseString = Encoding.UTF8.GetString(webClient.DownloadData(url)); + // } + // catch (Exception ex) + // { + // MainPage.Log(ex.Message); + // } - #endregion + // if (responseString != null) + // { + // try + // { + // var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString); + // JObject jt = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(revertObj.ResponseData.ToString()); + + // DB_ResidenceData.cityInfo.location = jt.GetValue("Location").ToString(); + // DB_ResidenceData.cityInfo.province = jt.GetValue("Province").ToString(); + // DB_ResidenceData.cityInfo.country = jt.GetValue("Country").ToString(); + // DB_ResidenceData.cityInfo.timeZone = jt.GetValue("TimeZone").ToString(); + // DB_ResidenceData.Instance.SaveResidenceData(); + + // return; + // } + // catch (Exception ex) + // { + // MainPage.Log($"get weather error : {ex.Message}"); + // } + // } + // } + // }); + //} - #region 澶囦唤閮ㄥ垎 +#endregion + + +#region 澶囦唤閮ㄥ垎 ///// <summary> ///// 鑾峰彇浣忓畢澶囦唤鍒楄〃 ///// </summary> @@ -1382,11 +1475,11 @@ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(d); var revertObj = RequestHttps("https://developer.hdlcontrol.com/api/UserBackupList", requestJson, true); var jt = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JObject>>(revertObj.ResponseData.ToString()); - #region 鎭㈠鎴块棿鏁版嵁 +#region 鎭㈠鎴块棿鏁版嵁 GetBackupRoom(jt,loading); - #endregion +#endregion Application.RunOnMainThread(() => { loading.Hide(); @@ -1807,10 +1900,10 @@ } */ - #endregion +#endregion - #region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� +#region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�� /// <summary> /// 鑾峰彇璁惧鍒楄〃 /// </summary> @@ -1871,13 +1964,15 @@ /// <param name="productPlatform"></param> /// <param name="productBrand"></param> /// <returns></returns> - public ResponsePackNew IndependentRegister3TyDevcie(string spk,string extDevId,string deviceName) + public ResponsePackNew IndependentRegister3TyDevcie(string spk,string extDevId,string deviceName,string pairCode = "") { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); d.Add("spk", spk); d.Add("extDevId", extDevId); d.Add("name", deviceName); + d.Add("code", pairCode); + var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson); @@ -1940,7 +2035,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> @@ -2040,9 +2135,9 @@ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson); } - #endregion +#endregion - #region Kaede --鍦烘櫙鍔熻兘-------------------------- +#region Kaede --鍦烘櫙鍔熻兘-------------------------- /// <summary> /// 鑾峰彇鍦烘櫙鍒楄〃 /// 鎴块棿ID鍙┖锛岄粯璁ゆ煡璇綇瀹呬笅鎵�鏈夋埧闂� @@ -2174,9 +2269,9 @@ var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code; } - #endregion +#endregion - #region Kaede --鎴块棿鍔熻兘-------------------------- +#region Kaede --鎴块棿鍔熻兘-------------------------- /// <summary> /// 鑾峰彇鎴块棿鍒楄〃 /// </summary> @@ -2251,10 +2346,10 @@ return pack; } - #endregion +#endregion - #region Kaede -- 瀹夐槻鎺ュ彛____________________________ +#region Kaede -- 瀹夐槻鎺ュ彛____________________________ /// <summary> /// 鑾峰彇瀹夐槻鍒楄〃 /// </summary> @@ -2356,6 +2451,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; } @@ -2417,10 +2513,10 @@ return pack; } - #endregion +#endregion - #region Kaede --绗笁鏂瑰搧鐗屽姛鑳�-------------------------- +#region Kaede --绗笁鏂瑰搧鐗屽姛鑳�-------------------------- /// <summary> /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛� /// </summary> @@ -2445,15 +2541,18 @@ return pack; } - #endregion +#endregion - #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________ +#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); } @@ -2462,7 +2561,7 @@ #region 鈻� 鍙瀵硅_________________________ /// <summary> - /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃 + /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋� /// </summary> /// <returns></returns> public ResponsePackNew CheckFlVideo() @@ -2611,5 +2710,64 @@ } #endregion + /// <summary> + /// 缁戝畾source闈㈡澘 + /// </summary> + /// <returns></returns> + public ResponsePackNew BindSourcePanel(string qrString) + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); + d.Add("content", qrString); + var requestJson = HttpUtil.GetSignRequestJson(d); + return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_BindSourcePanel, requestJson); + } + + /// <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