From e71c57108e6dd407c2c6f0361f68150f2ff9aed5 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 15 十二月 2021 13:41:16 +0800
Subject: [PATCH] 版本备份
---
HDL_ON/DAL/Server/HttpServerRequest.cs | 657 +++++++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 526 insertions(+), 131 deletions(-)
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index e7d32ab..2414895 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -45,13 +45,13 @@
/// <param name="deviceId">璁惧ID</param>
/// <param name="deviceKey">鍔熻兘鏌ヨ绫诲瀷锛歱m25</param>
/// <returns></returns>
- public ResponsePackNew GetSensorHistory(string qType, string deviceId,string deviceKey)
+ public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey)
{
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);
@@ -63,10 +63,10 @@
/// <param name="pageSize">椤甸潰澶у皬</param>
/// <param name="pageNo">椤靛彿</param>
/// <returns></returns>
- public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo)
+ 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
@@ -134,6 +146,12 @@
UserInfo.Current.RefreshToken = revertData.refreshToken;
UserInfo.Current.LastTime = DateTime.Now;
UserInfo.Current.SaveUserInfo();
+
+#if __IOS__
+ var sdm = new SiriKit.SceneDateManager();
+ sdm.AccessToken = UserInfo.Current.LoginTokenString;
+ sdm.RefreshToken = UserInfo.Current.RefreshToken;
+#endif
}
return revertObj.Code;
}
@@ -222,7 +240,19 @@
account = account,
loginPwd = password
});
- return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson);
+ var pack = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson);
+ if (pack != null)
+ {
+ if (pack.Code == StateCode.SUCCESS)
+ {
+
+#if __IOS__
+ var sdm = new SiriKit.SceneDateManager();
+ sdm.IsLgoin = true;
+#endif
+ }
+ }
+ return pack;
}
/// <summary>
@@ -239,7 +269,19 @@
verifyCode = vCode,
grantType = "verify"
});
- return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson);
+ var pack = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson);
+ if (pack != null)
+ {
+ if (pack.Code == StateCode.SUCCESS)
+ {
+
+#if __IOS__
+ var sdm = new SiriKit.SceneDateManager();
+ sdm.IsLgoin = true;
+#endif
+ }
+ }
+ return pack;
}
/// <summary>
@@ -252,7 +294,7 @@
/// <returns></returns>
public ResponsePackNew ValidataCodeAndRegister(string account, string password, string code, bool isPhone = false)
{
- var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code};//, memberName = account
+ var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code };//, memberName = account
if (isPhone)
{
requestObj.memberPhone = account;
@@ -333,7 +375,7 @@
UserInfo.Current.userEmailInfo = info.memberEmail;
UserInfo.Current.userMobileInfo = info.memberPhone;
UserInfo.Current.userName = info.memberName;
-
+
if (!string.IsNullOrEmpty(info.memberPhonePrefix))
{
UserInfo.Current.areaCode = info.memberPhonePrefix;
@@ -452,57 +494,58 @@
return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_UnbindWithAccount, requestJson).Code;
}
+ /// <summary>
+ /// 鏍规嵁璐﹀彿,鑾峰彇璐﹀彿淇℃伅
+ /// </summary>
+ /// <param name="i_account">鎸囧畾璐﹀彿</param>
+ /// <returns></returns>
+ public ResponsePackNew GetMemberInfoByAccount(string i_account)
+ {
+ var pra = new { account = i_account };
+ var requestJson = HttpUtil.GetSignRequestJson(pra);
+ return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_GetMemberInfoByAccount, requestJson);
+ }
+
#endregion
#region 浣忓畢閮ㄥ垎
/// <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);
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,
- };
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)
+ if (UserInfo.Current.regionList.Count == 0)
{
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 +557,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(() =>
@@ -540,6 +583,12 @@
GetHomeGatewayList();
}
}
+
+#if __IOS__
+ var sdm = new SiriKit.SceneDateManager();
+ sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl;
+ sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id;
+#endif
}
}
@@ -556,7 +605,7 @@
{
var requestObj = new AddOrUpdateHomeObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
};
if (editId == 0)
@@ -565,7 +614,7 @@
}
else if (editId == 1)
{
- requestObj.Address = editName;
+ requestObj.homeAddress = editName;
}
var requestJson = HttpUtil.GetSignRequestJson(requestObj);
@@ -579,14 +628,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 +671,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 +692,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 +721,7 @@
{
var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
childAccountId = childAccountId,
nickName = nickName,
});
@@ -689,11 +738,47 @@
{
var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj()
{
- homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
childAccountId = childAccountId,
isAllowCreateScene = isAllow,
});
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson);
+ }
+
+ /// <summary>
+ /// 杩囨埛
+ /// </summary>
+ /// <param name="i_account">瀵规柟璐﹀彿</param>
+ /// <returns></returns>
+ public bool TransferResidence(string i_account)
+ {
+ var pra2 = new
+ {
+ homeId = Entity.DB_ResidenceData.Instance.CurrentRegion.id,
+ account = i_account
+ };
+ var requestJson = HttpUtil.GetSignRequestJson(pra2);
+ var result = HttpUtil.RequestHttpsPost(NewAPI.API_Post_TransferResidence, requestJson);
+
+ return result != null && result.Code == StateCode.SUCCESS;
+ }
+
+ /// <summary>
+ /// 绠$悊鍛樻潈闄愯縼绉�
+ /// </summary>
+ /// <param name="i_childAccountId">鎴愬憳璐﹀彿id</param>
+ /// <returns></returns>
+ public bool AdminAuthorityMigration(string i_childAccountId)
+ {
+ var pra2 = new
+ {
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
+ childAccountId = i_childAccountId
+ };
+ var requestJson = HttpUtil.GetSignRequestJson(pra2);
+ var result = HttpUtil.RequestHttpsPost(NewAPI.API_Post_AdminAuthorityMigration, requestJson);
+
+ return result != null && result.Code == StateCode.SUCCESS;
}
#region 鏂版暟鎹垎浜�
@@ -730,12 +815,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 +955,28 @@
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);
+ var jsonString = HttpUtil.GetSignRequestJson(d, d);
+ var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString);
+ return pack;
+ }
-
-
+
+
#endregion
/// <summary>
@@ -928,6 +1016,9 @@
{
try
{
+ //鍏堟竻绌烘帹閫両D锛岄伩鍏嶄娇鐢ㄧ紦瀛樼殑PushId涓哄叾瀹冭处鍙风殑鎯呭喌锛屽鑷存煡璇㈠埌鍏跺畠璐﹀彿鐨勬帹閫佽褰�
+ OnAppConfig.Instance.PushId = "";
+
string deviceType = PhoneDeviceType.Android.ToString();
#if __IOS__
deviceType = PhoneDeviceType.IOS.ToString();
@@ -938,7 +1029,8 @@
isProduce = false;
#endif
- if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) {
+ if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken))
+ {
Utlis.WriteLine("PushDeviceToken 涓虹┖");
return false;
}
@@ -949,7 +1041,15 @@
deviceName = OnAppConfig.Instance.PhoneName,
deviceType = deviceType,
produce = isProduce,
+
};
+ mAddpushinfoObj.languageType = Utlis.GetPostLanguageType();
+
+#if DEBUG
+ //List<string> communityCodes = new List<string>();
+ //communityCodes.Add("");
+ //mAddpushinfoObj.communityCodes = communityCodes;
+#endif
//var mAddpushinfoJson = Newtonsoft.Json.JsonConvert.SerializeObject(mAddpushinfoObj);
var mAddpushinfoJson = HttpUtil.GetSignRequestJson(mAddpushinfoObj);
@@ -964,11 +1064,11 @@
OnAppConfig.Instance.PushId = pushId;
OnAppConfig.Instance.SaveConfig();
Utlis.WriteLine("PushId: " + pushId);
-
+
return true;
}
}
-
+
}
else
{
@@ -986,7 +1086,7 @@
/// <summary>
/// 鏌ヨ鎺ㄩ�佷俊鎭垪琛�
/// </summary>
- /// <param name="queryType">0鍏ㄩ儴 1鍒嗕韩涓庡姛鑳� 2鎶ヨ绫� 3绯荤粺淇℃伅</param>
+ /// <param name="queryType">0鍏ㄩ儴 1鍒嗕韩涓庡姛鑳� 2鎶ヨ绫� 3绯荤粺淇℃伅 4鐗╀笟閫氱煡</param>
/// <returns></returns>
public ResponsePackNew PushSerivceGetPushmessagelist(int queryType = 0)
{
@@ -1004,13 +1104,18 @@
{
pushType = PushType.Prompt.ToString();
}
-
+ else if (queryType == 4)
+ {
+ pushType = PushType.Notice.ToString();
+ }
var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj()
{
pushId = OnAppConfig.Instance.PushId,
- pushType = pushType
+ pushType = pushType,
+ homeId = DB_ResidenceData.Instance.CurrentRegion.id,
});
- return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson);
+ //2021-08-28 鏀逛负鍒嗛〉鏌ヨ
+ return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist_Paging, requestJson);
}
/// <summary>
@@ -1047,10 +1152,11 @@
if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
try
{
- var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() {
+ var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj()
+ {
pushId = OnAppConfig.Instance.PushId
});
-
+
var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_DeleteToken, requestJson);
if (revertObj.Code == StateCode.SUCCESS)
{
@@ -1138,16 +1244,13 @@
/// </summary>
/// <param name="msgId"></param>
/// <returns></returns>
- public bool PushSerivceDeleteMessage(string msgId)
+ public bool PushSerivceDeleteMessage(PushMsgIdObj mPushMsgIdObj)
{
if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
-
+ if (mPushMsgIdObj == null) return false;
try
{
- var requestJson = HttpUtil.GetSignRequestJson(new PushMsgIdObj()
- {
- msgId = msgId
- });
+ var requestJson = HttpUtil.GetSignRequestJson(mPushMsgIdObj);
var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Deletepushinfo, requestJson);
if (revertObj.Code == StateCode.SUCCESS)
@@ -1206,6 +1309,18 @@
{ IsBackground = true }.Start();
}
+ /// <summary>
+ /// 鑾峰彇鐗╀笟鍏憡璇︽儏
+ /// </summary>
+ /// <param name="noticeId"></param>
+ /// <returns></returns>
+ public ResponsePackNew GetPropertyNoticeDetails(string noticeId)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("noticeId", noticeId);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_GetNoticeInfo, requestJson);
+ }
#endregion
#region 妫�娴嬫洿鏂�
@@ -1230,9 +1345,9 @@
#region 鑾峰彇澶╂皵閮ㄥ垎
/// <summary>
- /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅
+ /// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅澶╂皵淇℃伅
/// </summary>
- public void GetCityInfo(string lon, string lat)
+ public void GetCityWeatherInfo(string lon, string lat)
{
System.Threading.Tasks.Task.Run(() =>
{
@@ -1273,6 +1388,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)
@@ -1292,6 +1410,59 @@
});
});
}
+ ///// <summary>
+ ///// 鑾峰彇鎸囧畾缁忕含搴︾殑鍩庡競淇℃伅
+ ///// </summary>
+ ///// <param name="lon"></param>
+ ///// <param name="lat"></param>
+ //public void GetCityInfo()
+ //{
+ // if (DB_ResidenceData.Instance.CurrentRegion.longitude == 0 && DB_ResidenceData.Instance.CurrentRegion.latitude == 0)
+ // {
+ // return;
+ // }
+ // string lon = DB_ResidenceData.Instance.CurrentRegion.longitude.ToString();
+ // string lat = DB_ResidenceData.Instance.CurrentRegion.latitude.ToString();
+ // System.Threading.Tasks.Task.Run(() =>
+ // {
+ // while (true)
+ // {
+ // var webClient = new WebClient();
+ // string url = $"https://developer.hdlcontrol.com/Weather/Weather/FindCity/?lon={lon}&lat={lat}";
+ // string responseString = null;
+ // try
+ // {
+ // responseString = Encoding.UTF8.GetString(webClient.DownloadData(url));
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log(ex.Message);
+ // }
+
+ // if (responseString != null)
+ // {
+ // try
+ // {
+ // var revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(responseString);
+ // JObject jt = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(revertObj.ResponseData.ToString());
+
+ // DB_ResidenceData.cityInfo.location = jt.GetValue("Location").ToString();
+ // DB_ResidenceData.cityInfo.province = jt.GetValue("Province").ToString();
+ // DB_ResidenceData.cityInfo.country = jt.GetValue("Country").ToString();
+ // DB_ResidenceData.cityInfo.timeZone = jt.GetValue("TimeZone").ToString();
+ // DB_ResidenceData.Instance.SaveResidenceData();
+
+ // return;
+ // }
+ // catch (Exception ex)
+ // {
+ // MainPage.Log($"get weather error : {ex.Message}");
+ // }
+ // }
+ // }
+ // });
+ //}
+
#endregion
@@ -1342,11 +1513,11 @@
var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(d);
var revertObj = RequestHttps("https://developer.hdlcontrol.com/api/UserBackupList", requestJson, true);
var jt = Newtonsoft.Json.JsonConvert.DeserializeObject<List<JObject>>(revertObj.ResponseData.ToString());
- #region 鎭㈠鎴块棿鏁版嵁
+#region 鎭㈠鎴块棿鏁版嵁
GetBackupRoom(jt,loading);
- #endregion
+#endregion
Application.RunOnMainThread(() => {
loading.Hide();
@@ -1778,7 +1949,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,10 +1968,13 @@
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);
+ if (productBrand != "MegaHealth")
+ {
+ d.Add("networkConfig", true);
+ }
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson);
@@ -1811,18 +1985,39 @@
/// <param name="productPlatform"></param>
/// <param name="productBrand"></param>
/// <returns></returns>
- public ResponsePackNew Get3TyBrandDeviceList(string productPlatform,string productBrand)
+ public ResponsePackNew Get3TyBrandDeviceList(string productPlatform, string productBrand)
{
Dictionary<string, object> d = new Dictionary<string, object>();
d.Add("categoryType", 1);
d.Add("productPlatform", productPlatform);
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, string pairCode = "")
+ {
+ 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);
+ d.Add("code", pairCode);
+
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson);
+ }
+
+
+
/// <summary>
/// 鑾峰彇璁惧璇︽儏
@@ -1831,7 +2026,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 +2040,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 +2053,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,12 +2068,12 @@
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);
var requestJson = HttpUtil.GetSignRequestJson(d);
- MainPage.Log($"{requestJson}");
+ MainPage.Log($"api鍔熻兘鎺у埗锛歿requestJson}");
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson);
}
/// <summary>
@@ -1889,7 +2084,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 +2100,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);
@@ -1917,10 +2112,10 @@
/// <summary>
/// 璁惧缁戝畾鎴块棿
/// </summary>
- public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds)
+ 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 +2128,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 +2141,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,8 +2154,8 @@
public ResponsePackNew CollectDevice(string deviceId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID);
- d.Add("deviceIds",new List<string>() { deviceId });
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("deviceIds", new List<string>() { deviceId });
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectDevice, requestJson);
@@ -1971,7 +2166,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 +2185,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);
@@ -2007,7 +2202,7 @@
public ResponsePackNew GetSceneInfo(string seceneId)
{
Dictionary<string, object> d = new Dictionary<string, object>();
- d.Add("userSceneIds",new List<string>() { seceneId });
+ d.Add("userSceneIds", new List<string>() { seceneId });
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson);
@@ -2034,7 +2229,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 +2247,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 +2260,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 +2273,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 +2287,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 +2301,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 +2318,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);
@@ -2131,7 +2326,7 @@
d.Add("pageSize", "1000");
var requestJson = HttpUtil.GetSignRequestJson(d);
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetRoomList, requestJson);
-
+
return pack;
}
/// <summary>
@@ -2142,7 +2337,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 +2356,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 +2376,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 +2394,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 +2409,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 +2421,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 +2434,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 +2453,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 +2471,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,9 +2486,10 @@
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);
+ MainPage.Log($"api瀹夐槻鎺у埗锛歿requestJson}");
var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusSet, requestJson);
return pack;
}
@@ -2304,7 +2500,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 +2515,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);
@@ -2331,10 +2527,10 @@
/// <summary>
/// 鏌ヨ瀹夐槻鎵�鏈夎褰�
/// </summary>
- public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo)
+ 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 +2543,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 +2572,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,32 +2581,231 @@
#endregion
- #region 钀ょ煶浜慡DK鐩稿叧鎺ュ彛
+ #region 鈻� 钀ょ煶浜慡DK鐩稿叧鎺ュ彛_________________________
/// <summary>
/// 娌充笢鑾峰彇钀ょ煶浜戝瓙璐﹀彿token鐨勬帴鍙�
+ /// 2021-07-07 鏂版柟妗堟帴鍙h皟鏁村鎺�
/// </summary>
public ResponsePackNew EZGetChildToken()
{
Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("platform", "1");
var requestJson = HttpUtil.GetSignRequestJson(d);
return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson);
}
#endregion
- #region 鍙瀵硅
+ #region 鈻� 鍙瀵硅_________________________
/// <summary>
- /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋楋紝骞惰幏鍙栭棬鍙f満鍒楄〃
+ /// 妫�鏌ヤ綇瀹呮槸鍚︾粦瀹氫赴鏋�
/// </summary>
/// <returns></returns>
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);
+ var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson);
return pack;
}
#endregion
+
+ #region 鈻� 闂ㄩ攣鐩稿叧____________________________
+
+ /// <summary>
+ /// 鑾峰彇闂ㄩ攣鍘嗗彶璁板綍(鎸夋棩鏈熼檷搴�)
+ /// </summary>
+ /// <param name="i_device">璁惧瀵硅薄</param>
+ /// <returns></returns>
+ public List<Stan.DoorHistoryLog> GetDoorHistoryLogs(Function i_device)
+ {
+ //var dicPra = new Dictionary<string, object>();
+ //dicPra.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ //dicPra.Add("deviceId", i_device.deviceId);
+ //dicPra.Add("logType", "OPEN_DOOR");
+ //dicPra.Add("pageSize", "200");
+ //var requestJson = HttpUtil.GetSignRequestJson(dicPra);
+ //var packData = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_DoorHistory, requestJson);
+ //if (packData.Code != StateCode.SUCCESS)
+ //{
+ // return null;
+ //}
+
+
+ //娴嬭瘯
+ var listLog = new List<Stan.DoorHistoryLog>();
+ for (int i = 1; i <= 3; i++)
+ {
+ var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+ logInfo.Time = new DateTime(2000, 5, 6, 10, 45, 23).AddDays(i);
+ listLog.Add(logInfo);
+ }
+ for (int i = 1; i <= 3; i++)
+ {
+ var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+ logInfo.Time = new DateTime(2001, 5, 6, 10, 45, 23).AddDays(i);
+ listLog.Add(logInfo);
+ }
+ for (int i = 1; i <= 3; i++)
+ {
+ var logInfo = new Stan.DoorHistoryLog { StrMsg = "鐢甸噺浣庯紝璇锋洿鎹㈢數姹�" };
+ logInfo.Time = new DateTime(2002, 5, 6, 10, 45, 23).AddDays(i);
+ listLog.Add(logInfo);
+ }
+
+ //鎸夋椂闂撮檷搴�
+ var listSortLog = new List<Stan.DoorHistoryLog>();
+ foreach (var logInfo in listLog)
+ {
+ bool canAdd = true;
+ for (int i = 0; i < listSortLog.Count; i++)
+ {
+ if (logInfo.Time > listSortLog[i].Time)
+ {
+ //鏃堕棿姣斿綋鍓嶇殑绱㈠紩澶�,鍒欐彃鍏ュ埌瀹冪殑鍓嶉潰
+ listSortLog.Insert(i, logInfo);
+ canAdd = false;
+ break;
+ }
+ }
+ if (canAdd == true)
+ {
+ //鏃ユ湡鏈�灏�,鍒欐坊鍔犲埌鏈熬
+ listSortLog.Add(logInfo);
+ }
+ }
+ //鎻愮ず
+ //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code);
+ return listSortLog;
+ }
+
+ #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
+
+ /// <summary>
+ /// 缁戝畾source闈㈡澘
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew BindSourcePanel(string qrString)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("content", qrString);
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_BindSourcePanel, requestJson);
+ }
+
+ /// <summary>
+ /// 浜鸿劯褰曞叆
+ /// </summary>
+ /// <param name="imageBytes"></param>
+ /// <returns></returns>
+ public ResponsePackNew FaceSetting(string imageBytes)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("userFace", @"data:image/jpg;base64," + imageBytes);
+ d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
+
+ //MainPage.Log(imageBytes);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_InputUserFace, requestJson);
+ }
+
+
+ /// <summary>
+ /// 淇敼浣忔埛浜鸿劯鍏抽棴鐘舵��
+ /// 1锛氬紑鍚姸鎬� 2锛氬叧闂姸鎬�
+ /// 3:娓呴櫎浜鸿劯鏁版嵁
+ /// </summary>
+ public ResponsePackNew EditFaceFunction(int status)
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
+ d.Add("faceClose", status);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_SwitchFaceFunction, requestJson);
+ }
+
+
+ /// <summary>
+ /// 鑾峰彇浣忔埛璇︽儏
+ /// </summary>
+ /// <returns></returns>
+ public ResponsePackNew GetCustomerInfo()
+ {
+ Dictionary<string, object> d = new Dictionary<string, object>();
+ d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id);
+
+ var requestJson = HttpUtil.GetSignRequestJson(d);
+ return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson);
+ }
}
}
\ No newline at end of file
--
Gitblit v1.8.0