From d4973876384be55df64de45db8a511d1e0330872 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 六月 2021 17:06:20 +0800
Subject: [PATCH] 房间小图列表
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 79 ++++++++++++++++++++++++++-------------
1 files changed, 53 insertions(+), 26 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index 214c33d..c1a0d9e 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -51,7 +51,7 @@
d.Add("type", qType);
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", deviceId );
- d.Add("key", "value" );
+ d.Add("key", deviceKey );
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -74,8 +74,20 @@
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_ArmSensorHistoricalData, requestJson);
}
+ /// <summary>
+ /// 璇诲彇鏈�杩戜竴涓湀鐨勬暟鎹�
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetLastMonthHistory(string deviceId,string key)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId);
+ d.Add("key", key);
-
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_SensorLastMonthHistoricalData, requestJson);
+ }
#endregion
@@ -470,7 +482,7 @@
/// <summary>
/// 鑾峰彇浣忓畢鍒楄〃
/// </summary>
- public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL)
+ public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL,string homeId = "")
{
var requestJson = HttpUtil.GetSignRequestJson(new GetHomeListObj() { homeType = homeType.ToString() });
var resultObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Gethomepager, requestJson);
@@ -485,28 +497,17 @@
{
foreach (var home in homeList)
{
- //var home = new RegionInfoRes()
- //{
- // RegionID = mHome.Id,
- // Name = mHome.homeName,
- // IsOthreShare = mHome.IsOtherShare,
- // accountType = mHome.accountType,
- // isRemoteControl = mHome.isRemoteControl,
- // isBindGateway = mHome.isBindGateway,
- // longitude = mHome.longitude,
- // latitude = mHome.latitude,
- // deliverstatus = mHome.deliverstatus,
- // homeType = mHome.homeType,
- // regionUrl = mHome.regionUrl,
- // emqUrl = mHome.emqUrl,
- // homeRegionName = mHome.homeRegionName,
- // homeRegionId = mHome.homeRegionId,
- // Address = mHome.homeAddress,
- // isAllowCreateScene = mHome.isAllowCreateScene,
- //};
if (home.isBindGateway)
{
UserInfo.Current.regionList.Add(home);
+ //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹�
+ if (!string.IsNullOrEmpty(homeId))
+ {
+ if (homeId.Contains(home.id))
+ {
+ DB_ResidenceData.Instance.CurrentRegion = home;
+ }
+ }
}
}
if(UserInfo.Current.regionList.Count== 0)
@@ -915,8 +916,9 @@
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("debugPerm", debugPerm);
- string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
- return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+ var jsonString = HttpUtil.GetSignRequestJson(d,d);
+ var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+ return pack;
}
@@ -1308,6 +1310,9 @@
MainPage.cityInfo.pm25 = jt.GetValue("Air_Quality").ToString();
MainPage.cityInfo.windLevel = jt.GetValue("WindLevel").ToString();
MainPage.cityInfo.weather = jt.GetValue("Weather").ToString();
+ MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString();
+ MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString();
+
break;
}
catch (Exception ex)
@@ -1835,7 +1840,10 @@
d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("productPlatform", productPlatform);
d.Add("productBrand", productBrand);
- d.Add("networkConfig", true);
+ if (productBrand != "MegaHealth")
+ {
+ d.Add("networkConfig", true);
+ }
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
@@ -1854,10 +1862,29 @@
d.Add("productBrand", productBrand);
d.Add("networkConfig", true);
-
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyBrandDevcieList, requestJson);
}
+ /// <summary>
+ /// 娉ㄥ唽绗笁鏂硅澶�
+ /// </summary>
+ /// <param name="productPlatform"></param>
+ /// <param name="productBrand"></param>
+ /// <returns></returns>
+ public ResponsePackNew IndependentRegister3TyDevcie(string spk,string extDevId,string deviceName)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("spk", spk);
+ d.Add("extDevId", extDevId);
+ d.Add("name", deviceName);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
+ }
+
+
+
/// <summary>
/// 鑾峰彇璁惧璇︽儏
--
Gitblit v1.8.0