From 3db5c3218f405795dc9a2d0f6afdde8ab8ac9e73 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 23 十一月 2021 09:11:30 +0800 Subject: [PATCH] Merge branch 'WJC' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into WJC --- HDL_ON/DAL/Server/HttpServerRequest.cs | 77 ++++++++++++++++++++++++++++++++++++-- 1 files changed, 72 insertions(+), 5 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 48f2b5f..1fbd42c 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -1271,9 +1271,21 @@ { IsBackground = true }.Start(); } -#endregion + /// <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 妫�娴嬫洿鏂� + #region 妫�娴嬫洿鏂� /// <summary> /// /// </summary> @@ -1295,9 +1307,9 @@ #region 鑾峰彇澶╂皵閮ㄥ垎 /// <summary> - /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅 + /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅 /// </summary> - public void GetCityInfo(string lon, string lat) + public void GetCityWeatherInfo(string lon, string lat) { System.Threading.Tasks.Task.Run(() => { @@ -1360,6 +1372,59 @@ }); }); } + ///// <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); + // } + + // 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}"); + // } + // } + // } + // }); + //} + #endregion @@ -1899,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); -- Gitblit v1.8.0