From d020a48f69f1acd8d97fc15372e19cde7779d934 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 15 十一月 2021 10:46:43 +0800 Subject: [PATCH] 绑定source面板 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 103 +++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 91 insertions(+), 12 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 48f2b5f..8f2d089 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); @@ -2489,10 +2556,10 @@ var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); } -#endregion + #endregion -#region 鈻� 鍙瀵硅_________________________ + #region 鈻� 鍙瀵硅_________________________ /// <summary> /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋� /// </summary> @@ -2505,9 +2572,9 @@ var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson); return pack; } -#endregion + #endregion -#region 鈻� 闂ㄩ攣鐩稿叧____________________________ + #region 鈻� 闂ㄩ攣鐩稿叧____________________________ /// <summary> /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�) @@ -2576,8 +2643,8 @@ return listSortLog; } -#endregion -#region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________ + #endregion + #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________ /// <summary> /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃 /// </summary> @@ -2641,8 +2708,20 @@ var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson); } -#endregion + #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> /// 浜鸿劯褰曞叆 -- Gitblit v1.8.0