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 | 592 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 551 insertions(+), 41 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 738cd33..7c113da 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -44,14 +44,19 @@
/// <param name="qType">鏃堕棿鏌ヨ绫诲瀷锛歨our=杩�24灏忔椂銆亀eek=杩戜竴鍛ㄣ�乵onth = 杩戜竴鏈� </param>
/// <param name="deviceId">璁惧ID</param>
/// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param>
+ /// <param name="time">鍏蜂綋鏌ヨ鐨勬棩鏈燂紝閲戣寕娓╂帶鍣ㄤ娇鐢�</param>
/// <returns></returns>
- public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey)
+ public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "")
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("type", qType);
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", deviceId);
d.Add("key", deviceKey);
+ if (time != "")
+ {
+ d.Add("time", time);
+ }
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -143,6 +148,7 @@
{
var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString());
UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken;
+ UserInfo.Current.AccessToken = revertData.accessToken;
UserInfo.Current.RefreshToken = revertData.refreshToken;
UserInfo.Current.LastTime = DateTime.Now;
UserInfo.Current.SaveUserInfo();
@@ -199,8 +205,6 @@
}
#region 娉ㄥ唽銆佺櫥褰曢儴鍒�
-
-
/// <summary>
/// 閫氱敤 鍙戦�侀獙璇佺爜鏂规硶
/// </summary>
@@ -334,6 +338,20 @@
}
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_ForgetPwd, requestJson);
+ }
+ /// <summary>
+ /// 淇敼瀵嗙爜
+ /// </summary>
+ /// <param name="loginPwd"></param>
+ /// <param name="loginNewPwd"></param>
+ /// <returns></returns>
+ public ResponsePackNew UpdataPassword(string loginPwd,string loginNewPwd)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("loginPwd", loginPwd);
+ d.Add("loginNewPwd", loginNewPwd);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Update_Pwd, requestJson);
}
/// <summary>
@@ -526,12 +544,19 @@
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
{
foreach (var home in homeList)
{
- if (home.isBindGateway)
+ if (home.isBindGateway)//鏄惁缁戝畾缃戝叧
{
UserInfo.Current.regionList.Add(home);
//鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹�
@@ -546,6 +571,10 @@
}
if (UserInfo.Current.regionList.Count == 0)
{
+ Shared.Application.RunOnMainThread(() =>
+ {
+ MainPage.GoUserPage(false);
+ });
return "null";
}
//-------濡傛灉璐﹀彿鏄娆$櫥褰�
@@ -708,7 +737,7 @@
{
var requestObj = new ChildDeleteObj()
{
- childAccountId = subaccount.childAccountId,
+ childId = subaccount.id,
homeId = subaccount.homeId
};
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -723,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);
}
@@ -743,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);
@@ -959,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>
@@ -1029,10 +1107,10 @@
#endif
//鏄惁鐢熶骇妯″紡
bool isProduce = true;
-#if DEBUG
- isProduce = false;
-#endif
-
+ if (HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com")
+ {
+ isProduce = false;
+ }
if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken))
{
Utlis.WriteLine("PushDeviceToken 涓虹┖");
@@ -1336,23 +1414,60 @@
{
var requestObj = new AppVersionCheckObj()
{
-
+
};
+ #if __IOS__
+ requestObj.releaseSystem = "IOS";
+ #else
+ requestObj.releaseSystem = "Android";
+ #endif
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson);
}
-
-
-
#endregion
- #region 鑾峰彇澶╂皵閮ㄥ垎
+ #region 娉ㄩ攢璐﹀彿
+ /// <summary>
+ /// 鑾峰彇褰撳墠鐗堟湰娉ㄩ攢璐﹀彿妯″紡
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetUnregisterModel()
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("version", MainPage.VersionString);
+ d.Add("appCode", "1588071238036582401");
+#if __IOS__
+ d.Add("releaseSystem", "IOS");
+#else
+ d.Add("releaseSystem", "Android");
+#endif
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetUnregisterModel, requestJson);
+ }
+ /// <summary>
+ /// 娉ㄩ攢璐﹀彿
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Unregister(string pwd)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("userId", UserInfo.Current.ID);
+ d.Add("pwd", pwd);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_Unregister, requestJson);
+ }
+#endregion
+
+#region 鑾峰彇澶╂皵閮ㄥ垎
/// <summary>
/// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
/// </summary>
public void GetCityWeatherInfo(string lon, string lat)
{
+ MainPage.cityInfo.lon = lon;
+ MainPage.cityInfo.lat = lat;
+
System.Threading.Tasks.Task.Run(() =>
{
while (true)
@@ -1394,7 +1509,7 @@
MainPage.cityInfo.weather = jt.GetValue("Weather").ToString();
MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString();
MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString();
-
+ MainPage.CityWeatherAction?.Invoke();
break;
}
catch (Exception ex)
@@ -1947,10 +2062,22 @@
#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>
/// <returns></returns>
- public ResponsePackNew GetDeviceList(string pageSize="",string pageNo ="")
+ public ResponsePackNew GetDeviceList(string pageSize = "", string pageNo = "")
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
@@ -1978,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);
}
@@ -2009,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);
@@ -2017,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;
+ }
@@ -2096,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);
@@ -2179,10 +2339,55 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson);
}
+ /// <summary>
+ /// 璁惧鎵╁睍閰嶇疆
+ /// </summary>
+ public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId );
+ d.Add("extSet", extSet);
- #endregion
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson);
+ }
+ /// <summary>
+ /// 鑾峰彇璁惧娑堟伅瑙勫垯閰嶇疆
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetDeviceMessageRulesSet(string deviceId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
- #region Kaede --鍦烘櫙鍔熻兘--------------------------
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson);
+ }
+ /// <summary>
+ /// 璁惧娑堟伅瑙勫垯閰嶇疆
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <param name="conditionIdentify"></param>
+ /// <param name="push"></param>
+ /// <returns></returns>
+ public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("conditionIdentify", conditionIdentify);
+ d.Add("push", push);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson);
+ }
+
+
+#endregion
+
+#region Kaede --鍦烘櫙鍔熻兘--------------------------
/// <summary>
/// 鑾峰彇鍦烘櫙鍒楄〃
/// 鎴块棿ID鍙┖锛岄粯璁ゆ煡璇綇瀹呬笅鎵�鏈夋埧闂�
@@ -2314,9 +2519,9 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code;
}
- #endregion
+#endregion
- #region Kaede --鎴块棿鍔熻兘--------------------------
+#region Kaede --鎴块棿鍔熻兘--------------------------
/// <summary>
/// 鑾峰彇鎴块棿鍒楄〃
/// </summary>
@@ -2391,10 +2596,10 @@
return pack;
}
- #endregion
+#endregion
- #region Kaede -- 瀹夐槻鎺ュ彛____________________________
+#region Kaede -- 瀹夐槻鎺ュ彛____________________________
/// <summary>
/// 鑾峰彇瀹夐槻鍒楄〃
/// </summary>
@@ -2558,10 +2763,10 @@
return pack;
}
- #endregion
+#endregion
- #region Kaede --绗笁鏂瑰搧鐗屽姛鑳�--------------------------
+#region Kaede --绗笁鏂瑰搧鐗屽姛鑳�--------------------------
/// <summary>
/// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛�
/// </summary>
@@ -2573,6 +2778,93 @@
return pack;
}
+
+ /// <summary>
+ /// 鑾峰彇绗笁鏂瑰搧鐗屽垪琛╛Iot
+ /// </summary>
+ public ResponsePackNew Get3tyIotBrandList()
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList_Iot, requestJson);
+
+ return pack;
+ }
+ /// <summary>
+ /// 鎼滅储绗笁鏂硅澶嘷iot
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Search3tyIotDevice(string companyId)
+ {
+
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("companyId", companyId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Search3tyIotDevice, requestJson);
+
+ return pack;
+ }
+
+ /// <summary>
+ /// 鎼滅储绗笁鏂硅澶囧姛鑳藉垪琛╛iot
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Get3tyIotDeviceFunctionList(string companyId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("companyId", companyId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson);
+ return pack;
+ }
+ /// <summary>
+ /// 鑾峰彇绗笁鏂瑰钩鍙版敮鎸佺殑璁惧绫诲瀷鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Get3tyIotSupportSpkList(string companyId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("companyId", companyId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 璁剧疆绗笁鏂硅澶囩粦瀹氱殑浣忓畢
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Set3tyIotFunctionToHouse(List<string> deviceIds,string homeId, string companyId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("deviceIds", deviceIds);
+ d.Add("homeId", homeId);
+ d.Add("companyId", companyId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson);
+ return pack;
+ }
+
+ /// <summary>
+ /// 瑙g粦绗笁鏂瑰钩鍙拌处鍙�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew Unbound3tyIotAccount(string companyId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("companyId", companyId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Unbound3tyIotAccount, requestJson);
+ return pack;
+ }
+
+
+
/// <summary>
/// 鑾峰彇缁戝畾鐨勭涓夋柟鍝佺墝鍒楄〃
/// </summary>
@@ -2586,9 +2878,9 @@
return pack;
}
- #endregion
+#endregion
- #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
+#region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
/// <summary>
/// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
/// 2021-07-07 鏂版柟妗堟帴鍙h皟鏁村鎺�
@@ -2601,10 +2893,10 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
}
- #endregion
+#endregion
- #region 鈻� 鍙瀵硅_________________________
+#region 鈻� 鍙瀵硅_________________________
/// <summary>
/// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋�
/// </summary>
@@ -2617,6 +2909,41 @@
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson);
return pack;
}
+ /// <summary>
+ /// 鑾峰彇闂ㄥ彛鏈哄緲寰婃姤璀︽暟鎹�
+ /// </summary>
+ /// <param name="deviceId"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetAlarmRecords(string deviceId, int pageSize, int pageNo, string alarmType = "PROWLER_ALARM")
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("alarmType", alarmType);
+ d.Add("pageSize", pageSize);
+ d.Add("pageNo", pageNo);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson);
+ return pack;
+
+ }
+
+ /// <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);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson);
+
+ return pack;
+ }
+
#endregion
#region 鈻� 闂ㄩ攣鐩稿叧____________________________
@@ -2688,8 +3015,8 @@
return listSortLog;
}
- #endregion
- #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
+#endregion
+#region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
/// <summary>
/// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
/// </summary>
@@ -2753,7 +3080,7 @@
var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
}
- #endregion
+#endregion
/// <summary>
/// 缁戝畾source闈㈡澘
@@ -2814,5 +3141,188 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
}
+
+
+
+
+
+
+
+ #region 鍏変紡鍌ㄨ兘
+ /// <summary>
+ /// 鑾峰彇浣忓畢涓嬮�嗗彉鍣ㄥ垪琛�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetInverterList()
+ {
+ 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_GetInverter_List, requestJson);
+ return pack;
+ }
+ /// <summary>
+ /// 鑾峰彇浣忓畢涓嬪厜浼忕粺璁$殑鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetInverterStatisticsInfo()
+ {
+ 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_GetInverter_StatisticsInfo, requestJson);
+ return pack;
+ }
+ #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