| | |
| | | /// <param name="qType">时间查询类型:hour=近24小时、week=近一周、month = 近一月 </param> |
| | | /// <param name="deviceId">设备ID</param> |
| | | /// <param name="deviceKey">功能查询类型:pm25</param> |
| | | /// <param name="time">具体查询的日期,金茂温控器使用</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey) |
| | | public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey, string time = "") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("type", qType); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("key", deviceKey); |
| | | if (time != "") |
| | | { |
| | | d.Add("time", time); |
| | | } |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson); |
| | |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString()); |
| | | UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; |
| | | UserInfo.Current.AccessToken = revertData.accessToken; |
| | | UserInfo.Current.RefreshToken = revertData.refreshToken; |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.SaveUserInfo(); |
| | |
| | | sdm.AccessToken = UserInfo.Current.LoginTokenString; |
| | | sdm.RefreshToken = UserInfo.Current.RefreshToken; |
| | | #endif |
| | | } |
| | | else if (revertObj.Code == StateCode.PasswrodError) |
| | | { |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | } |
| | | return revertObj.Code; |
| | | } |
| | |
| | | } |
| | | |
| | | #region 注册、登录部分 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 通用 发送验证码方法 |
| | | /// </summary> |
| | |
| | | } |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Member_ForgetPwd, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 修改密码 |
| | | /// </summary> |
| | | /// <param name="loginPwd"></param> |
| | | /// <param name="loginNewPwd"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew UpdataPassword(string loginPwd,string loginNewPwd) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("loginPwd", loginPwd); |
| | | d.Add("loginNewPwd", loginNewPwd); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Update_Pwd, requestJson); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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 |
| | | { |
| | | foreach (var home in homeList) |
| | | { |
| | | if (home.isBindGateway) |
| | | if (home.isBindGateway)//是否绑定网关 |
| | | { |
| | | UserInfo.Current.regionList.Add(home); |
| | | //新绑定的住宅,直接切换到新住宅 |
| | |
| | | } |
| | | if (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoUserPage(false); |
| | | }); |
| | | return "null"; |
| | | } |
| | | //-------如果账号是首次登录 |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 获取住宅交付链接 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetHouseDeliveryUrl() |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var jsonString = HttpUtil.GetSignRequestJson(d); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_GetHoserDeliverUrl, jsonString); |
| | | return revertObj; |
| | | } |
| | | /// <summary> |
| | | /// 住宅交付回滚 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew RollBack() |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("communityId", DB_ResidenceData.Instance.CurrentRegion.communityId); |
| | | d.Add("flowRecordContent", "onPro交付回滚"); |
| | | d.Add("projectFlowRecordActionEnum", "DELIVERY_ROLLBACK"); |
| | | var jsonString = HttpUtil.GetSignRequestJson(d); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.APi_Post_UpdateProjectDebugStatus, jsonString); |
| | | return revertObj; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取网关信息 |
| | | /// </summary> |
| | | public string GetGatewayInfo() |
| | |
| | | { |
| | | 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> |
| | | /// 家庭成员绑定账号 |
| | | /// </summary> |
| | | /// <param name="childId"></param> |
| | | /// <param name="faceUrl"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew SubChildBindAccount(string childId, string account) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("childId", childId); |
| | | d.Add("account", account); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Child_BindAccount, requestJson); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改住宅调试权限 |
| | |
| | | #endif |
| | | //是否生产模式 |
| | | bool isProduce = true; |
| | | #if DEBUG |
| | | isProduce = false; |
| | | #endif |
| | | |
| | | if (HttpUtil.GlobalRequestHttpsHost == "https://test-gz.hdlcontrol.com") |
| | | { |
| | | isProduce = false; |
| | | } |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) |
| | | { |
| | | Utlis.WriteLine("PushDeviceToken 为空"); |
| | |
| | | { |
| | | var requestObj = new AppVersionCheckObj() |
| | | { |
| | | |
| | | |
| | | }; |
| | | #if __IOS__ |
| | | requestObj.releaseSystem = "IOS"; |
| | | #else |
| | | requestObj.releaseSystem = "Android"; |
| | | #endif |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(requestObj); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_CheckAppVersion, requestJson); |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 注销账号 |
| | | /// <summary> |
| | | /// 获取当前版本注销账号模式 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetUnregisterModel() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("version", MainPage.VersionString); |
| | | d.Add("appCode", "1588071238036582401"); |
| | | #if __IOS__ |
| | | d.Add("releaseSystem", "IOS"); |
| | | #else |
| | | d.Add("releaseSystem", "Android"); |
| | | #endif |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_GetUnregisterModel, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 注销账号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Unregister(string pwd) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("userId", UserInfo.Current.ID); |
| | | d.Add("pwd", pwd); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_Unregister, requestJson); |
| | | } |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息天气信息 |
| | | /// </summary> |
| | | public void GetCityWeatherInfo(string lon, string lat) |
| | | { |
| | | if (lon == "0" || lat == "0") |
| | | return; |
| | | MainPage.cityInfo.lon = lon; |
| | | MainPage.cityInfo.lat = lat; |
| | | |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | while (true) |
| | |
| | | MainPage.cityInfo.weather = jt.GetValue("Weather").ToString(); |
| | | MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString(); |
| | | MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString(); |
| | | |
| | | MainPage.CityWeatherAction?.Invoke(); |
| | | HDL_ON.UI.HomePage.LoadEvent_RefreshAir(); |
| | | break; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | MainPage.Log($"get weather error : {ex.Message}"); |
| | | } |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | System.Threading.Thread.Sleep(5000); |
| | | } |
| | | Shared.Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | HDL_ON.UI.HomePage.LoadEvent_RefreshAir(); |
| | | } |
| | | catch { } |
| | | }); |
| | | }); |
| | | } |
| | | ///// <summary> |
| | |
| | | |
| | | #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> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDeviceList() |
| | | public ResponsePackNew GetDeviceList(string pageSize = "", string pageNo = "") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | 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); |
| | | //d.Add("pageSize", DB_ResidenceData.residenceData.residecenInfo.RegionID); |
| | | //d.Add("pageNo", DB_ResidenceData.residenceData.residecenInfo.RegionID); |
| | | if (!string.IsNullOrEmpty(pageSize)) |
| | | { |
| | | d.Add("pageSize", pageSize); |
| | | d.Add("pageNo", pageNo); |
| | | } |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson); |
| | |
| | | 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); |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设备扩展配置 |
| | | /// </summary> |
| | | public ResponsePackNew DeviceExtSet(string deviceId,ExtSet extSet) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId ); |
| | | d.Add("extSet", extSet); |
| | | |
| | | #endregion |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceExtSet, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 获取设备消息规则配置 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDeviceMessageRulesSet(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); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDeviceMessageRulesSet, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 设备消息规则配置 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <param name="conditionIdentify"></param> |
| | | /// <param name="push"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DeviceMessageRulesSet(string deviceId,string conditionIdentify,bool push) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("conditionIdentify", conditionIdentify); |
| | | d.Add("push", push); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeviceMessageRulesSet, requestJson); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region Kaede --场景功能-------------------------- |
| | | /// <summary> |
| | |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取第三方品牌列表_Iot |
| | | /// </summary> |
| | | public ResponsePackNew Get3tyIotBrandList() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetBrandList_Iot, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 搜索第三方设备_iot |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Search3tyIotDevice(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Search3tyIotDevice, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 搜索第三方设备功能列表_iot |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3tyIotDeviceFunctionList(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取第三方平台支持的设备类型列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3tyIotSupportSpkList(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyIotFunction, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置第三方设备绑定的住宅 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Set3tyIotFunctionToHouse(List<string> deviceIds,string homeId, string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("deviceIds", deviceIds); |
| | | d.Add("homeId", homeId); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Setting3tyIotFunctionToHouse, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解绑第三方平台账号 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Unbound3tyIotAccount(string companyId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("companyId", companyId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Unbound3tyIotAccount, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取绑定的第三方品牌列表 |
| | | /// </summary> |
| | |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取门口机徘徊报警数据 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetAlarmRecords(string deviceId, int pageSize, int pageNo, string alarmType = "PROWLER_ALARM") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("alarmType", alarmType); |
| | | d.Add("pageSize", pageSize); |
| | | d.Add("pageNo", pageNo); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_ALARM_RECORDS, requestJson); |
| | | return pack; |
| | | |
| | | } |
| | | |
| | | /// <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); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetExtUserId, requestJson); |
| | | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 门锁相关____________________________ |
| | |
| | | //IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); |
| | | return listSortLog; |
| | | } |
| | | /// <summary> |
| | | /// 获取门锁临时密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetDoorTempPassword(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); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetTempPasswrod, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 创建门锁临时密码 |
| | | /// </summary> |
| | | /// <param name="deviceId"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew CreateDoorTempPassword(string deviceId,string beginTime,string endTime) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("beginTime", beginTime); |
| | | d.Add("endTime", endTime); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CreateTempPasswrod, requestJson); |
| | | } |
| | | /// <summary> |
| | | /// 删除门锁临时密码 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew DelDoorTempPassword(string deviceId, string pwdId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("pwdId", pwdId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DelTempPasswrod, requestJson); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 音箱语言控制相关_________________________ |
| | | /// <summary> |
| | | /// 获取已授权的音箱列表 |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetCustomerInfo, requestJson); |
| | | } |
| | | |
| | | |
| | | #region 光伏储能 |
| | | /// <summary> |
| | | /// 获取住宅下逆变器列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetInverterList() |
| | | { |
| | | 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_GetInverter_List, requestJson); |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | | /// 获取住宅下光伏统计的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetInverterStatisticsInfo() |
| | | { |
| | | 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_GetInverter_StatisticsInfo, requestJson); |
| | | return pack; |
| | | } |
| | | #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> |
| | | public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | var ids = new List<string>() |
| | | { |
| | | userDeviceGroupControlIds, |
| | | }; |
| | | d.Add("userDeviceGroupControlIds", ids); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取群控详情 |
| | | /// </summary> |
| | | public ResponsePackNew GetGroupControInfo(List<string> ids) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", ids); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | 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_AddGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 添加群控列表 |
| | | /// </summary> |
| | | public ResponsePackNew DelGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 编辑群控列表 |
| | | /// </summary> |
| | | /// <param name="spk"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew EditGroupControl(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_UpdateGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 群控控制 |
| | | /// </summary> |
| | | public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair) |
| | | { |
| | | var d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlId", userDeviceGroupControlId); |
| | | List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>(); |
| | | dd.Add(pair); |
| | | d.Add("status",dd); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 收藏群控 |
| | | /// </summary> |
| | | public ResponsePackNew CollectGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 取消收藏群控 |
| | | /// </summary> |
| | | public ResponsePackNew CancelCollectGroupControl(string groupControlId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId }); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |