From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 308 ++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 289 insertions(+), 19 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 9726771..7c113da 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -544,6 +544,13 @@
var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
if (homeList == null || homeList.Count == 0)
{
+ if (DB_ResidenceData.Instance.CurrentRegion!=null && DB_ResidenceData.Instance.CurrentRegion.id != "")
+ {
+ Shared.Application.RunOnMainThread(() =>
+ {
+ MainPage.GoUserPage(false);
+ });
+ }
}
else
{
@@ -564,6 +571,10 @@
}
if (UserInfo.Current.regionList.Count == 0)
{
+ Shared.Application.RunOnMainThread(() =>
+ {
+ MainPage.GoUserPage(false);
+ });
return "null";
}
//-------濡傛灉璐﹀彿鏄娆$櫥褰�
@@ -726,7 +737,7 @@
{
var requestObj = new ChildDeleteObj()
{
- childAccountId = subaccount.childAccountId,
+ childId = subaccount.id,
homeId = subaccount.homeId
};
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -741,12 +752,11 @@
/// <returns></returns>
public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId)
{
- var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
- {
- homeId = DB_ResidenceData.Instance.CurrentRegion.id,
- childAccountId = childAccountId,
- nickName = nickName,
- });
+ var d = new Dictionary<string, string>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("childId", childAccountId);
+ d.Add("nickName", nickName);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
}
@@ -761,7 +771,7 @@
var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
{
homeId = DB_ResidenceData.Instance.CurrentRegion.id,
- childAccountId = childAccountId,
+ childId = childAccountId,
isAllowCreateScene = isAllow,
});
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
@@ -977,10 +987,60 @@
public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
{
//娣诲姞瀛愯处鍙�
- var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, account = subAccount, nickName = nickName };
+ var requestObj = new ChildAddObj()
+ {
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
+ account = subAccount,
+ nickName = nickName
+ };
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
+ }
+ //v1.7鏇存柊鎺ュ彛
+ public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl)
+ {
+ //娣诲姞瀛愯处鍙�
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("nickName", nickName);
+ if (!string.IsNullOrEmpty(subAccount))
+ {
+ d.Add("account", subAccount);
+ }
+ if (!string.IsNullOrEmpty(faceUrl))
+ {
+ d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl);
+ }
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson);
+ }
+ /// <summary>
+ /// 鍒犻櫎鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+ /// </summary>
+ /// <param name="subAccount"></param>
+ /// <param name="nickName"></param>
+ /// <param name="faceUrl"></param>
+ /// <returns></returns>
+ public ResponsePackNew DeleteMemberFace( string childId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("childId", childId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson);
+ }
+ /// <summary>
+ /// 鏇存柊鎴愬憳璐﹀彿浜鸿劯鏁版嵁
+ /// </summary>
+ public ResponsePackNew UpdataMemberFace(string childId, string faceUrl)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("childId", childId);
+ d.Add("userFace", @"data:image/jpg;base64," + faceUrl);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson);
}
/// <summary>
@@ -1523,10 +1583,10 @@
//}
-#endregion
+ #endregion
-#region 澶囦唤閮ㄥ垎
+ #region 澶囦唤閮ㄥ垎
///// <summary>
///// 鑾峰彇浣忓畢澶囦唤鍒楄〃
///// </summary>
@@ -1997,10 +2057,22 @@
}
*/
-#endregion
+ #endregion
-#region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��
+ #region Kaede --璁惧鍔熻兘鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��
+ /// <summary>
+ /// 鑾峰彇涔愭瀛愯处鍙穞oken
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetLcSubAccountToken()
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetLcSubToken, requestJson);
+ }
/// <summary>
/// 鑾峰彇璁惧鍒楄〃
/// </summary>
@@ -2033,8 +2105,10 @@
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("productPlatform", productPlatform);
d.Add("productBrand", productBrand);
- if (productBrand != "MegaHealth")
+ if (productBrand == "MegaHealth" || productBrand == "IMOU")
{
+ }
+ else {
d.Add("networkConfig", true);
}
@@ -2064,7 +2138,7 @@
/// <param name="productPlatform"></param>
/// <param name="productBrand"></param>
/// <returns></returns>
- public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName, string pairCode = "")
+ public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName,string productBrandIdentity, string pairCode = "")
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -2072,12 +2146,28 @@
d.Add("extDevId", extDevId);
d.Add("name", deviceName);
d.Add("code", pairCode);
+ d.Add("productBrandIdentity", productBrandIdentity);
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
}
+ /// <summary>
+ /// 鍒犻櫎绗笁鏂硅澶�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Delete3tyDevice(string deviceId)
+ {
+
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Remove3tyDevcie, requestJson);
+ return responsePackNew;
+ }
@@ -2151,6 +2241,21 @@
d.Add("name", function.name);
d.Add("collect", function.collect);
d.Add("roomIds", function.roomIds);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
+ }
+ /// <summary>
+ /// 缂栬緫璁惧淇℃伅
+ /// 缁戝畾鍏崇郴銆佸悕绉般�佹敹钘�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UpdataDevcieName(Function function,string name)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", function.deviceId);
+ d.Add("name", name);
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson);
@@ -2823,9 +2928,25 @@
}
-#endregion
+ /// <summary>
+ /// 鑾峰彇绗笁鏂规敞鍐岀殑id
+ /// </summary>
+ /// <param homeId="homeId">浣忓畢id</param>
+ /// <returns></returns>
+ public ResponsePackNew GetExtUserId(string homeId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", homeId);
-#region 鈻� 闂ㄩ攣鐩稿叧____________________________
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson);
+
+ return pack;
+ }
+
+ #endregion
+
+ #region 鈻� 闂ㄩ攣鐩稿叧____________________________
/// <summary>
/// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�)
@@ -3027,7 +3148,7 @@
-#region 鍏変紡鍌ㄨ兘
+ #region 鍏変紡鍌ㄨ兘
/// <summary>
/// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
/// </summary>
@@ -3052,7 +3173,156 @@
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson);
return pack;
}
-#endregion
+ #endregion
+
+
+ #region 缇ゆ帶锛岀粍鍚堣皟鍏�
+ /// <summary>
+ /// 鑾峰彇缇ゆ帶绫诲瀷
+ /// </summary>
+ /// <param name="spk"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetGroupControlTypes(string spk)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("spk", spk);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson);
+ return pack;
+ }
+ /// <summary>
+ /// 鑾峰彇缇ゆ帶鍒楄〃
+ /// </summary>
+ /// <param name="spk"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetGroupControlList()
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
+ return pack;
+ }
+ /// <summary>
+ /// 鑾峰彇缇ゆ帶璇︽儏
+ /// </summary>
+ public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ var ids = new List<string>()
+ {
+ userDeviceGroupControlIds,
+ };
+ d.Add("userDeviceGroupControlIds", ids);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 鑾峰彇缇ゆ帶璇︽儏
+ /// </summary>
+ public ResponsePackNew GetGroupControInfo(List<string> ids)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("userDeviceGroupControlIds", ids);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 娣诲姞缇ゆ帶鍒楄〃
+ /// </summary>
+ public ResponsePackNew AddGroupControl(List<GroupControl> groupControls)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+ d.Add("infos", groupControls);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson);
+ return pack;
+ }
+
+
+ /// <summary>
+ /// 娣诲姞缇ゆ帶鍒楄〃
+ /// </summary>
+ public ResponsePackNew DelGroupControl(string groupControlId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 缂栬緫缇ゆ帶鍒楄〃
+ /// </summary>
+ /// <param name="spk"></param>
+ /// <returns></returns>
+ public ResponsePackNew EditGroupControl(List<GroupControl> groupControls)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ //d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
+ d.Add("infos", groupControls);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_UpdateGroupControl, requestJson);
+ return pack;
+ }
+
+
+ /// <summary>
+ /// 缇ゆ帶鎺у埗
+ /// </summary>
+ public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair)
+ {
+ var d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("userDeviceGroupControlId", userDeviceGroupControlId);
+ List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>();
+ dd.Add(pair);
+ d.Add("status",dd);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 鏀惰棌缇ゆ帶
+ /// </summary>
+ public ResponsePackNew CollectGroupControl(string groupControlId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson);
+ return pack;
+ }
+
+
+ /// <summary>
+ /// 鍙栨秷鏀惰棌缇ゆ帶
+ /// </summary>
+ public ResponsePackNew CancelCollectGroupControl(string groupControlId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson);
+ return pack;
+ }
+
+ #endregion
}
}
\ No newline at end of file
--
Gitblit v1.8.0