| | |
| | | { |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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 |
| | |
| | | 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) |
| | |
| | | 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]; |
| | |
| | | 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(() => |
| | |
| | | { |
| | | var requestObj = new AddOrUpdateHomeObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | }; |
| | | |
| | | if (editId == 0) |
| | |
| | | } |
| | | else if (editId == 1) |
| | | { |
| | | requestObj.Address = editName; |
| | | requestObj.homeAddress = editName; |
| | | } |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | |
| | | { |
| | | 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) |
| | | { |
| | |
| | | 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); |
| | |
| | | /// <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); |
| | | } |
| | | |
| | |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | childAccountId = childAccountId, |
| | | nickName = nickName, |
| | | }); |
| | |
| | | { |
| | | 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 新数据分享 |
| | |
| | | { |
| | | 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> |
| | |
| | | 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> |
| | |
| | | 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); |
| | |
| | | /// <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) |
| | | { |
| | |
| | | { |
| | | 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> |
| | |
| | | /// </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) |
| | |
| | | { 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 检测更新 |
| | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息 |
| | | /// </summary> |
| | |
| | | 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) |
| | |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region 备份部分 |
| | | #region 备份部分 |
| | | ///// <summary> |
| | | ///// 获取住宅备份列表 |
| | | ///// </summary> |
| | |
| | | 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(); |
| | |
| | | } |
| | | */ |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | /// <summary> |
| | | /// 获取设备列表 |
| | | /// </summary> |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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> |
| | | /// 获取设备详情 |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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($"api功能控制:{requestJson}"); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlDevice, requestJson); |
| | | } |
| | | /// <summary> |
| | |
| | | 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); |
| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | 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 }); |
| | | |
| | |
| | | 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); |
| | | |
| | |
| | | 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); |
| | |
| | | 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); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region Kaede --场景功能-------------------------- |
| | | #region Kaede --场景功能-------------------------- |
| | | /// <summary> |
| | | /// 获取场景列表 |
| | | /// 房间ID可空,默认查询住宅下所有房间 |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region Kaede --房间功能-------------------------- |
| | | #region Kaede --房间功能-------------------------- |
| | | /// <summary> |
| | | /// 获取房间列表 |
| | | /// </summary> |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | 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); |
| | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --房间功能-------------------------- |
| | | #region Kaede -- 安防接口____________________________ |
| | | /// <summary> |
| | | /// 获取安防列表 |
| | | /// </summary> |
| | | public ResponsePackNew GetSecurityList() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | 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); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取安防详情 |
| | | /// </summary> |
| | | /// <param name="sidList">安防sid集合</param> |
| | | /// <param name="userSecurityIds">安防云端id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSecurityInfo(List<string> sidList, List<string> userSecurityIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | //sids userSecurityIds 不能同时为空 |
| | | d.Add("sids", sidList); |
| | | d.Add("userSecurityIds", userSecurityIds); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Info, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | public ResponsePackNew AddSecurity(List<SecurityAlarm> securities) |
| | | { |
| | | 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("securitys", securities); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Add, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 编辑安防 |
| | | /// </summary> |
| | | public ResponsePackNew EditSecurity(List<SecurityAlarm> securities) |
| | | { |
| | | 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("securitys", securities); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Edit, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 删除安防 |
| | | /// </summary> |
| | | /// <param name="sidList">安防sid</param> |
| | | /// <param name="userSecurityIds">安防云端id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteSecurity(List<string> sidList, List<string> userSecurityIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | //sids userSecurityIds 不能同时为空 |
| | | d.Add("sids", sidList); |
| | | d.Add("userSecurityIds", userSecurityIds); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_Delete, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 读取安防防区状态 |
| | | /// </summary> |
| | | /// <param name="sidList">安防sid</param> |
| | | /// <param name="userSecurityIds">安防云端id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew ReadSecurityStatus(List<string> sidList, List<string> userSecurityIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | //sids userSecurityIds 不能同时为空 |
| | | d.Add("sids", sidList); |
| | | d.Add("userSecurityIds", userSecurityIds); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_StatusRead, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 设置安防防区状态 |
| | | /// </summary> |
| | | public ResponsePackNew SetSecurityStatus(List<SecurityState> securityStates) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | 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; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防bypass设置 |
| | | /// </summary> |
| | | public ResponsePackNew SetSecurityBypass(List<SecurityBypass> securityBypassStates) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | 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); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 安防bypass读取 |
| | | /// </summary> |
| | | /// <param name="sidList">安防sid</param> |
| | | /// <param name="userSecurityIds">安防云端id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew ReadSecurityBypass(List<string> sidList, List<string> userSecurityIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | //sids userSecurityIds 不能同时为空 |
| | | d.Add("sids", sidList); |
| | | d.Add("userSecurityIds", userSecurityIds); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_BypassRead, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 查询安防所有记录 |
| | | /// </summary> |
| | | public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("pageSize", pageSize); |
| | | d.Add("pageNo", pageNo); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListSecurityLog, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 查询安防报警记录 |
| | | /// </summary> |
| | | public ResponsePackNew GetSecurityAlarmLogList(string pageSize, string pageNo) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("pageSize", pageSize); |
| | | d.Add("pageNo", pageNo); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Security_ListAlarmLog, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --第三方品牌功能-------------------------- |
| | | /// <summary> |
| | | /// 获取第三方品牌列表 |
| | | /// </summary> |
| | |
| | | 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); |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region ■ 萤石云SDK相关接口_________________________ |
| | | #region ■ 萤石云SDK相关接口_________________________ |
| | | /// <summary> |
| | | /// 河东获取萤石云子账号token的接口 |
| | | /// 2021-07-07 新方案接口调整对接 |
| | | /// </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 |
| | | #endregion |
| | | |
| | | |
| | | #region ■ 可视对讲_________________________ |
| | | #region ■ 可视对讲_________________________ |
| | | /// <summary> |
| | | /// 检查住宅是否绑定丰林,并获取门口机列表 |
| | | /// 检查住宅是否绑定丰林 |
| | | /// </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); |
| | | return pack; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region ■ 音箱语言控制相关_________________________ |
| | | #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> |
| | |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetSpeakerObj |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.RegionID, |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_List_Get, requestJson); |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解除音箱绑定 |
| | | /// </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> |
| | |
| | | public ResponsePackNew GetSpeakerDeviceList(int getType, string tokenId) |
| | | { |
| | | 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("tokenId", tokenId); |
| | | if (getType > 0) |
| | | { |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(updateSpeakerDeviceListObj); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Speaker_DeviceList_Update, requestJson); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | /// <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); |
| | | } |
| | | } |
| | | } |