From 1396007184e3e17c2465b1fea5ba5562daf7d157 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 02 六月 2021 16:02:59 +0800
Subject: [PATCH] 1
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 270 +++++++++++++++++++++++++++++++++++------------------
1 files changed, 177 insertions(+), 93 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index e7d32ab..65389f4 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -49,9 +49,9 @@
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("type", qType);
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
- d.Add("deviceId", new List<string>() { deviceId });
- d.Add("key", new List<string>() { deviceKey });
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceId", deviceId );
+ d.Add("key", deviceKey );
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson);
@@ -66,7 +66,7 @@
public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", deviceId);
d.Add("pageSize", pageSize);
d.Add("pageNo", pageNo);
@@ -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
@@ -465,33 +477,33 @@
if (resultObj.Code == StateCode.SUCCESS)
{
UserInfo.Current.regionList = new List<RegionInfoRes>();
- var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoResNew>>(resultObj.Data.ToString());
+ var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString());
if (homeList == null || homeList.Count == 0)
{
}
else
{
- foreach (var mHome in homeList)
+ 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,
- };
+ //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);
@@ -502,7 +514,7 @@
return "null";
}
//-------濡傛灉璐﹀彿鏄娆$櫥褰�
- if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID))
+ if (DB_ResidenceData.Instance.CurrentRegion == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id))
{
//鍒锋柊褰撳墠浣忓畢
DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0];
@@ -514,7 +526,7 @@
else
{
//浣忓畢琚垹闄�
- var findHome = UserInfo.Current.regionList.Find((obj) => obj.RegionID == DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ var findHome = UserInfo.Current.regionList.Find((obj) => obj.id == DB_ResidenceData.Instance.CurrentRegion.id);
if (findHome == null)
{
Shared.Application.RunOnMainThread(() =>
@@ -556,7 +568,7 @@
{
var requestObj = new AddOrUpdateHomeObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
};
if (editId == 0)
@@ -565,7 +577,7 @@
}
else if (editId == 1)
{
- requestObj.Address = editName;
+ requestObj.homeAddress = editName;
}
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -579,14 +591,14 @@
{
try
{
- if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.RegionID)) return "";
- var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.RegionID;
+ if (string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.id)) return "";
+ var nowhomeId = DB_ResidenceData.Instance.CurrentRegion.id;
var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = nowhomeId });
var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson);
if (revertObj.Code == StateCode.SUCCESS)
{
var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString());
- if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.RegionID)
+ if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.id)
{
if (mHomeGatewayRes != null)
{
@@ -622,7 +634,7 @@
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("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
var jsonString = HttpUtil.GetSignRequestJson(d);
var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGatewayInfo, jsonString);
@@ -643,7 +655,7 @@
/// <returns></returns>
public ResponsePackNew GetResidenceMemberAccount()
{
- var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID });
+ var requestJson = HttpUtil.GetSignRequestJson(new HomeIdObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id });
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_FindAll, requestJson);
}
@@ -672,7 +684,7 @@
{
var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
childAccountId = childAccountId,
nickName = nickName,
});
@@ -689,7 +701,7 @@
{
var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
childAccountId = childAccountId,
isAllowCreateScene = isAllow,
});
@@ -730,12 +742,13 @@
{
var requestJson = HttpUtil.GetSignRequestJson(new GetShareObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
childAccountId = childAccountId,
});
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_GetList, requestJson);
}
+
#endregion
///// <summary>
@@ -869,26 +882,27 @@
public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName)
{
//娣诲姞瀛愯处鍙�
- var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, 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);
}
- ///// <summary>
- ///// 鑾峰彇浣忓畢涓嬬殑鎴愬憳璐﹀彿淇℃伅
- ///// </summary>
- ///// <returns></returns>
- //public ResponsePack GetResidenceMemberAccountInfo(string account)
- //{
- // Dictionary<string, object> d = new Dictionary<string, object>();
- // d.Add("Account", account);
- // string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
- // return RequestHttps($"{severAddress}/ZigbeeUsers/GetSubAccountInfo", jsonString, true);
- //}
+ /// <summary>
+ /// 淇敼浣忓畢璋冭瘯鏉冮檺
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew ChangeResidenceDebugPerm(bool debugPerm)
+ {
+ 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);
+ }
-
-
+
+
#endregion
/// <summary>
@@ -928,6 +942,9 @@
{
try
{
+ //鍏堟竻绌烘帹閫両D锛岄伩鍏嶄娇鐢ㄧ紦瀛樼殑PushId涓哄叾瀹冭处鍙风殑鎯呭喌锛屽鑷存煡璇㈠埌鍏跺畠璐﹀彿鐨勬帹閫佽褰�
+ OnAppConfig.Instance.PushId = "";
+
string deviceType = PhoneDeviceType.Android.ToString();
#if __IOS__
deviceType = PhoneDeviceType.IOS.ToString();
@@ -1778,7 +1795,7 @@
public ResponsePackNew GetDeviceList()
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
//d.Add("gatewayId", DB_ResidenceData.residenceData.HomeGateway.gatewayId);
//d.Add("roomId", DB_ResidenceData.residenceData.residecenInfo.RegionID);//鍙帶鍙傛暟锛屽綋闇�瑕佸垎椤佃幏鍙栵紝鎬庝箞鐭ラ亾鍒嗛〉鎬绘暟
//d.Add("searchType", DB_ResidenceData.residenceData.residecenInfo.RegionID);
@@ -1797,7 +1814,7 @@
public ResponsePackNew Get3TyBrandBindDeviceList(string productPlatform, string productBrand)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("productPlatform", productPlatform);
d.Add("productBrand", productBrand);
d.Add("networkConfig", true);
@@ -1831,7 +1848,7 @@
public ResponsePackNew GetDeviceInfo(string functionId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", new List<string>() { functionId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1845,7 +1862,7 @@
public ResponsePackNew GetDeviceInfoList(List<string> functionIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", functionIds);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1858,7 +1875,7 @@
public ResponsePackNew RefreshDeviceStatus(List<string> functionIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", functionIds);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1873,7 +1890,7 @@
public ResponsePackNew ControlDevice(List<ApiAlinkControlActionObj> actionObjs)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway == null ? "0" : DB_ResidenceData.Instance.HomeGateway.gatewayId);//DriverLayer.Control.Ins.GatewayId);
d.Add("actions", actionObjs);
@@ -1889,7 +1906,7 @@
public ResponsePackNew UpdataDevcieInfo(Function function)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", function.deviceId);
d.Add("name", function.name);
d.Add("collect", function.collect);
@@ -1905,7 +1922,7 @@
public ResponsePackNew UpdataDevcieBindRoomInfo(Function function)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", function.deviceId);
d.Add("roomIds", function.roomIds);
@@ -1920,7 +1937,7 @@
public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", deviceIds);
d.Add("roomIds", roomIds);
@@ -1933,7 +1950,7 @@
public string UnbindDeviceToRoom(string deviceId, string roomId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", new List<string>() { deviceId });
d.Add("roomIds", new List<string>() { roomId });
@@ -1946,7 +1963,7 @@
public string EditDeviceName(string deviceId, string deviceName)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceId", deviceId);
d.Add("name", deviceName);
@@ -1959,7 +1976,7 @@
public ResponsePackNew CollectDevice(string deviceId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds",new List<string>() { deviceId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1971,7 +1988,7 @@
public ResponsePackNew CancelCollectDevice(string deviceId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("deviceIds", new List<string>() { deviceId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -1990,7 +2007,7 @@
public ResponsePackNew GetSceneList(string roomId = null)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
if (roomId != null)
{
d.Add("roomId", roomId);
@@ -2034,7 +2051,7 @@
public ResponsePackNew AddScene(Scene scene)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("scenes", new List<Scene>() { scene });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2052,7 +2069,7 @@
public ResponsePackNew EditScene(Scene scene)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("scenes", new List<Scene>() { scene });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2065,7 +2082,7 @@
public string DeleteScene(string userSceneId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("userSceneIds", new List<string>() { userSceneId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2078,7 +2095,7 @@
public string ExecuteScene(string userSceneId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("userSceneIds", new List<string>() { userSceneId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2092,7 +2109,7 @@
public string CollectScene(string userSceneId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("userSceneIds", new List<string>() { userSceneId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2106,7 +2123,7 @@
public string CancelCollectScene(string userSceneId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("userSceneIds", new List<string>() { userSceneId });
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2123,7 +2140,7 @@
public ResponsePackNew GetRoomList(string GetType = "All")
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
if (GetType != "All")
{
d.Add("roomType", GetType);
@@ -2142,7 +2159,7 @@
public ResponsePackNew AddRoom(List<SpatialInfo> rooms)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("rooms", rooms);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2161,7 +2178,7 @@
public ResponsePackNew UpdateRoom(List<SpatialInfo> rooms)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("rooms", rooms);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2181,7 +2198,7 @@
public ResponsePackNew DeleteRoom(List<string> roomIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("ids", roomIds);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2199,7 +2216,7 @@
public ResponsePackNew GetSecurityList()
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_List, requestJson);
@@ -2214,7 +2231,7 @@
public ResponsePackNew GetSecurityInfo(List<string> sidList, List<string> userSecurityIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
//sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
d.Add("sids", sidList);
@@ -2226,10 +2243,10 @@
/// <summary>
/// 娣诲姞瀹夐槻
/// </summary>
- public ResponsePackNew AddSecurity(List<Security> securities)
+ public ResponsePackNew AddSecurity(List<SecurityAlarm> securities)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
d.Add("securitys", securities);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2239,10 +2256,10 @@
/// <summary>
/// 缂栬緫瀹夐槻
/// </summary>
- public ResponsePackNew EditSecurity(List<Security> securities)
+ public ResponsePackNew EditSecurity(List<SecurityAlarm> securities)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
d.Add("securitys", securities);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2258,7 +2275,7 @@
public ResponsePackNew DeleteSecurity(List<string> sidList, List<string> userSecurityIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
//sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
d.Add("sids", sidList);
@@ -2276,7 +2293,7 @@
public ResponsePackNew ReadSecurityStatus(List<string> sidList, List<string> userSecurityIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
//sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
d.Add("sids", sidList);
@@ -2291,7 +2308,7 @@
public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("securitys", securityStates);
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
@@ -2304,7 +2321,7 @@
public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("securitys", securityBypassStates);
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassSet, requestJson);
@@ -2319,7 +2336,7 @@
public ResponsePackNew ReadSecurityBypass(List<string> sidList, List<string> userSecurityIds)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
//sids userSecurityIds 涓嶈兘鍚屾椂涓虹┖
d.Add("sids", sidList);
@@ -2334,7 +2351,7 @@
public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("pageSize", pageSize);
d.Add("pageNo", pageNo);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2347,7 +2364,7 @@
public ResponsePackNew GetSecurityAlarmLogList(string pageSize, string pageNo)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
d.Add("pageSize", pageSize);
d.Add("pageNo", pageNo);
var requestJson = HttpUtil.GetSignRequestJson(d);
@@ -2376,7 +2393,7 @@
public ResponsePackNew Get3tyBindBrandList()
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBindBrandList, requestJson);
@@ -2385,7 +2402,7 @@
#endregion
- #region 钀ょ煶浜慡DK鐩稿叧鎺ュ彛
+ #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
/// <summary>
/// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
/// </summary>
@@ -2398,7 +2415,7 @@
#endregion
- #region 鍙瀵硅
+ #region 鈻� 鍙瀵硅_________________________
/// <summary>
/// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃
/// </summary>
@@ -2406,11 +2423,78 @@
public ResponsePackNew CheckFlVideo()
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson);
return pack;
}
#endregion
+
+ #region 鈻� 闊崇璇█鎺у埗鐩稿叧_________________________
+ /// <summary>
+ /// 鑾峰彇宸叉巿鏉冪殑闊崇鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetSpeakerList()
+ {
+ var requestJson = HttpUtil.GetSignRequestJson(new GetSpeakerObj
+ {
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
+ });
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_List_Get, requestJson);
+ }
+
+ /// <summary>
+ /// 缂栬緫闊崇鎺堟潈澶囨敞
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UpdateSpeakerRemark(UpdateSpeakerRemarkObj remarkObj)
+ {
+ var requestJson = HttpUtil.GetSignRequestJson(remarkObj);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_Remark_Update, requestJson);
+ }
+
+ /// <summary>
+ /// 瑙i櫎闊崇缁戝畾
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UnbindSpeaker(string tokenId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("tokenId", tokenId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_Unbind, requestJson);
+ }
+
+ /// <summary>
+ /// 鑾峰彇闊崇鍒嗛厤鐨勮澶囧拰鍦烘櫙鍒楄〃
+ /// </summary>
+ /// <param name="getType">0 鏄煡璇㈠叏閮� 1鏄煡璇㈣澶� 2鏄煡璇㈠満鏅�</param>
+ /// <param name="tokenId"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetSpeakerDeviceList(int getType, string tokenId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("tokenId", tokenId);
+ if (getType > 0)
+ {
+ d.Add("isDevice", getType == 1);
+ }
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Get, requestJson);
+ }
+
+ /// <summary>
+ /// 鏇存柊闊崇鎺у埗鐨勮澶囧拰鍦烘櫙鐩爣
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew UpdateSpeakerDeviceList(UpdateSpeakerDeviceListObj updateSpeakerDeviceListObj)
+ {
+ var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson);
+ }
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.8.0