| | |
| | | /// <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); |
| | |
| | | { |
| | | 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 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 新数据分享 |
| | | /// <summary> |
| | | /// 添加分享 |
| | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("debugPerm", debugPerm); |
| | | string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString); |
| | | var jsonString = HttpUtil.GetSignRequestJson(d,d); |
| | | var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | |
| | | 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); |
| | | } |
| | |
| | | #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); |
| | | } |
| | |
| | | |
| | | #region ■ 可视对讲_________________________ |
| | | /// <summary> |
| | | /// 检查住宅是否绑定丰林,并获取门口机列表 |
| | | /// 检查住宅是否绑定丰林 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew CheckFlVideo() |