| | |
| | | var homeList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<RegionInfoRes>>(resultObj.Data.ToString()); |
| | | if (homeList == null || homeList.Count == 0) |
| | | { |
| | | if (DB_ResidenceData.Instance.CurrentRegion!=null && DB_ResidenceData.Instance.CurrentRegion.id != "") |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoUserPage(false); |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | if (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoUserPage(false); |
| | | }); |
| | | return "null"; |
| | | } |
| | | //-------如果账号是首次登录 |
| | |
| | | { |
| | | var requestObj = new ChildDeleteObj() |
| | | { |
| | | childAccountId = subaccount.childAccountId, |
| | | childId = subaccount.id, |
| | | homeId = subaccount.homeId |
| | | }; |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditSubAccountNickName(string nickName, string childAccountId) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildNickNameObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | childAccountId = childAccountId, |
| | | nickName = nickName, |
| | | }); |
| | | var d = new Dictionary<string, string>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childAccountId); |
| | | d.Add("nickName", nickName); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); |
| | | |
| | | } |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new UpdateChildAllowCreateSceneObj() |
| | | { |
| | | homeId = DB_ResidenceData.Instance.CurrentRegion.id, |
| | | childAccountId = childAccountId, |
| | | childId = childAccountId, |
| | | isAllowCreateScene = isAllow, |
| | | }); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Update, requestJson); |
| | |
| | | public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName) |
| | | { |
| | | //添加子账号 |
| | | var requestObj = new ChildAddObj() { homeId = DB_ResidenceData.Instance.CurrentRegion.id, 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); |
| | | } |
| | | //v1.7更新接口 |
| | | public ResponsePackNew BindResidenceMemberAccount(string subAccount, string nickName,string faceUrl) |
| | | { |
| | | //添加子账号 |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("nickName", nickName); |
| | | if (!string.IsNullOrEmpty(subAccount)) |
| | | { |
| | | d.Add("account", subAccount); |
| | | } |
| | | if (!string.IsNullOrEmpty(faceUrl)) |
| | | { |
| | | d.Add("faceUrl", @"data:image/jpg;base64," + faceUrl); |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_Add, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 删除成员账号人脸数据 |
| | | /// </summary> |
| | | /// <param name="subAccount"></param> |
| | | /// <param name="nickName"></param> |
| | | /// <param name="faceUrl"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeleteMemberFace( string childId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_RemoveFace, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 更新成员账号人脸数据 |
| | | /// </summary> |
| | | public ResponsePackNew UpdataMemberFace(string childId, string faceUrl) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childId); |
| | | d.Add("userFace", @"data:image/jpg;base64," + faceUrl); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_UpdateFace, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //} |
| | | |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region 备份部分 |
| | | #region 备份部分 |
| | | ///// <summary> |
| | | ///// 获取住宅备份列表 |
| | | ///// </summary> |
| | |
| | | } |
| | | */ |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | /// <summary> |
| | | /// 获取乐橙子账号token |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetLcSubAccountToken() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetLcSubToken, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 获取设备列表 |
| | | /// </summary> |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("productPlatform", productPlatform); |
| | | d.Add("productBrand", productBrand); |
| | | if (productBrand != "MegaHealth") |
| | | if (productBrand == "MegaHealth" || productBrand == "IMOU") |
| | | { |
| | | } |
| | | else { |
| | | d.Add("networkConfig", true); |
| | | } |
| | | |
| | |
| | | /// <param name="productPlatform"></param> |
| | | /// <param name="productBrand"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName, string pairCode = "") |
| | | public ResponsePackNew IndependentRegister3TyDevcie(string spk, string extDevId, string deviceName,string productBrandIdentity, string pairCode = "") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | d.Add("extDevId", extDevId); |
| | | d.Add("name", deviceName); |
| | | d.Add("code", pairCode); |
| | | d.Add("productBrandIdentity", productBrandIdentity); |
| | | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_IndependentRegister3TyDevcie, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除第三方设备 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Delete3tyDevice(string deviceId) |
| | | { |
| | | |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var responsePackNew = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Remove3tyDevcie, requestJson); |
| | | return responsePackNew; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | d.Add("name", function.name); |
| | | d.Add("collect", function.collect); |
| | | d.Add("roomIds", function.roomIds); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// 绑定关系、名称、收藏 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdataDevcieName(Function function,string name) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", function.deviceId); |
| | | d.Add("name", name); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_EditDevice, requestJson); |
| | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | /// <summary> |
| | | /// 获取第三方注册的id |
| | | /// </summary> |
| | | /// <param homeId="homeId">住宅id</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetExtUserId(string homeId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", homeId); |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | | |
| | | /// <summary> |
| | | /// 获取门锁历史记录(按日期降序) |
| | |
| | | |
| | | |
| | | |
| | | #region 光伏储能 |
| | | #region 光伏储能 |
| | | /// <summary> |
| | | /// 获取住宅下逆变器列表 |
| | | /// </summary> |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetInverter_StatisticsInfo, requestJson); |
| | | return pack; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region 群控,组合调光 |
| | | /// <summary> |
| | | /// 获取群控类型 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetGroupControlTypes(string spk) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("spk", spk); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlTypes, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetGroupControlList() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew AddGroupControl(List<GroupControl> groupControls) |
| | | { |
| | | 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("infos", groupControls); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |