From cbc156bc38d8b8eae7aef60cb186ab2b52fa701f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 13:59:56 +0800
Subject: [PATCH] 增加全部挂断
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 104 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 97 insertions(+), 7 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 30e9b71..731c865 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -161,7 +161,7 @@
/// 鍒锋柊Token
/// </summary>
/// <returns></returns>
- public string RefreshToken()
+ public string RefreshToken(bool canRefresh = true)
{
var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj()
{
@@ -187,6 +187,17 @@
{
UserInfo.Current.LastTime = DateTime.MinValue;
}
+#if __IOS__
+ else if (revertObj.Code == "10001")
+ {
+ if (canRefresh)
+ {
+ UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken);
+ //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken);
+ RefreshToken(false);
+ }
+ }
+#endif
return revertObj.Code;
}
@@ -698,8 +709,8 @@
{
if (mHomeGatewayRes.Count > 0)
{
- DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];
- DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
+ DB_ResidenceData.Instance.HomeGateway = mHomeGatewayRes[0];//缃戝叧鐘舵��
+ HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes[0].gatewayStatus;
DB_ResidenceData.Instance.SaveResidenceData();
return revertObj.Code;
}
@@ -765,7 +776,7 @@
var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<HomeGatewayInfo>(revertObj.Data.ToString());
if (mHomeGatewayRes != null)
{
- DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
+ HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = mHomeGatewayRes.gatewayStatus;
}
}
return revertObj.Code;
@@ -1527,7 +1538,7 @@
}
#endregion
-#region 鑾峰彇澶╂皵閮ㄥ垎
+ #region 鑾峰彇澶╂皵閮ㄥ垎
/// <summary>
/// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
/// </summary>
@@ -2288,7 +2299,7 @@
d.Add("actions", actionObjs);
var requestJson = HttpUtil.GetSignRequestJson(d);
- MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}");
+ MainPage.Log($"api鍙戦�佹帶鍒讹細{requestJson}");
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
}
/// <summary>
@@ -2308,6 +2319,23 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
}
+
+ /// <summary>
+ /// 缂栬緫璁惧淇℃伅
+ /// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UpdataDevcieName(string deviceId,string name)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("name", name);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+ }
+
/// <summary>
/// 缂栬緫璁惧淇℃伅
/// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
@@ -3384,6 +3412,69 @@
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetFaceRecognitionUnlockCfg, requestJson);
}
+ /// <summary>
+ /// 鏌ヨ闂ㄩ攣绯荤粺澹伴煶
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetDoorLockSystemSound(string deviceId)
+ {
+ var 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_GetDoorLockSystemSound, requestJson);
+ }
+
+ /// <summary>
+ /// 璁剧疆闂ㄩ攣绯荤粺澹伴煶
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <param name="sound"></param>
+ /// <returns></returns>
+ public ResponsePackNew SetDoorLockSystemSound(string deviceId,int sound)
+ {
+ var d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("sound", sound);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorLockSystemSound, requestJson);
+ }
+
+ /// <summary>
+ /// 鏌ヨ闂ㄩ搩鎻愮ず闊�
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetDoorBellTone(string deviceId)
+ {
+ var 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_GetDoorBellTone, requestJson);
+ }
+
+ /// <summary>
+ /// 璁剧疆闂ㄩ搩鎻愮ず闊�
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <param name="volume"></param>
+ /// <returns></returns>
+ public ResponsePackNew SetDoorBellTone(string deviceId, int volume)
+ {
+ var d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("volume", volume);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SetDoorBellTone, requestJson);
+ }
+
+
+
+
#endregion
#endregion
@@ -3586,7 +3677,6 @@
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
return pack;
}
-
/// <summary>
/// 鑾峰彇缇ゆ帶璇︽儏
/// </summary>
--
Gitblit v1.8.0