| | |
| | | /// <param name="deviceId">设备ID</param> |
| | | /// <param name="deviceKey">功能查询类型:pm25</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetSensorHistory(string qType, string deviceId,string deviceKey) |
| | | public ResponsePackNew GetSensorHistory(string qType, string deviceId, string deviceKey) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("type", qType); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", deviceId ); |
| | | d.Add("key", deviceKey ); |
| | | d.Add("deviceId", deviceId); |
| | | d.Add("key", deviceKey); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.Api_Post_EnvironmentalSensorHistoricalData, requestJson); |
| | |
| | | /// <param name="pageSize">页面大小</param> |
| | | /// <param name="pageNo">页号</param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetArmSensorHistory( string deviceId,string pageSize, string pageNo) |
| | | public ResponsePackNew GetArmSensorHistory(string deviceId, string pageSize, string pageNo) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | /// 读取最近一个月的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetLastMonthHistory(string deviceId,string key) |
| | | public ResponsePackNew GetLastMonthHistory(string deviceId, string key) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | UserInfo.Current.RefreshToken = revertData.refreshToken; |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.AccessToken = UserInfo.Current.LoginTokenString; |
| | | sdm.RefreshToken = UserInfo.Current.RefreshToken; |
| | | #endif |
| | | } |
| | | return revertObj.Code; |
| | | } |
| | |
| | | account = account, |
| | | loginPwd = password |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson); |
| | | var pack = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.IsLgoin = true; |
| | | #endif |
| | | } |
| | | } |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | verifyCode = vCode, |
| | | grantType = "verify" |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson); |
| | | var pack = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson); |
| | | if (pack != null) |
| | | { |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.IsLgoin = true; |
| | | #endif |
| | | } |
| | | } |
| | | return pack; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew ValidataCodeAndRegister(string account, string password, string code, bool isPhone = false) |
| | | { |
| | | var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code};//, memberName = account |
| | | var requestObj = new RegisterObj() { loginPwd = password, verifyCode = code };//, memberName = account |
| | | if (isPhone) |
| | | { |
| | | requestObj.memberPhone = account; |
| | |
| | | UserInfo.Current.userEmailInfo = info.memberEmail; |
| | | UserInfo.Current.userMobileInfo = info.memberPhone; |
| | | UserInfo.Current.userName = info.memberName; |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(info.memberPhonePrefix)) |
| | | { |
| | | UserInfo.Current.areaCode = info.memberPhonePrefix; |
| | |
| | | /// <summary> |
| | | /// 获取住宅列表 |
| | | /// </summary> |
| | | public string GetHomePager(HomeTypeEnum homeType = HomeTypeEnum.ALL,string homeId = "") |
| | | 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(UserInfo.Current.regionList.Count== 0) |
| | | if (UserInfo.Current.regionList.Count == 0) |
| | | { |
| | | return "null"; |
| | | } |
| | |
| | | GetHomeGatewayList(); |
| | | } |
| | | } |
| | | |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | #endif |
| | | } |
| | | } |
| | | |
| | |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_GetGatewayList, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | #if __IOS__ |
| | | //刷新siri要用的数据 |
| | | new Other.SkipControl().SetData(true, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, DB_ResidenceData.Instance.CurrentRegion.regionUrl); |
| | | #endif |
| | | var mHomeGatewayRes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<HomeGatewayInfo>>(revertObj.Data.ToString()); |
| | | if (nowhomeId == DB_ResidenceData.Instance.CurrentRegion.id) |
| | | { |
| | |
| | | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_Share_GetList, requestJson); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | ///// <summary> |
| | |
| | | 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 jsonString = HttpUtil.GetSignRequestJson(d, d); |
| | | var pack = HttpUtil.RequestHttpsPost(NewAPI.API_Post_Home_UpdateDebugPerm, jsonString); |
| | | return pack; |
| | | } |
| | |
| | | isProduce = false; |
| | | #endif |
| | | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) |
| | | { |
| | | Utlis.WriteLine("PushDeviceToken 为空"); |
| | | return false; |
| | | } |
| | |
| | | deviceName = OnAppConfig.Instance.PhoneName, |
| | | deviceType = deviceType, |
| | | produce = isProduce, |
| | | |
| | | |
| | | }; |
| | | mAddpushinfoObj.languageType = Utlis.GetPostLanguageType(); |
| | | |
| | |
| | | OnAppConfig.Instance.PushId = pushId; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | Utlis.WriteLine("PushId: " + pushId); |
| | | |
| | | |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | try |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | | |
| | | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_DeleteToken, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 获取天气部分 |
| | | #region 获取天气部分 |
| | | /// <summary> |
| | | /// 获取指定经纬度的城市信息天气信息 |
| | | /// </summary> |
| | |
| | | //} |
| | | |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region 备份部分 |
| | | #region 备份部分 |
| | | ///// <summary> |
| | | ///// 获取住宅备份列表 |
| | | ///// </summary> |
| | |
| | | } |
| | | */ |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | #region Kaede --设备功能—————————————————————————————————— |
| | | /// <summary> |
| | | /// 获取设备列表 |
| | | /// </summary> |
| | |
| | | /// <param name="productPlatform"></param> |
| | | /// <param name="productBrand"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew Get3TyBrandDeviceList(string productPlatform,string productBrand) |
| | | public ResponsePackNew Get3TyBrandDeviceList(string productPlatform, string productBrand) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("categoryType", 1); |
| | | d.Add("productPlatform", productPlatform); |
| | | d.Add("productBrand", productBrand); |
| | | d.Add("networkConfig", true); |
| | | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_Get3tyBrandDevcieList, requestJson); |
| | | } |
| | |
| | | /// <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 pairCode = "") |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | /// <summary> |
| | | /// 设备绑定房间 |
| | | /// </summary> |
| | | public ResponsePackNew BindDeviceToRoom(List<string> deviceIds,List<string> roomIds) |
| | | public ResponsePackNew BindDeviceToRoom(List<string> deviceIds, List<string> roomIds) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds",new List<string>() { deviceId }); |
| | | d.Add("deviceIds", new List<string>() { deviceId }); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectDevice, requestJson); |
| | |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectDevice, requestJson); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region Kaede --场景功能-------------------------- |
| | | #region Kaede --场景功能-------------------------- |
| | | /// <summary> |
| | | /// 获取场景列表 |
| | | /// 房间ID可空,默认查询住宅下所有房间 |
| | |
| | | public ResponsePackNew GetSceneInfo(string seceneId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("userSceneIds",new List<string>() { seceneId }); |
| | | d.Add("userSceneIds", new List<string>() { seceneId }); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetSecneInfo, requestJson); |
| | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectScene, requestJson).Code; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region Kaede --房间功能-------------------------- |
| | | #region Kaede --房间功能-------------------------- |
| | | /// <summary> |
| | | /// 获取房间列表 |
| | | /// </summary> |
| | |
| | | d.Add("pageSize", "1000"); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetRoomList, requestJson); |
| | | |
| | | |
| | | return pack; |
| | | } |
| | | /// <summary> |
| | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede -- 安防接口____________________________ |
| | | #region Kaede -- 安防接口____________________________ |
| | | /// <summary> |
| | | /// 获取安防列表 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 查询安防所有记录 |
| | | /// </summary> |
| | | public ResponsePackNew GetSecurityLogList(string pageSize,string pageNo) |
| | | public ResponsePackNew GetSecurityLogList(string pageSize, string pageNo) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede --第三方品牌功能-------------------------- |
| | | #region Kaede --第三方品牌功能-------------------------- |
| | | /// <summary> |
| | | /// 获取第三方品牌列表 |
| | | /// </summary> |
| | |
| | | return pack; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region ■ 萤石云SDK相关接口_________________________ |
| | | #region ■ 萤石云SDK相关接口_________________________ |
| | | /// <summary> |
| | | /// 河东获取萤石云子账号token的接口 |
| | | /// 2021-07-07 新方案接口调整对接 |
| | |
| | | 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_FL_Check, requestJson); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Check, requestJson); |
| | | return pack; |
| | | } |
| | | #endregion |
| | |
| | | public ResponsePackNew FaceSetting(string imageBytes) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("userFace", @"data:image/jpg;base64,"+imageBytes); |
| | | d.Add("userFace", @"data:image/jpg;base64," + imageBytes); |
| | | d.Add("houseId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | | //MainPage.Log(imageBytes); |