From 34d49c20c2c2543658e844847c5eaa87f4c954e9 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 23 二月 2021 17:28:40 +0800
Subject: [PATCH] Merge branch 'temp-wxr' into NewFilePath

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |   63 +++++++++++++++++++++++++------
 1 files changed, 50 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index c644bdc..60aacf0 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -571,15 +571,7 @@
                             if (mHomeGatewayRes.Count > 0)
                             {
                                 DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
-                                if (mHomeGatewayRes[0].gatewayStatus)
-                                {
-                                    //DriverLayer.Control.Ins.IsRemote = true;
-                                    DriverLayer.Control.Ins.GatewayOnline = true;
-                                }
-                                else
-                                {
-                                    DriverLayer.Control.Ins.GatewayOnline = false;
-                                }
+                                DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
                                 DB_ResidenceData.Instance.SaveResidenceData();
                                 return revertObj.Code;
                             }
@@ -605,18 +597,19 @@
         /// </summary>
         public string GetGatewayInfo()
         {
+            if (DB_ResidenceData.Instance.HomeGateway == null)
+                return StateCode.NETWORK_ERROR;
             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 jsonString = HttpUtil.GetSignRequestJson(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();
+                    DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
                 }
             }
             return revertObj.Code;
@@ -1809,7 +1802,7 @@
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
             d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
-            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
+            d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway == null ? "0" : DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
             d.Add("actions", actionObjs);
 
             var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1946,6 +1939,21 @@
             var requestJson = HttpUtil.GetSignRequestJson(d);
             return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
         }
+
+        /// <summary>
+        /// 鑾峰彇鍦烘櫙璇︽儏鍒楄〃
+        /// </summary>
+        /// <param name="seceneId">鍦烘櫙ID</param>
+        /// <returns></returns>
+        public ResponsePackNew GetSceneListInfo(List<string> seceneIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("userSceneIds", seceneIds);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
+        }
+
         /// <summary>
         /// 娣诲姞鍦烘櫙
         /// </summary>
@@ -2109,5 +2117,34 @@
         }
 
         #endregion
+
+
+        #region Kaede --鎴块棿鍔熻兘--------------------------
+        /// <summary>
+        /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛�
+        /// </summary>
+        public ResponsePackNew Get3tyBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList, requestJson);
+
+            return pack;
+        }
+        /// <summary>
+        /// 鑾峰彇缁戝畾鐨勭涓夋柟鍝佺墝鍒楄〃
+        /// </summary>
+        public ResponsePackNew Get3tyBindBrandList()
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBindBrandList, requestJson);
+
+            return pack;
+        }
+
+        #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0