From 1a0a7f736c6d2e7129e7591d40bed67ec7c0f09a Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期五, 05 二月 2021 10:47:42 +0800
Subject: [PATCH] 2021-02-05 1.编译冲突修改
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 101 insertions(+), 16 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 490f401..e3bed2f 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -503,7 +503,7 @@
UserInfo.Current.SaveUserInfo();
Action action = () =>
{
- MainPage.GoUserPage();
+ MainPage.GoUserPage(true);
};
new UI.PublicAssmebly().TipMsg(StringId.Tip, StringId.ResidenceDeletedSwitchToAnotherResidence, action);
});
@@ -553,11 +553,11 @@
/// <summary>
/// 鑾峰彇鍒锋柊褰撳墠浣忓畢鐨勭綉鍏冲垪琛�
/// </summary>
- public void GetHomeGatewayList()
+ public string GetHomeGatewayList()
{
try
{
- if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return;
+ if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
@@ -571,17 +571,16 @@
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;
+ return revertObj.Code;
}
}
//鍏朵綑鎯呭喌娓呯┖缃戝叧淇℃伅
@@ -593,11 +592,37 @@
{
//鎻愮ず閿欒
}
+ return revertObj.Code;
}
catch
{
-
+ return "";
}
+ }
+ /// <summary>
+ /// 鑾峰彇缃戝叧淇℃伅
+ /// </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);
+ 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)
+ {
+ if(mHomeGatewayRes.gatewayStatus)
+ {
+ DriverLayer.Control.Ins.GatewayOnline = true;
+ }
+ }
+ }
+ return revertObj.Code;
}
/// <summary>
@@ -1787,7 +1812,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);
@@ -1802,7 +1827,7 @@
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
- d.Add("deviceId", function.deviceId);//DriverLayer.Control.Ins.GatewayId);
+ d.Add("deviceId", function.deviceId);
d.Add("name", function.name);
d.Add("collect", function.collect);
d.Add("roomIds", function.roomIds);
@@ -1810,6 +1835,22 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
}
+ /// <summary>
+ /// 鏇存柊璁惧缁戝畾鎴块棿淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("deviceId", function.deviceId);
+ d.Add("roomIds", function.roomIds);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+ }
+
+
/// <summary>
/// 璁惧缁戝畾鎴块棿
/// </summary>
@@ -1908,6 +1949,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>
@@ -2071,5 +2127,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