From f345087dbefecef9146fdb13481cb9ee3320d576 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 23 十二月 2020 11:46:28 +0800 Subject: [PATCH] 20201223-2 --- HDL_ON/DAL/Server/HttpServerRequest.cs | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 490f401..e31e88c 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -599,6 +599,27 @@ } } + /// <summary> + /// 鑾峰彇缃戝叧淇℃伅 + /// </summary> + public string GetGatewayInfo() + { + Dictionary<string, object> d = new Dictionary<string, object>(); + d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); + d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); + string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); + var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGatewayInfo, jsonString); + if (revertObj.Code == StateCode.SUCCESS) + { + var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString()); + if (mHomeGatewayRes != null) + { + DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes; + DB_ResidenceData.Instance.SaveResidenceData(); + } + } + return revertObj.Code; + } /// <summary> /// 鑾峰彇浣忓畢涓嬬殑鎴愬憳璐﹀彿 -- Gitblit v1.8.0