From 6692d867a0876b014be3cbd64bc3a237a026dc2d Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 18 十月 2022 09:57:15 +0800
Subject: [PATCH] 修改安卓隐私确认弹窗,隐私协议英文的问题

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |  237 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 218 insertions(+), 19 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 8efd6e5..e39af1d 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -5,7 +5,6 @@
 using System.Text;
 using HDL_ON.Entity;
 using Newtonsoft.Json.Linq;
-using Shared;
 
 namespace HDL_ON.DAL.Server
 {
@@ -45,14 +44,19 @@
         /// <param name="qType">鏃堕棿鏌ヨ绫诲瀷锛歨our=杩�24灏忔椂銆亀eek=杩戜竴鍛ㄣ�乵onth = 杩戜竴鏈� </param>
         /// <param name="deviceId">璁惧ID</param>
         /// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param>
+        /// <param name="time">鍏蜂綋鏌ヨ鐨勬棩鏈燂紝閲戣寕娓╂帶鍣ㄤ娇鐢�</param>
         /// <returns></returns>
-        public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey)
+        public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("type", qType);
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
             d.Add("deviceId", deviceId);
             d.Add("key", deviceKey);
+            if (time != "")
+            {
+                d.Add("time", time);
+            }
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -144,6 +148,7 @@
             {
                 var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString());
                 UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
+                UserInfo.Current.AccessToken = revertData.accessToken;
                 UserInfo.Current.RefreshToken = revertData.refreshToken;
                 UserInfo.Current.LastTime = DateTime.Now;
                 UserInfo.Current.SaveUserInfo();
@@ -200,8 +205,6 @@
         }
 
         #region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-
-
         /// <summary>
         /// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
         /// </summary>
@@ -335,6 +338,20 @@
             }
             var requestJson = HttpUtil.GetSignRequestJson(requestObj);
             return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_ForgetPwd, requestJson);
+        }
+        /// <summary>
+        /// 淇敼瀵嗙爜
+        /// </summary>
+        /// <param name="loginPwd"></param>
+        /// <param name="loginNewPwd"></param>
+        /// <returns></returns>
+        public ResponsePackNew UpdataPassword(string loginPwd,string loginNewPwd)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("loginPwd", loginPwd);
+            d.Add("loginNewPwd", loginNewPwd);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Update_Pwd, requestJson);
         }
 
         /// <summary>
@@ -532,7 +549,7 @@
                 {
                     foreach (var home in homeList)
                     {
-                        if (home.isBindGateway)
+                        if (home.isBindGateway)//鏄惁缁戝畾缃戝叧
                         {
                             UserInfo.Current.regionList.Add(home);
                             //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹�
@@ -1030,10 +1047,10 @@
 #endif
                 //鏄惁鐢熶骇妯″紡
                 bool isProduce = true;
-#if DEBUG
-                isProduce = true;
-#endif
-
+                if (HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com")
+                {
+                    isProduce = false;
+                }
                 if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken))
                 {
                     Utlis.WriteLine("PushDeviceToken 涓虹┖");
@@ -1058,15 +1075,9 @@
 
                 //var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj);
                 var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj);
-
-                Utlis.WriteLine("mAddpushinfoJson: " + mAddpushinfoJson);
-
-                //new Alert("", , "鍙栨秷", "纭畾").Show();
                 var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_AddToken, mAddpushinfoJson);
                 if (revertObj.Code == StateCode.SUCCESS)
                 {
-                    //new Alert("", "鎻愪氦pushToken鎴愬姛" + OnAppConfig.Instance.PushDeviceToken, "鍙栨秷", "纭畾").Show();
-
                     if (revertObj.Data != null)
                     {
                         var pushId = revertObj.Data.ToString();
@@ -1075,7 +1086,7 @@
                             OnAppConfig.Instance.PushId = pushId;
                             OnAppConfig.Instance.SaveConfig();
                             Utlis.WriteLine("PushId: " + pushId);
-                            //new Alert("","鎻愪氦pushToken鎴愬姛"+ OnAppConfig.Instance.PushDeviceToken, "鍙栨秷","纭畾").Show();
+
                             return true;
                         }
                     }
@@ -1083,7 +1094,7 @@
                 }
                 else
                 {
-                    Utlis.WriteLine("AddToken 澶辫触");
+                    //Utlis.WriteLine("AddToken 澶辫触");
                 }
                 return false;
             }
