黄学彪
2021-01-28 291b8c485ac4095c3c20570602cce9c91d7f45b8
HDL_ON/DAL/Server/HttpServerRequest.cs
old mode 100644 new mode 100755
@@ -571,15 +571,14 @@
                            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;
                                }
                                //if (mHomeGatewayRes[0].gatewayStatus)
                                //{
                                //    DriverLayer.Control.Ins.GatewayOnline = true;
                                //}
                                //else
                                //{
                                //    DriverLayer.Control.Ins.GatewayOnline = false;
                                //}
                                DB_ResidenceData.Instance.SaveResidenceData();
                                return revertObj.Code;
                            }
@@ -608,15 +607,17 @@
            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();
                    if(mHomeGatewayRes.gatewayStatus)
                    {
                        DriverLayer.Control.Ins.GatewayOnline = true;
                    }
                }
            }
            return revertObj.Code;
@@ -1809,7 +1810,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 +1947,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>