@@ -1360,6 +1371,9 @@
         /// </summary>
         public void GetCityWeatherInfo(string lon, string lat)
         {
+            MainPage.cityInfo.lon = lon;
+            MainPage.cityInfo.lat = lat;
+
             System.Threading.Tasks.Task.Run(() =>
             {
                 while (true)
@@ -1401,7 +1415,7 @@
                             MainPage.cityInfo.weather = jt.GetValue("Weather").ToString();
                             MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString();
                             MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString();
-
+                            MainPage.CityWeatherAction?.Invoke();
                             break;
                         }
                         catch (Exception ex)
@@ -1957,7 +1971,7 @@
         /// 鑾峰彇璁惧鍒楄〃
         /// </summary>
         /// <returns></returns>
-        public ResponsePackNew GetDeviceList(string pageSize="",string pageNo ="")
+        public ResponsePackNew GetDeviceList(string pageSize = "", string pageNo = "")
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -2186,6 +2200,51 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson);
         }
+        /// <summary>
+        /// 璁惧鎵╁睍閰嶇疆
+        /// </summary>
+        public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId",  deviceId );
+            d.Add("extSet", extSet);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson);
+        }
+        /// <summary>
+        /// 鑾峰彇璁惧娑堟伅瑙勫垯閰嶇疆
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetDeviceMessageRulesSet(string deviceId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson);
+        }
+        /// <summary>
+        /// 璁惧娑堟伅瑙勫垯閰嶇疆
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <param name="conditionIdentify"></param>
+        /// <param name="push"></param>
+        /// <returns></returns>
+        public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("conditionIdentify", conditionIdentify);
+            d.Add("push", push);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson);
+        }
+
 
         #endregion
 
@@ -2580,6 +2639,93 @@
 
             return pack;
         }
+
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛╛Iot
+        /// </summary>
+        public ResponsePackNew Get3tyIotBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList_Iot, requestJson);
+
+            return pack;
+        }
+        /// <summary>
+        /// 鎼滅储绗笁鏂硅澶嘷iot
+        /// </summary>
+        /// <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;
+        }
+
+        /// <summary>
+        /// 鎼滅储绗笁鏂硅澶囧姛鑳藉垪琛╛iot
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Get3tyIotDeviceFunctionList(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_Get3tyIotFunction, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰钩鍙版敮鎸佺殑璁惧绫诲瀷鍒楄〃
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Get3tyIotSupportSpkList(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_Get3tyIotFunction, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 璁剧疆绗笁鏂硅澶囩粦瀹氱殑浣忓畢
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Set3tyIotFunctionToHouse(List<string> deviceIds,string homeId, string companyId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("deviceIds", deviceIds);
+            d.Add("homeId", homeId);
+            d.Add("companyId", companyId);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 瑙g粦绗笁鏂瑰钩鍙拌处鍙�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew Unbound3tyIotAccount(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_Unbound3tyIotAccount, requestJson);
+            return pack;
+        }
+
+
+
         /// <summary>
         /// 鑾峰彇缁戝畾鐨勭涓夋柟鍝佺墝鍒楄〃
         /// </summary>
@@ -2624,6 +2770,25 @@
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson);
             return pack;
         }
+        /// <summary>
+        /// 鑾峰彇闂ㄥ彛鏈哄緲寰婃姤璀︽暟鎹�
+        /// </summary>
+        /// <param name="deviceId"></param>
+        /// <returns></returns>
+        public ResponsePackNew GetAlarmRecords(string deviceId, int pageSize, int pageNo, string alarmType = "PROWLER_ALARM")
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("deviceId", deviceId);
+            d.Add("alarmType", alarmType);
+            d.Add("pageSize", pageSize);
+            d.Add("pageNo", pageNo);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson);
+            return pack;
+
+        }
+
         #endregion
 
         #region 鈻� 闂ㄩ攣鐩稿叧____________________________
@@ -2821,5 +2986,39 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
         }
+
+
+
+
+
+
+
+        #region 鍏変紡鍌ㄨ兘
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetInverterList()
+        {
+            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_GetInverter_List, requestJson);
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇浣忓畢涓嬪厜浼忕粺璁$殑鏁版嵁
+        /// </summary>
+        /// <returns></returns>
+        public ResponsePackNew GetInverterStatisticsInfo()
+        {
+            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_GetInverter_StatisticsInfo, requestJson);
+            return pack;
+        }
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0