| | |
| | | <MonoDevelop.MacDev.AppleDevelopmentTeam /> |
| | | </MonoDevelop.Ide.ItemProperties.SiriIntentUI> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="SiriKit/SiriScene.cs"> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/PushConfigPage.cs"> |
| | | <Files> |
| | | <File FileName="SiriKit/HDLRunSceneIntentHandlder.cs" Line="13" Column="29" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" /> |
| | | <File FileName="HDL_ON/Entity/Function/SecurityAlarm.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" /> |
| | | <File FileName="SiriKit/Data/SceneDateManager.cs" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" /> |
| | | <File FileName="SiriKit/Support/NSUserActivityHelper.cs" Line="11" Column="13" /> |
| | | <File FileName="SiriKit/SiriScene.cs" Line="8" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" Line="9" Column="40" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/Logic.cs" Line="51" Column="35" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs" Line="112" Column="75" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="282" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" Line="593" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" Line="192" Column="15" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/InputPushText.cs" Line="83" Column="24" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/PushConfigPage.cs" Line="85" Column="66" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="458" Column="45" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs" Line="213" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmDeploymentSettingPage.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddInputPage.cs" Line="465" Column="12" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs" Line="433" Column="17" /> |
| | | <File FileName="HDL_ON/Entity/Function/SecurityAlarm.cs" Line="138" Column="29" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True"> |
| | | <Node name="Utlis" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI0-Public" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True" /> |
| | | <Node name="Scene" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True"> |
| | | <Node name="PushConfigPage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Assets" expanded="True" /> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Resources" expanded="True" /> |
| | | </Node> |
| | | <Node name="SiriIntents" expanded="True" /> |
| | | <Node name="SiriIntentsUI" expanded="True"> |
| | | <Node name="IntentViewController.cs" expanded="True" /> |
| | | </Node> |
| | | <Node name="SiriKit" expanded="True"> |
| | | <Node name="SiriScene.cs" selected="True" /> |
| | | <Node name="Base.lproj" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="28" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HdlSiriKit/SkipControl.cs" relfile="HdlSiriKit/SkipControl.cs" line="14" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" line="366" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 512=Message push is not enabled, please go to settings. |
| | | 513=Please enter the pairing code |
| | | 514=Gateway location information is not configured |
| | | 515=Add Security |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 512=消息推送未开启,请前往设置。 |
| | | 513=请输入配对码 |
| | | 514=未配置网关位置信息 |
| | | |
| | | 515=添加安防 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | using HDL_ON.UI; |
| | | using HDL_ON.DAL.Server; |
| | | using Intents; |
| | | using Other.Siri; |
| | | |
| | | namespace SharedMethod |
| | | { |
| | |
| | | HDL_ON.DriverLayer.Control.Ins.SearchLoaclGateway(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler) |
| | | { |
| | | var intent = userActivity.GetInteraction()?.Intent as HDLSceneSiri.HDLRunSceneIntent; |
| | | if (!(intent is null)) |
| | | { |
| | | HandleIntent(intent); |
| | | return true; |
| | | } |
| | | else if (userActivity.ActivityType == NSUserActivityHelper.ViewMenuActivityType) |
| | | { |
| | | HandleUserActivity(); |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | void HandleIntent(HDLSceneSiri.HDLRunSceneIntent intent) |
| | | { |
| | | var handler = new SiriKit.HDLRunSceneIntentHandlder(); |
| | | handler.HandleRunScene(intent, (response) => { |
| | | if (response.Code != HDLSceneSiri.HDLRunSceneIntentResponseCode.Success) |
| | | { |
| | | Console.WriteLine("Siri执行失败。"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void HandleUserActivity() |
| | | { |
| | | //var rootViewController = Window?.RootViewController as UINavigationController; |
| | | //var orderHistoryViewController = rootViewController?.ViewControllers?.FirstOrDefault() as OrderHistoryTableViewController; |
| | | //if (orderHistoryViewController is null) |
| | | //{ |
| | | // Console.WriteLine("Failed to access OrderHistoryTableViewController."); |
| | | // return; |
| | | //} |
| | | //var segue = OrderHistoryTableViewController.SegueIdentifiers.SoupMenu; |
| | | //orderHistoryViewController.PerformSegue(segue, null); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | <MtouchLink>SdkOnly</MtouchLink> |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignProvision>OnPro211116-1</CodesignProvision> |
| | | <CodesignProvision>OnPro211125-1-Dev</CodesignProvision> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
| | | </PropertyGroup> |
| | |
| | | <Version>13.0.1</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="MQTTnet"> |
| | | <Version>3.0.16</Version> |
| | | <Version>3.1.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Analytics"> |
| | | <Version>4.3.0</Version> |
| | | <Version>4.4.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Crashes"> |
| | | <Version>4.3.0</Version> |
| | | <Version>4.4.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="ZXing.Net.Mobile"> |
| | | <Version>2.4.1</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="RestSharp"> |
| | | <Version>106.12.0</Version> |
| | | <Version>106.13.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.iOS.Bugly"> |
| | | <Version>1.0.4</Version> |
| | |
| | | //HDL_ON_iOS.AppDelegate.rootViewController.PushViewController(user, true); |
| | | |
| | | |
| | | var sDM = new SiriKit.SceneDateManager(); |
| | | Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); |
| | | |
| | | NSMutableArray list = new NSMutableArray(); |
| | | foreach (var localScene in HDL_ON.Entity.FunctionList.List.scenes) |
| | |
| | | HDL_ON_iOS.AppDelegate.rootViewController.PushViewController(vc, true); |
| | | } |
| | | |
| | | public void SetData(bool isLogin, string accessToken, string refreshToken, string regionUrl) |
| | | public void SetData(bool isLogin, string accessToken, string refreshToken, string regionUrl, string homeId) |
| | | { |
| | | var sDM = new Other.Siri.SceneDateManager(); |
| | | sDM.SetIsLoginValue(isLogin); |
| | | sDM.SetAccessTokenValue(accessToken); |
| | | sDM.SetRefreshTokenValue(refreshToken); |
| | | sDM.SetRegionUrlValue(regionUrl); |
| | | var sDM = new SiriKit.SceneDateManager(); |
| | | sDM.IsLgoin = isLogin; |
| | | sDM.AccessToken = accessToken; |
| | | sDM.RefreshToken = refreshToken; |
| | | sDM.RegionUrl = regionUrl; |
| | | sDM.HomeId = homeId; |
| | | } |
| | | } |
| | | } |
| | |
| | | 512=Message push is not enabled, please go to settings. |
| | | 513=Please enter the pairing code |
| | | 514=Gateway location information is not configured |
| | | 515=Add Security |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 512=消息推送未开启,请前往设置。 |
| | | 513=请输入配对码 |
| | | 514=未配置网关位置信息 |
| | | |
| | | 515=添加安防 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | HDLLinphone.Current.LogoutAllAccount(); |
| | | #if __IOS__ |
| | | //5.清空Siri共享数据信息 |
| | | new Other.SkipControl().SetData(false, "", "", ""); |
| | | new Other.SkipControl().SetData(false, "", "", "",""); |
| | | #endif |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | MainPage.CurPageIndex = 9999; |
| | | MainPage.UserBasePage.ChooseCollection(); |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | #endif |
| | | } |
| | | } |
| | | //Dialog |
| | |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | public const int AddSecurity = 515; |
| | | /// <summary> |
| | | /// 未配置网关地址信息 |
| | | /// </summary> |
| | | public const int GatewayLocationInformationIsNotConfigured = 514; |
| | |
| | | /// <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); |
| | |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | return true; |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.AccessToken = UserInfo.Current.LoginTokenString; |
| | | sdm.RefreshToken = UserInfo.Current.RefreshToken; |
| | | #endif |
| | | } |
| | | return false; |
| | | } |
| | |
| | | { |
| | | public SecurityAlarm() |
| | | { |
| | | pushConfigs.Add(new SecurityPushConfig() |
| | | { |
| | | pushMethod = "APP", |
| | | pushTarget = new List<string>() { UserInfo.Current.ID } |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <summary> |
| | | /// 安防延时 |
| | | /// </summary> |
| | | public string delay; |
| | | public string delay ="0"; |
| | | /// <summary> |
| | | /// 状态 |
| | | /// 布防:enable |
| | |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | | } |
| | | /// <summary> |
| | | /// 刷新本地数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public SecurityAlarm RefeshData() |
| | | { |
| | | var dataBytes = FileUtlis.Files.ReadFile(savePath); |
| | | var dataString = System.Text.Encoding.UTF8.GetString(dataBytes); |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityAlarm>(dataString); |
| | | return temp; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存安防信息 |
| | |
| | | public string SaveInfo() |
| | | { |
| | | HttpServerRequest hsr = new HttpServerRequest(); |
| | | this.noticeConfig.enable = true; |
| | | this.noticeConfig.noticeContent = Language.StringByID(StringId.SecurityAlarmTipString).Replace("{0}", name); |
| | | if (string.IsNullOrEmpty(this.noticeConfig.noticeContent)) |
| | | { |
| | | this.noticeConfig.noticeContent = Language.StringByID(StringId.SecurityAlarmTipString).Replace("{0}", name); |
| | | } |
| | | if (this.noticeConfig.enable) |
| | | { |
| | | if (this.pushConfigs.Count == 0) |
| | | { |
| | | pushConfigs.Add(new SecurityPushConfig() |
| | | { |
| | | pushMethod = "APP", |
| | | pushTarget = new List<string>() { UserInfo.Current.ID } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(sid)) |
| | | { |
| | | NewSid(); |
| | |
| | | public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); |
| | | |
| | | /// <summary> |
| | | /// 判断条件 |
| | | /// </summary> |
| | | public string comparator = "="; |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | //public bool addCondition = false; |
| | | |
| | | /// <summary> |
| | | /// 判断条件 |
| | | /// </summary> |
| | | public string comparator = "="; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | |
| | | /// </summary> |
| | | public List<SecurityOutputStatus> status = new List<SecurityOutputStatus>(); |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | //[Newtonsoft.Json.JsonIgnore] |
| | | //public bool addCondition = false; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | public string name = ""; |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public string RoomName = ""; |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | |
| | | } |
| | | }else if(target_type == "1") |
| | | { |
| | | |
| | | text = Language.StringByID(StringId.Open); |
| | | } |
| | | |
| | | return text; |
| | |
| | | /// <summary> |
| | | /// 是否开启通知 |
| | | /// </summary> |
| | | public bool enable; |
| | | public bool enable = true; |
| | | /// <summary> |
| | | /// 通知内容 |
| | | /// </summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\HDLLinphone.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\A_EnvironmentalDataCenter.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\2-Classification\SceneControlZone.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\PushConfigPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | | //etAccount.Text = "18598273624"; |
| | | //etAccount.Text = "tf@smarttech.com.ua"; |
| | | etAccount.Text = "18814122445";//董泽斌 天河办公室 |
| | | //etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "18402017839";//wjc |
| | | //etAccount.Text = "18814122445";//董泽斌 天河办公室 |
| | | etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | //etAccount.Text = "18402017839";//wjc |
| | | //etAccount.Text = "13430286286";//cwc |
| | | //etAccount.Text = "13709260805"; |
| | | //etAccount.Text = "support5@hdlchina.com.cn"; |
| | |
| | | //UserInfo.Current.CurrentRegion.RegionID = ""; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("登录成功。"); |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.AccessToken = UserInfo.Current.LoginTokenString; |
| | | sdm.RefreshToken = UserInfo.Current.RefreshToken; |
| | | #endif |
| | | |
| | | result = true; |
| | | //获取用户信息 |
| | |
| | | /// View的方法 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public FrameLayout FLayoutView() |
| | | public FrameLayout FLayoutView(bool hadLine = true) |
| | | { |
| | | btnText.TextAlignment = TextAlignment.CenterLeft; |
| | | btnNextIcon.Gravity = Gravity.CenterVertical; |
| | | frameLayout.AddChidren(btnText); |
| | | frameLayout.AddChidren(btnNextIcon); |
| | | btnLine.Y = frameLayout.Height - 1; |
| | | frameLayout.AddChidren(btnLine); |
| | | if (hadLine) |
| | | { |
| | | btnLine.Y = frameLayout.Height - 1; |
| | | frameLayout.AddChidren(btnLine); |
| | | } |
| | | frameLayout.AddChidren(btnClick); |
| | | return frameLayout; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | PageLayout contentPageView; |
| | | Button btnAutomationTitle; |
| | | |
| | | #region 安防区域 |
| | | FrameLayout securityView; |
| | | Button btnSecurityTitle; |
| | | #endregion |
| | | |
| | | |
| | | #region 场景区域 |
| | | FrameLayout scenePageView; |
| | | /// <summary> |
| | |
| | | //判断是否需要隐藏自动化 |
| | | if (HideAutoPage) |
| | | { |
| | | btnSceneTilte = new Button() |
| | | if (DB_ResidenceData.Instance.GatewayType == 1)//网关需要加载安防--2021-11-28 19:56:53 刘晓辉将安防放入改界面 |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | //Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | btnAutomationTitle = new Button(); |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | |
| | | btnSecurityTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(209), |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.SecurityCenter, |
| | | }; |
| | | topView.AddChidren(btnSecurityTitle); |
| | | btnAutomationTitle = new Button(); |
| | | } |
| | | else |
| | | { |
| | | |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | //Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | btnAutomationTitle = new Button(); |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | |
| | | btnSceneTilte = new Button() |
| | | if (DB_ResidenceData.Instance.GatewayType == 1)//网关需要加载安防--2021-11-28 19:56:53 刘晓辉将安防放入改界面 |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | btnAutomationTitle = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Automation, |
| | | IsSelected = false |
| | | }; |
| | | topView.AddChidren(btnAutomationTitle); |
| | | btnAutomationTitle.Width = btnAutomationTitle.GetTextWidth() + Application.GetRealWidth(40); |
| | | |
| | | btnAutomationTitle = new Button() |
| | | var otherWidth = (Application.GetRealWidth(375) - btnAutomationTitle.Width) / 2; |
| | | btnAutomationTitle.X = otherWidth; |
| | | |
| | | |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Width = otherWidth, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected =true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | |
| | | |
| | | btnSecurityTitle = new Button() |
| | | { |
| | | X = btnAutomationTitle.Right, |
| | | Y = Application.GetRealHeight(30), |
| | | Width = otherWidth, |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.SecurityCenter, |
| | | }; |
| | | topView.AddChidren(btnSecurityTitle); |
| | | } |
| | | else |
| | | { |
| | | X = Application.GetRealWidth(209), |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Automation, |
| | | }; |
| | | topView.AddChidren(btnAutomationTitle); |
| | | btnSceneTilte = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.HeadlineFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Scenes, |
| | | IsSelected = true |
| | | }; |
| | | topView.AddChidren(btnSceneTilte); |
| | | |
| | | btnAutomationTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(209), |
| | | Y = Application.GetRealHeight(30), |
| | | Width = Application.GetRealWidth(170), |
| | | Height = Application.GetRealHeight(25), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextID = StringId.Automation, |
| | | }; |
| | | topView.AddChidren(btnAutomationTitle); |
| | | } |
| | | } |
| | | var btnAddIconBg = new Button() |
| | | { |
| | |
| | | { |
| | | LoadAutomationPageView(); |
| | | } |
| | | LoadSecurityPageView(); |
| | | LoadEventList(); |
| | | |
| | | } |
| | | |
| | | #region 安防布防 |
| | | /// <summary> |
| | | /// 加载安防界面 |
| | | /// </summary> |
| | | void LoadSecurityPageView() |
| | | { |
| | | securityView = new FrameLayout(); |
| | | contentPageView.AddChidren(securityView); |
| | | |
| | | var page = new ArmCenterPage(); |
| | | securityView.AddChidren(page); |
| | | page.LoadPage(false); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 场景部分 |
| | | /// <summary> |
| | | /// 加载场景列表界面 |
| | |
| | | /// <summary> |
| | | /// 加载场景控制卡片 |
| | | /// </summary> |
| | | //FrameLayout LoadSceneFunctionDiv(FrameLayout view, Scene scene) |
| | | FrameLayout LoadSceneFunctionDiv(int functionView_X, Scene scene) |
| | | { |
| | | var view = new FrameLayout() |
| | |
| | | { |
| | | contentPageView.PageChange = (sender, e) => |
| | | { |
| | | if (contentPageView.PageIndex == 0) |
| | | if (contentPageView.PageIndex == 2) |
| | | { |
| | | btnSecurityTitle.IsSelected = true; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnSecurityTitle.IsBold = true; |
| | | btnSceneTilte.IsSelected = false; |
| | | btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSceneTilte.IsBold = false; |
| | | btnAutomationTitle.IsSelected = false; |
| | | btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnAutomationTitle.IsBold = false; |
| | | } |
| | | else if (contentPageView.PageIndex == 0) |
| | | { |
| | | btnSecurityTitle.IsSelected = false; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSecurityTitle.IsBold = false; |
| | | btnSceneTilte.IsSelected = true; |
| | | btnSceneTilte.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnSceneTilte.IsBold = true; |
| | |
| | | } |
| | | else |
| | | { |
| | | btnSecurityTitle.IsSelected = false; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSecurityTitle.IsBold = false; |
| | | btnAutomationTitle.IsSelected = true; |
| | | btnAutomationTitle.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnAutomationTitle.IsBold = true; |
| | |
| | | { |
| | | return; |
| | | } |
| | | btnSecurityTitle.IsSelected = false; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSceneTilte.IsSelected = true; |
| | | btnSceneTilte.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnAutomationTitle.IsSelected = false; |
| | |
| | | { |
| | | return; |
| | | } |
| | | btnSecurityTitle.IsSelected = false; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnAutomationTitle.IsSelected = true; |
| | | btnAutomationTitle.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnSceneTilte.IsSelected = false; |
| | | btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; |
| | | contentPageView.PageIndex = 1; |
| | | |
| | | }; |
| | | btnSecurityTitle.MouseUpEventHandler = (sender, e) => { |
| | | if(btnSecurityTitle.IsSelected ) |
| | | { |
| | | return; |
| | | } |
| | | btnSecurityTitle.IsSelected = true; |
| | | btnSecurityTitle.TextSize = CSS_FontSize.HeadlineFontSize; |
| | | btnAutomationTitle.IsSelected = false; |
| | | btnAutomationTitle.TextSize = CSS_FontSize.TextFontSize; |
| | | btnSceneTilte.IsSelected = false; |
| | | btnSceneTilte.TextSize = CSS_FontSize.TextFontSize; |
| | | contentPageView.PageIndex = 2; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | btnSceneDelayInfo.Text = scene.GetDelayText(); |
| | | scene.EditScene(); |
| | | }; |
| | | Dictionary<string, string> items = new Dictionary<string, string>(); |
| | | items.Add("30", "30s"); |
| | | items.Add("60", "1min"); |
| | | items.Add("120", "2min"); |
| | | items.Add("300", "5min"); |
| | | new PublicAssmebly().SetSceneDelayDialog(action,scene.delay); |
| | | }; |
| | | |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionDelayInfo); |
| | | |
| | | if (Convert.ToInt32( scenefunction.delay) > 0) |
| | | if (!string.IsNullOrEmpty(scenefunction.delay) && Convert.ToInt32( scenefunction.delay) > 0) |
| | | { |
| | | btnFunctionDelayInfo.Text = Language.StringByID(StringId.Delay) + " " + new Scene() { delay = scenefunction.delay }.GetDelayText(); |
| | | } |
| | |
| | | contentView.AddChidren(supportView); |
| | | |
| | | |
| | | |
| | | int supportViewCellCount = 1; |
| | | #region 智能音箱 |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | supportViewCellCount++; |
| | | //supportView 加高 显示3行 3*44 |
| | | supportView.Height = Application.GetRealWidth(2*44); |
| | | supportView.Height = Application.GetRealWidth(supportViewCellCount * 44); |
| | | |
| | | FrameLayout smartSpeakerView = new FrameLayout() |
| | | { |
| | |
| | | #if __IOS__ |
| | | //if (Application.PhoneType >= 12) |
| | | { |
| | | supportViewCellCount++; |
| | | //supportView 加高 显示3行 3*44 |
| | | supportView.Height = Application.GetRealWidth(3 * 44); |
| | | supportView.Height = Application.GetRealWidth(supportViewCellCount * 44); |
| | | |
| | | FrameLayout siriView = new FrameLayout() |
| | | { |
| | |
| | | DB_ResidenceData.Instance.EixtAccount(); |
| | | //刷新住宅数据 |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | #endif |
| | | } |
| | | #endregion |
| | | |
| | |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Stan; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | Entity.DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0]; |
| | | Entity.DB_ResidenceData.Instance.SaveResidenceData(); |
| | | DB_ResidenceData.Instance.CurrentRegion = UserInfo.Current.regionList[0]; |
| | | DB_ResidenceData.Instance.SaveResidenceData(); |
| | | //刷新住宅数据 |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | |
| | |
| | | MainPage.CurPageIndex = 1; |
| | | userPage.ChoosePersonalCenter(); |
| | | } |
| | | #if __IOS__ |
| | | var sdm = new SiriKit.SceneDateManager(); |
| | | sdm.RegionUrl = DB_ResidenceData.Instance.CurrentRegion.regionUrl; |
| | | sdm.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | #endif |
| | | } |
| | | } |
| | | }; |
| | |
| | | SecurityAlarm securityAlarm; |
| | | Action refreshAction; |
| | | |
| | | /// <summary> |
| | | /// 安防输出-临时 |
| | | /// </summary> |
| | | List<SecurityOutput> tempOutput = new List<SecurityOutput>(); |
| | | /// <summary> |
| | | /// 安防输入-临时 |
| | | /// </summary> |
| | | List<SecurityInput> tempInput = new List<SecurityInput>(); |
| | | |
| | | |
| | | public AddAlarmDeploymentPage(SecurityAlarm alarm, Action action) |
| | | { |
| | | bodyView = this; |
| | |
| | | refreshAction = action; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | public void LoadPage(string title = "") |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 布防信息 |
| | | var deploymentTitleRow = new FrameLayout() |
| | | if (string.IsNullOrEmpty(title)) |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AddSecurity)).LoadTopView(); |
| | | #region 布防信息 |
| | | var deploymentTitleRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentTitleRow); |
| | | |
| | | var btnDeploymentTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeploymentInformation, |
| | | IsBold = true, |
| | | }; |
| | | deploymentTitleRow.AddChidren(btnDeploymentTitle); |
| | | |
| | | deploymentTitleRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | #region 布防名称 |
| | | var deploymentNameRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentNameRow); |
| | | |
| | | var btnDeploymentNameTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Name, |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentNameTitle); |
| | | btnDeploymentNameTitle.Text += ":"; |
| | | |
| | | var btnDeploymentName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(230), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.name |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentName); |
| | | deploymentNameRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | LoadEvent_EditSecurityAlarmName(btnDeploymentName); |
| | | #endregion |
| | | |
| | | #region 触发延时 |
| | | var delayedRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(delayedRow); |
| | | |
| | | var btnDelayedTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.TriggerDelay, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(330), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.delay + "s" |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedText); |
| | | btnDelayedText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action<string> action = (obj) => |
| | | { |
| | | securityAlarm.delay = obj; |
| | | btnDelayedText.Text = securityAlarm.delay + "s"; |
| | | }; |
| | | new PublicAssmebly().SetSceneDelayDialog(action, securityAlarm.delay); |
| | | }; |
| | | |
| | | var btnDelayedRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedRight); |
| | | |
| | | |
| | | delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | } |
| | | else |
| | | { |
| | | new TopViewDiv(bodyView, title).LoadTopView(); |
| | | } |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | |
| | | #region 执行推送 |
| | | ///上下间隔12像素 |
| | | contentView.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); |
| | | ///执行推送iew |
| | | FrameLayout pushView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentTitleRow); |
| | | contentView.AddChidren(pushView); |
| | | |
| | | var btnDeploymentTitle = new Button() |
| | | |
| | | var btnPushTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeploymentInformation, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.push, |
| | | IsBold = true, |
| | | }; |
| | | deploymentTitleRow.AddChidren(btnDeploymentTitle); |
| | | pushView.AddChidren(btnPushTitle); |
| | | |
| | | deploymentTitleRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | #region 布防名称 |
| | | var deploymentNameRow = new FrameLayout() |
| | | var btnSwitchPush = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Width = Application.GetRealWidth(36), |
| | | Height = Application.GetRealWidth(36), |
| | | X = Application.GetRealWidth(323), |
| | | UnSelectedImagePath = "LogicIcon/off.png", |
| | | SelectedImagePath = "LogicIcon/on.png", |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | contentView.AddChidren(deploymentNameRow); |
| | | pushView.AddChidren(btnSwitchPush); |
| | | |
| | | var btnDeploymentNameTitle = new Button() |
| | | |
| | | ///是否要推送点击事件 |
| | | btnSwitchPush.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Name, |
| | | //账号列表为空默认推送当前账号 |
| | | if (securityAlarm.pushConfigs.Count == 0) |
| | | { |
| | | //初始化对象 |
| | | var pushConfigs = new SecurityPushConfig(); |
| | | //默认添加推送当前账号 |
| | | pushConfigs.pushTarget.Add(UserInfo.Current.ID); |
| | | securityAlarm.pushConfigs.Add(pushConfigs); |
| | | } |
| | | btnSwitchPush.IsSelected = !btnSwitchPush.IsSelected; |
| | | if (btnSwitchPush.IsSelected) |
| | | { |
| | | securityAlarm.noticeConfig.enable = true; |
| | | } |
| | | else |
| | | { |
| | | securityAlarm.noticeConfig.enable = false; |
| | | } |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentNameTitle); |
| | | btnDeploymentNameTitle.Text += ":"; |
| | | |
| | | var btnDeploymentName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(230), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.name |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentName); |
| | | deploymentNameRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | LoadEvent_EditSecurityAlarmName(btnDeploymentName); |
| | | pushView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | /* |
| | | #region 触发延时 |
| | | var delayedRow = new FrameLayout() |
| | | #region 发送通知 |
| | | ///发送通知View |
| | | var pushMsgView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(delayedRow); |
| | | |
| | | var btnDelayedTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.TriggerDelay, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(230), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.name |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedText); |
| | | |
| | | var btnDelayedRight = new Button() |
| | | contentView.AddChidren(pushMsgView); |
| | | var btnPushMsgRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedRight); |
| | | pushMsgView.AddChidren(btnPushMsgRight); |
| | | |
| | | //delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | */ |
| | | |
| | | |
| | | var btnPushMsgTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(372), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.fasongtongzhi, |
| | | IsBold = true, |
| | | }; |
| | | pushMsgView.AddChidren(btnPushMsgTitle); |
| | | |
| | | btnPushMsgTitle.MouseUpEventHandler = (sender, e) => { |
| | | var inputPushText = new PushConfigPage(); |
| | | MainPage.BasePageView.AddChidren(inputPushText); |
| | | inputPushText.Show(securityAlarm); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | ///上下间隔62像素 |
| | | contentView.AddChidren(new FrameLayout { Height = Application.GetRealHeight(40) }); |
| | | |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | |
| | | #if DEBUG |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | #endif |
| | | |
| | | |
| | | #region 底部区域 |
| | | var bottomView = new FrameLayout() |
| | |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | //if (securityAlarm.output.Count == 0) |
| | | //{ |
| | | // var tip = new Tip() |
| | | // { |
| | | // Text = "请选择告警目标", |
| | | // CloseTime = 3, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(MainPage.BaseView); |
| | | // return; |
| | | //} |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tipText = "请选择告警目标"; |
| | | if(Language.CurrentLanguage !="Chinese") |
| | | { |
| | | tipText = "Please select the alarm target"; |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipText, |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | |
| | | { |
| | | try |
| | | { |
| | | |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentFunctionRow); |
| | | deploymentFunctionRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | var btnFunctionTitle = new Button() |
| | | { |
| | |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); |
| | | } |
| | | inputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | //if (outputTargetView != null) |
| | | //{ |
| | | // contentView.AddChidren(outputTargetView); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(outputRow); |
| | | outputRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var btnOutputRowTitle = new Button() |
| | | { |
| | |
| | | outputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | Height =0, |
| | | }; |
| | | contentView.AddChidren(outputTargetView); |
| | | |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | iniAlarmListView(); |
| | | |
| | | #endregion |
| | |
| | | { |
| | | foreach (var outTarget in securityAlarm.output) |
| | | { |
| | | outputTargetView.AddChidren(new OutputRow(outTarget.GetFunction().name, outTarget.GetFunction().GetRoomListName(), "打开")); |
| | | if (outTarget.GetFunction() != null) |
| | | { |
| | | outputTargetView.AddChidren(new OutputRow(outTarget.GetFunction().name, outTarget.GetFunction().GetRoomListName(), outTarget.StateText())); |
| | | } |
| | | outputTargetView.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | } |
| | |
| | | IsMoreLines = true, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }); |
| | | outputTargetView.Height = Application.GetRealHeight(68); |
| | | } |
| | | } |
| | | |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | |
| | | |
| | | btnDeploymentName.Text = securityAlarm.name = str; |
| | | |
| | |
| | | |
| | | Action<SecurityAlarm> refreshAction; |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | List<SecurityInput> inputList = new List<SecurityInput>(); |
| | | |
| | | public AddInputPage(SecurityAlarm alarm,Action<SecurityAlarm> action) |
| | | SecurityAlarm alarm; |
| | | public AddInputPage(SecurityAlarm inAlarm,Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = alarm; |
| | | alarm = inAlarm; |
| | | refreshAction = action; |
| | | } |
| | | |
| | |
| | | Text = DB_ResidenceData.Instance.CurFloor.roomName, |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloor); |
| | | btnFloor.MouseUpEventHandler += (sender, e) => |
| | | btnFloor.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | string nowSelectId = null; |
| | | var listAllFun = FunctionList.List.GetArmSensorList(); |
| | | var list = FunctionList.List.GetArmSensorList(); |
| | | |
| | | #if DEBUG |
| | | list.AddRange(FunctionList.List.GetLightList()); |
| | | #endif |
| | | //显示下拉界面 |
| | | var form = new FloorRoomSelectPopupView(); |
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => |
| | | form.ShowDeviceFunctionView(btnFloor, list, (selectId, listFun) => |
| | | { |
| | | nowSelectId = selectId; |
| | | //重新刷新设备列表 |
| | |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | var listAllFun = FunctionList.List.GetArmSensorList(); |
| | | #if DEBUG |
| | | listAllFun.AddRange(FunctionList.List.GetLightList()); |
| | | #endif |
| | | |
| | | LoadFunctionListRow(FunctionList.List.GetArmSensorList()); |
| | | LoadFunctionListRow(listAllFun); |
| | | |
| | | |
| | | |
| | |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | securityAlarm.input = new List<SecurityInput>(); |
| | | foreach (var input in inputList) |
| | | { |
| | | if (input.addCondition) |
| | | { |
| | | securityAlarm.input.Add(input); |
| | | } |
| | | } |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(securityAlarm); |
| | | refreshAction?.Invoke(alarm); |
| | | }; |
| | | |
| | | |
| | |
| | | functions = FunctionList.List.GetArmSensorList(); |
| | | } |
| | | |
| | | #if DEBUG |
| | | functions.AddRange(FunctionList.List.GetLightList()); |
| | | #endif |
| | | |
| | | foreach (var function in functions) |
| | | { |
| | | var input = securityAlarm.input.Find((obj) => obj.sid == function.sid); |
| | | var input = alarm.input.Find((obj) => obj.sid == function.sid); |
| | | if (input == null) |
| | | { |
| | | input = new SecurityInput(); |
| | |
| | | break; |
| | | } |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = inKey, |
| | | value = inValue, |
| | | } |
| | | }; |
| | | new SecurityInputCondition() |
| | | { |
| | | key = inKey, |
| | | value = inValue, |
| | | } |
| | | }; |
| | | |
| | | if (function.spk == SPK.LightSwitch || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "off", |
| | | } |
| | | }; |
| | | new SecurityInputCondition() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "off", |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = true; |
| | | } |
| | | inputList.Add(input); |
| | | //else |
| | | //{ |
| | | // //input.addCondition = true; |
| | | // alarm.input.Add(input); |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | if(btnChooseIcon.IsSelected) |
| | | var tempLocal = alarm.input.Find((obj) => |
| | | obj.sid == input.sid |
| | | ); |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | input.addCondition = true; |
| | | //if (input.condition.Count==0) |
| | | //{ |
| | | // ShowStateDialog(input, btnState,btnChooseIcon,function.spk); |
| | | //} |
| | | //input.addCondition = true; |
| | | if (tempLocal == null) |
| | | alarm.input.Add(input); |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = false; |
| | | //input.addCondition = false; |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.input.Remove(input); |
| | | } |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //ShowStateDialog(input, btnState, btnChooseIcon, function.spk); |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.input.Find((obj) => |
| | | obj.sid == input.sid |
| | | ); |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | input.addCondition = true; |
| | | //input.addCondition = true; |
| | | if (tempLocal == null) |
| | | alarm.input.Add(input); |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = false; |
| | | //input.addCondition = false; |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.input.Remove(input); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | if (input.addCondition) |
| | | var localInput = alarm.input.Find((obj) => |
| | | obj.sid == input.sid |
| | | ); |
| | | if (localInput!=null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = input.StateText(); |
| | |
| | | } |
| | | |
| | | |
| | | var localInput = alarm.input.Find((obj) => |
| | | obj.sid == input.sid |
| | | ); |
| | | if (localInput == null) |
| | | alarm.input.Add(input); |
| | | |
| | | input.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | |
| | | } |
| | | |
| | | |
| | | input.addCondition = true; |
| | | var localInput = alarm.input.Find((obj) => |
| | | obj.sid == input.sid |
| | | ); |
| | | if (localInput == null) |
| | | alarm.input.Add(input); |
| | | |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | |
| | | |
| | | VerticalScrolViewLayout functionListView; |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | Action<SecurityAlarm> refreshAction; |
| | | List<SecurityOutput> outputList = new List<SecurityOutput>(); |
| | | /// <summary> |
| | | /// 本地功能转换的输出列表(灯光、场景) |
| | | /// </summary> |
| | | List<SecurityOutput> allocatedList = new List<SecurityOutput>(); |
| | | |
| | | List<Function> allocatedList = new List<Function>(); |
| | | SecurityAlarm alarm; |
| | | |
| | | public AddOutputPage(SecurityAlarm function, Action<SecurityAlarm> action) |
| | | public AddOutputPage(SecurityAlarm inOutput ,Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = function; |
| | | refreshAction = action; |
| | | alarm = inOutput; |
| | | } |
| | | |
| | | |
| | |
| | | Text = DB_ResidenceData.Instance.CurFloor.roomName, |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloor); |
| | | LoadDialog_ChangeFloor(); |
| | | |
| | | #endregion |
| | | |
| | |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | SetData(); |
| | | |
| | | |
| | | |
| | | |
| | | foreach (var function in FunctionList.List.Functions) |
| | | { |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | | if (function == null) |
| | | { |
| | | continue; |
| | | } |
| | | function.roomIds.Remove(null); |
| | | allocatedList.Add(function); |
| | | } |
| | | |
| | | LoadFunctionListRow(null); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | LoadFunctionListRow(); |
| | | |
| | | var bottomView = new FrameLayout() |
| | | { |
| | |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | securityAlarm.output = new List<SecurityOutput>(); |
| | | foreach (var output in outputList) |
| | | { |
| | | if (output.addCondition) |
| | | { |
| | | securityAlarm.output.Add(output); |
| | | } |
| | | } |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(securityAlarm); |
| | | refreshAction?.Invoke(alarm); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 配置数据 |
| | | /// </summary> |
| | | void SetData(string roomId="") |
| | | { |
| | | allocatedList.Clear(); |
| | | foreach (var function in FunctionList.List.GetLightList()) |
| | | { |
| | | if (function == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!string.IsNullOrEmpty(roomId) && roomId == "ALLSELECT") |
| | | { |
| | | if (!function.roomIds.Contains(roomId)) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | function.roomIds.Remove(null); |
| | | var tempStatus = new List<SecurityOutputStatus>(); |
| | | tempStatus.Add(new SecurityOutputStatus() { key = FunctionAttributeKey.OnOff, value = "on" }); |
| | | allocatedList.Add(new SecurityOutput |
| | | { |
| | | target_type = "0", |
| | | sid = function.sid, |
| | | status = tempStatus, |
| | | name = function.name, |
| | | RoomName = function.GetRoomListName(), |
| | | }); |
| | | } |
| | | |
| | | |
| | | foreach (var scene in FunctionList.List.scenes) |
| | | { |
| | | if (scene == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!string.IsNullOrEmpty(roomId)) |
| | | { |
| | | if (!scene.roomIds.Contains(roomId)) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | scene.roomIds.Remove(null); |
| | | var tempStatus = new List<SecurityOutputStatus>(); |
| | | tempStatus.Add(new SecurityOutputStatus() { key = "value", value = "0" }); |
| | | allocatedList.Add(new SecurityOutput |
| | | { |
| | | target_type = "1", |
| | | sid = scene.sid, |
| | | status = tempStatus, |
| | | name = scene.name, |
| | | RoomName = scene.GetRoomListName(), |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // <summary> |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | void LoadFunctionListRow() |
| | | { |
| | | functionListView.RemoveAll(); |
| | | if (functions == null) |
| | | foreach (var function in allocatedList) |
| | | { |
| | | functions = allocatedList; |
| | | } |
| | | foreach (var function in functions) |
| | | { |
| | | var output = securityAlarm.output.Find((obj) => obj.sid == function.sid); |
| | | var output = alarm.output.Find((obj) => obj.sid == function.sid); |
| | | if (output == null) |
| | | { |
| | | output = new SecurityOutput(); |
| | | output = new SecurityOutput() { status = new List<SecurityOutputStatus> { new SecurityOutputStatus { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "on" |
| | | } } }; |
| | | |
| | | output.sid = function.sid; |
| | | } |
| | | else |
| | | { |
| | | output.addCondition = true; |
| | | } |
| | | outputList.Add(output); |
| | | //else |
| | | //{ |
| | | // output.addCondition = true; |
| | | //} |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(41), |
| | | Text = function.GetRoomListName(), |
| | | Text = function.RoomName, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | var tempLocal = alarm.input.Find((obj) => |
| | | obj.sid == output.sid |
| | | ); |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | output.addCondition = true; |
| | | if (output.status.Count == 0) |
| | | { |
| | | ShowStateDialog(output, btnState,btnChooseIcon); |
| | | } |
| | | //input.addCondition = true; |
| | | if (tempLocal == null) |
| | | alarm.output.Add(output); |
| | | } |
| | | else |
| | | { |
| | | output.addCondition = false; |
| | | //input.addCondition = false; |
| | | if (tempLocal != null) |
| | | { |
| | | alarm.output.Remove(output); |
| | | } |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | |
| | | ShowStateDialog(output, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | var localOutput = alarm.output.Find((obj) => obj.sid == output.sid); |
| | | |
| | | if (output.addCondition) |
| | | if (localOutput!=null) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = output.StateText(); |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void ShowStateDialog(SecurityOutput output, Button btnState, Button btnChoose = null) |
| | |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.On |
| | | TextID = StringId.On, |
| | | }; |
| | | optinView.AddChidren(btnOpen); |
| | | |
| | | optinView.AddChidren(new Button() |
| | | { |
| | | Height = 1, |
| | |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.OFF, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optinView.AddChidren(btnClose); |
| | | if (output.status.Count > 0) |
| | | { |
| | | btnOpen.IsSelected = output.status[0].value.ToLower() == "on"; |
| | | btnClose.IsSelected = !btnOpen.IsSelected; |
| | | } |
| | | |
| | | |
| | | Button btnCancel = new Button() |
| | |
| | | value = "on", |
| | | } |
| | | }; |
| | | output.addCondition = true; |
| | | if (btnChoose != null) |
| | | var localInput = alarm.output.Find((obj) => |
| | | obj.sid == output.sid |
| | | ); |
| | | if (localInput == null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | |
| | | value = "off", |
| | | } |
| | | }; |
| | | output.addCondition = true; |
| | | if (btnChoose != null) |
| | | var localInput = alarm.output.Find((obj) => |
| | | obj.sid == output.sid |
| | | ); |
| | | if (localInput == null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | string nowSelectId = null; |
| | | btnFloor.MouseUpEventHandler += (sender, e) => |
| | | btnFloor.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var listAllFun = new List<Function>(); |
| | | listAllFun.AddRange(allocatedList); |
| | | //listAllFun.AddRange(allocatedList); |
| | | |
| | | //显示下拉界面 |
| | | var form = new FloorRoomSelectPopupView(); |
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => |
| | | { |
| | | nowSelectId = selectId; |
| | | SetData(selectId); |
| | | //重新刷新设备列表 |
| | | this.LoadFunctionListRow(listFun); |
| | | this.LoadFunctionListRow(); |
| | | }, nowSelectId); |
| | | }; |
| | | } |
| | |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | public void LoadPage(bool addNav = true) |
| | | { |
| | | Action skipAction = () => { |
| | | |
| | | }; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | |
| | | if (addNav) |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | } |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Y = addNav? Application.GetRealHeight(64):0, |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | }); |
| | | |
| | | |
| | | |
| | | #region 固定布防区域 |
| | | /* |
| | | var fixedDeploymentView = new FrameLayout() |
| | |
| | | Width = Application.GetRealWidth(24), |
| | | }); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //灾害报警 |
| | | var disasterAlarmView = new FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour)); |
| | | EventHandler<MouseEventArgs> disasterAlarmViewClick = (sender, e) => { |
| | | var disasterAlarm = FunctionList.List.securities.Find((obj) => obj.type == "all_day"); |
| | | if (disasterAlarm == null) |
| | | { |
| | | disasterAlarm = new SecurityAlarm() { name = "alldaydefense", type = "all_day" }; |
| | | } |
| | | else |
| | | { |
| | | disasterAlarm = disasterAlarm.RefeshData(); |
| | | } |
| | | var addDefensePage = new AddAlarmDeploymentPage(disasterAlarm, null); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(Language.StringByID(StringId.DisasterDefense)); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | disasterAlarmView.SetClick(disasterAlarmViewClick); |
| | | fixedDeploymentTypeView.AddChidren(disasterAlarmView); |
| | | |
| | | fixedDeploymentTypeView.AddChidren(new Button() |
| | |
| | | |
| | | //防盗报警 |
| | | var burglarAlarmView = new FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute)); |
| | | EventHandler<MouseEventArgs> burglarAlarmViewClick = (sender, e) => { |
| | | var burglarAlarm = FunctionList.List.securities.Find((obj) => obj.type == "mute"); |
| | | if (burglarAlarm == null) |
| | | { |
| | | burglarAlarm = new SecurityAlarm() { name = "mutedefense", type = "mute" }; |
| | | } |
| | | else |
| | | { |
| | | burglarAlarm = burglarAlarm.RefeshData(); |
| | | } |
| | | var addDefensePage = new AddAlarmDeploymentPage(burglarAlarm, null); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(Language.StringByID(StringId.BurglarAlarm)); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | disasterAlarmView.SetClick(disasterAlarmViewClick); |
| | | fixedDeploymentTypeView.AddChidren(burglarAlarmView); |
| | | */ |
| | | #endregion |
| | |
| | | customDeploymentView.AddChidren(view); |
| | | EventHandler<MouseEventArgs> event1 = (sender, e) => |
| | | { |
| | | Action refreshAction = () => |
| | | Action addDefenseRefreshAction = () => |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | |
| | | var addDefensePage = new AddAlarmDeploymentPage(new SecurityAlarm(), refreshAction); |
| | | var addDefensePage = new AddAlarmDeploymentPage(new SecurityAlarm(), addDefenseRefreshAction); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | |
| | | alarm = alarm.RefeshData(); |
| | | var armSetPage = new AddAlarmDeploymentPage(alarm,refreshAction); |
| | | MainPage.BasePageView.AddChidren(armSetPage); |
| | | armSetPage.LoadPage(); |
| | |
| | | /// </summary> |
| | | public class FixedArmView : FrameLayout |
| | | { |
| | | Button btnIcon; |
| | | Button btnTitle; |
| | | Button btnTitleTip; |
| | | |
| | | /// <summary> |
| | | /// 固定布防控件 |
| | | /// </summary> |
| | |
| | | this.BorderColor = CSS_Color.MainColor; |
| | | this.BorderWidth = 1; |
| | | |
| | | var btnIcon = new Button() |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Width = Application.GetRealWidth(24), |
| | |
| | | }; |
| | | this.AddChidren(btnIcon); |
| | | |
| | | var btnTitle = new Button() |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(89), |
| | |
| | | }; |
| | | this.AddChidren(btnTitle); |
| | | |
| | | var btnTitleTip = new Button() |
| | | btnTitleTip = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | Y = Application.GetRealHeight(23), |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = titleTip, |
| | | IsMoreLines = true, |
| | | }; |
| | | this.AddChidren(btnTitleTip); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置点击事件 |
| | | /// </summary> |
| | | /// <param name="handler"></param> |
| | | public void SetClick(EventHandler<MouseEventArgs> handler) |
| | | { |
| | | btnTitleTip.MouseUpEventHandler = btnIcon.MouseUpEventHandler = handler; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class PushConfigPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | public PushConfigPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | public void Show(Entity.SecurityAlarm alarm) |
| | | { |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.fasongtongzhi)).LoadTopView(); |
| | | |
| | | this.BackgroundColor = CSS.CSS_Color.BackgroundColor; |
| | | |
| | | var viewLayout = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(527), |
| | | }; |
| | | bodyView.AddChidren(viewLayout); |
| | | |
| | | #region 通知内容 |
| | | UI2.Intelligence.Automation.LogicView.AddOutputInputTextView addInputTextView = new UI2.Intelligence.Automation.LogicView.AddOutputInputTextView(); |
| | | addInputTextView.btnIf.TextID = StringId.tongzhineirong; |
| | | viewLayout.AddChidren(addInputTextView.FLayoutView(46, 12)); |
| | | ///输入推送文本 |
| | | EditTextView textBox = new EditTextView//EditText |
| | | { |
| | | Y = Application.GetRealHeight(42), |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(152), |
| | | TextAlignment = TextAlignment.TopLeft, |
| | | Radius = (uint)Application.GetRealHeight(12), |
| | | Text = alarm.noticeConfig.noticeContent, |
| | | TextSize = UI2.Intelligence.Automation.LogicView.TextSize.text14, |
| | | TextColor = CSS.CSS_Color.textColor, |
| | | PlaceholderText = Language.StringByID(StringId.xianzhichangdu),//"(100字以内)", |
| | | PlaceholderTextColor = CSS.CSS_Color.textCancelColor, |
| | | BackgroundColor = CSS.CSS_Color.textWhiteColor, |
| | | |
| | | }; |
| | | viewLayout.AddChidren(textBox); |
| | | textBox.TextChangeEventHandler += (sender, e) => |
| | | { |
| | | var leng = e.Length; |
| | | if (leng > 100) |
| | | { |
| | | textBox.Text = e.Substring(0, 100); |
| | | #if __Android__ |
| | | textBox.SetSelectionEnd(); |
| | | #endif |
| | | |
| | | } |
| | | |
| | | }; |
| | | #endregion |
| | | #region App推送 |
| | | UI2.Intelligence.Automation.LogicView.LogicTypeTitleView appPush = new UI2.Intelligence.Automation.LogicView.LogicTypeTitleView(); |
| | | appPush.frameLayout.Y = Application.GetRealHeight(206); |
| | | appPush.frameLayout.Radius = (uint)Application.GetRealHeight(12); |
| | | appPush.btnText.TextID = StringId.apptuisong; |
| | | appPush.btnText.X = Application.GetRealWidth(12); |
| | | viewLayout.AddChidren(appPush.FLayoutView(false)); |
| | | //定义一个局部账号列表用来记录选中数据; |
| | | List<string> selectedAccountList = new List<string>(); |
| | | appPush.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var userList = new List<HDL_ON.Entity.ResidenceMemberInfo>(); |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | userList = Send.GetResidenceMemberAccount(); |
| | | |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | userList.Add(new Entity.ResidenceMemberInfo { childAccountId = UserInfo.Current.ID, childAccountPhone = UserInfo.Current.userMobileInfo, childAccountEmail = UserInfo.Current.userEmailInfo }); |
| | | //住宅子账号列表 |
| | | List<string> accountList = new List<string>(); |
| | | //之前状态列表 |
| | | List<string> stateList = new List<string>(); |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | var user = userList[i]; |
| | | accountList.Add(user.Account); |
| | | } |
| | | |
| | | if (alarm.pushConfigs.Count > 0) |
| | | { |
| | | var list = alarm.pushConfigs[0].pushTarget; |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | |
| | | var user = userList[i]; |
| | | if (list.Contains(user.childAccountId)) |
| | | { |
| | | stateList.Add(user.Account); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | PublicInterface view = new PublicInterface(); |
| | | view.FrameOrVvList(this, accountList, stateList, StringId.zhanghaoxuanze |
| | | , (list) => |
| | | { |
| | | //清空旧数据列表 |
| | | selectedAccountList.Clear(); |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | var user = userList[i]; |
| | | if (list.Contains(user.Account)) |
| | | { |
| | | selectedAccountList.Add(user.childAccountId); |
| | | } |
| | | } |
| | | |
| | | }); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | #endregion |
| | | #region 确认 |
| | | UI2.Intelligence.Automation.LogicView.SaveView saveView = new UI2.Intelligence.Automation.LogicView.SaveView(); |
| | | saveView.btnSave.TextID = StringId.queren; |
| | | saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | this.AddChidren(saveView.FLayoutView()); |
| | | |
| | | |
| | | saveView.btnClick.MouseUpEventHandler += (e, sen) => |
| | | { |
| | | alarm.noticeConfig.noticeContent = textBox.Text.Trim(); |
| | | if (selectedAccountList.Count > 0) |
| | | { |
| | | alarm.pushConfigs.Clear();//清空旧数据列表 |
| | | alarm.pushConfigs.Add(new Entity.SecurityPushConfig { pushTarget = selectedAccountList }); |
| | | } |
| | | //账号列表为空默认推送当前账号 |
| | | if (alarm.pushConfigs.Count == 0) |
| | | { |
| | | //初始化对象 |
| | | Entity.SecurityPushConfig pushConfigs = new Entity.SecurityPushConfig(); |
| | | //默认添加推送当前账号 |
| | | pushConfigs.pushTarget.Add(UserInfo.Current.ID); |
| | | alarm.pushConfigs.Add(pushConfigs); |
| | | } |
| | | this.RemoveFromParent(); |
| | | }; |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 手机账号为先,手机账号为空,其次到邮箱账号 |
| | | /// </summary> |
| | | private string Account |
| | | { |
| | | get |
| | | { |
| | | ///手机账号为先,手机账号为空,其次到邮箱账号; |
| | | if (!string.IsNullOrEmpty(UserInfo.Current.userMobileInfo)) |
| | | { |
| | | //默认推送当前手机账号 |
| | | return UserInfo.Current.userMobileInfo; |
| | | } |
| | | else |
| | | { |
| | | //默认推送当前邮箱账号 |
| | | return UserInfo.Current.userEmailInfo; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using Foundation; |
| | | using HDLSceneSiri; |
| | | using ObjCRuntime; |
| | | using UIKit; |
| | | //using HdlSiri; |
| | | |
| | | namespace SiriIntents |
| | | { |
| | | public class HDLRunSceneIntentHandlder : HDLRunSceneIntentHandling |
| | | { |
| | | public override void ConfirmHDLRunScene (HDLRunSceneIntent intent, Action<HDLRunSceneIntentResponse> completion) |
| | | { |
| | | if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0)) |
| | | { |
| | | if (Server.HttpServerRequest.Ins.DataManager.IsLgoin) |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.InProgress, null); |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | rsp.SuccessMessage = "请等待..."; |
| | | } |
| | | else |
| | | { |
| | | rsp.SuccessMessage = "Please wait..."; |
| | | } |
| | | completion(rsp); |
| | | } |
| | | else |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Failure, null); |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | rsp.SuccessMessage = "账号未登录"; |
| | | } |
| | | else |
| | | { |
| | | rsp.SuccessMessage = "Not logged in to the app"; |
| | | } |
| | | completion(rsp); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.ContinueInApp, null); |
| | | rsp.SuccessMessage = "Ok"; |
| | | completion(rsp); |
| | | } |
| | | } |
| | | |
| | | public override void HandleHDLRunScene(HDLRunSceneIntent intent,Action<HDLRunSceneIntentResponse> completion) |
| | | { |
| | | if (UIDevice.CurrentDevice.CheckSystemVersion(12, 0)) |
| | | { |
| | | if (Server.HttpServerRequest.Ins.DataManager.IsLgoin) |
| | | { |
| | | var result = Server.HttpServerRequest.Ins.ExecuteScene(intent.SceneId); |
| | | if (result == "0") |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Success, null); |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | rsp.SuccessMessage = "执行成功"; |
| | | } |
| | | else |
| | | { |
| | | rsp.SuccessMessage = "Successful execution"; |
| | | } |
| | | completion(rsp); |
| | | } |
| | | else |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Failure, null); |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | rsp.SuccessMessage = "执行失败"; |
| | | } |
| | | else |
| | | { |
| | | rsp.SuccessMessage = "Execution failed"; |
| | | } |
| | | completion(rsp); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Failure, null); |
| | | if (NSLocale.PreferredLanguages[0].Contains("zh-")) |
| | | { |
| | | rsp.SuccessMessage = "账号未登录"; |
| | | } |
| | | else |
| | | { |
| | | rsp.SuccessMessage = "Not logged in to the app"; |
| | | } |
| | | completion(rsp); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.ContinueInApp, null); |
| | | rsp.SuccessMessage = "Ok"; |
| | | completion(rsp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // "<myApp> John saying hello" |
| | | // "Search for messages in <myApp>" |
| | | [Register("IntentHandler")] |
| | | public class IntentHandler : INExtension, IINSendMessageIntentHandling, IINSearchForMessagesIntentHandling, IINSetMessageAttributeIntentHandling |
| | | public class IntentHandler : INExtension//, IINSendMessageIntentHandling, IINSearchForMessagesIntentHandling, IINSetMessageAttributeIntentHandling |
| | | { |
| | | protected IntentHandler(IntPtr handle) : base(handle) |
| | | { |
| | |
| | | // This is the default implementation. If you want different objects to handle different intents, |
| | | // you can override this and return the handler you want for that particular intent. |
| | | |
| | | //if (intent is HDLRunSceneIntent) |
| | | //{ |
| | | // return new SiriKit.HDLRunSceneIntentHandlder(); |
| | | //} |
| | | if (intent is HDLRunSceneIntent) |
| | | { |
| | | return new HDLRunSceneIntentHandlder(); |
| | | } |
| | | |
| | | return this; |
| | | } |
| | | |
| | | // Implement resolution methods to provide additional information about your intent (optional). |
| | | [Export("resolveRecipientsForSearchForMessages:withCompletion:")] |
| | | public void ResolveRecipients(INSendMessageIntent intent, Action<INPersonResolutionResult[]> completion) |
| | | { |
| | | var recipients = intent.Recipients; |
| | | // If no recipients were provided we'll need to prompt for a value. |
| | | if (recipients.Length == 0) |
| | | { |
| | | completion(new INPersonResolutionResult[] { INPersonResolutionResult.NeedsValue }); |
| | | return; |
| | | } |
| | | //// Implement resolution methods to provide additional information about your intent (optional). |
| | | //[Export("resolveRecipientsForSearchForMessages:withCompletion:")] |
| | | //public void ResolveRecipients(INSendMessageIntent intent, Action<INPersonResolutionResult[]> completion) |
| | | //{ |
| | | // var recipients = intent.Recipients; |
| | | // // If no recipients were provided we'll need to prompt for a value. |
| | | // if (recipients.Length == 0) |
| | | // { |
| | | // completion(new INPersonResolutionResult[] { INPersonResolutionResult.NeedsValue }); |
| | | // return; |
| | | // } |
| | | |
| | | var resolutionResults = new List<INPersonResolutionResult>(); |
| | | // var resolutionResults = new List<INPersonResolutionResult>(); |
| | | |
| | | foreach (var recipient in recipients) |
| | | { |
| | | var matchingContacts = new INPerson[] { recipient }; // Implement your contact matching logic here to create an array of matching contacts |
| | | if (matchingContacts.Length > 1) |
| | | { |
| | | // We need Siri's help to ask user to pick one from the matches. |
| | | resolutionResults.Add(INPersonResolutionResult.GetDisambiguation(matchingContacts)); |
| | | } |
| | | else if (matchingContacts.Length == 1) |
| | | { |
| | | // We have exactly one matching contact |
| | | resolutionResults.Add(INPersonResolutionResult.GetSuccess(recipient)); |
| | | } |
| | | else |
| | | { |
| | | // We have no contacts matching the description provided |
| | | resolutionResults.Add(INPersonResolutionResult.Unsupported); |
| | | } |
| | | } |
| | | // foreach (var recipient in recipients) |
| | | // { |
| | | // var matchingContacts = new INPerson[] { recipient }; // Implement your contact matching logic here to create an array of matching contacts |
| | | // if (matchingContacts.Length > 1) |
| | | // { |
| | | // // We need Siri's help to ask user to pick one from the matches. |
| | | // resolutionResults.Add(INPersonResolutionResult.GetDisambiguation(matchingContacts)); |
| | | // } |
| | | // else if (matchingContacts.Length == 1) |
| | | // { |
| | | // // We have exactly one matching contact |
| | | // resolutionResults.Add(INPersonResolutionResult.GetSuccess(recipient)); |
| | | // } |
| | | // else |
| | | // { |
| | | // // We have no contacts matching the description provided |
| | | // resolutionResults.Add(INPersonResolutionResult.Unsupported); |
| | | // } |
| | | // } |
| | | |
| | | completion(resolutionResults.ToArray()); |
| | | } |
| | | // completion(resolutionResults.ToArray()); |
| | | //} |
| | | |
| | | [Export("resolveContentForSendMessage:withCompletion:")] |
| | | public void ResolveContent(INSendMessageIntent intent, Action<INStringResolutionResult> completion) |
| | | { |
| | | var text = intent.Content; |
| | | if (!string.IsNullOrEmpty(text)) |
| | | completion(INStringResolutionResult.GetSuccess(text)); |
| | | else |
| | | completion(INStringResolutionResult.NeedsValue); |
| | | } |
| | | //[Export("resolveContentForSendMessage:withCompletion:")] |
| | | //public void ResolveContent(INSendMessageIntent intent, Action<INStringResolutionResult> completion) |
| | | //{ |
| | | // var text = intent.Content; |
| | | // if (!string.IsNullOrEmpty(text)) |
| | | // completion(INStringResolutionResult.GetSuccess(text)); |
| | | // else |
| | | // completion(INStringResolutionResult.NeedsValue); |
| | | //} |
| | | |
| | | // Once resolution is completed, perform validation on the intent and provide confirmation (optional). |
| | | [Export("confirmSendMessage:completion:")] |
| | | public void ConfirmSendMessage(INSendMessageIntent intent, Action<INSendMessageIntentResponse> completion) |
| | | { |
| | | // Verify user is authenticated and your app is ready to send a message. |
| | | //// Once resolution is completed, perform validation on the intent and provide confirmation (optional). |
| | | //[Export("confirmSendMessage:completion:")] |
| | | //public void ConfirmSendMessage(INSendMessageIntent intent, Action<INSendMessageIntentResponse> completion) |
| | | //{ |
| | | // // Verify user is authenticated and your app is ready to send a message. |
| | | |
| | | var userActivity = new NSUserActivity("INSendMessageIntent"); |
| | | var response = new INSendMessageIntentResponse(INSendMessageIntentResponseCode.Ready, userActivity); |
| | | completion(response); |
| | | } |
| | | // var userActivity = new NSUserActivity("INSendMessageIntent"); |
| | | // var response = new INSendMessageIntentResponse(INSendMessageIntentResponseCode.Ready, userActivity); |
| | | // completion(response); |
| | | //} |
| | | |
| | | // Handle the completed intent (required). |
| | | public void HandleSendMessage(INSendMessageIntent intent, Action<INSendMessageIntentResponse> completion) |
| | | { |
| | | // Implement your application logic to send a message here. |
| | | //// Handle the completed intent (required). |
| | | //public void HandleSendMessage(INSendMessageIntent intent, Action<INSendMessageIntentResponse> completion) |
| | | //{ |
| | | // // Implement your application logic to send a message here. |
| | | |
| | | var userActivity = new NSUserActivity("INSendMessageIntent"); |
| | | var response = new INSendMessageIntentResponse(INSendMessageIntentResponseCode.Success, userActivity); |
| | | completion(response); |
| | | } |
| | | // var userActivity = new NSUserActivity("INSendMessageIntent"); |
| | | // var response = new INSendMessageIntentResponse(INSendMessageIntentResponseCode.Success, userActivity); |
| | | // completion(response); |
| | | //} |
| | | |
| | | // Implement handlers for each intent you wish to handle. |
| | | // As an example for messages, you may wish to add HandleSearchForMessages and HandleSetMessageAttribute. |
| | | //// Implement handlers for each intent you wish to handle. |
| | | //// As an example for messages, you may wish to add HandleSearchForMessages and HandleSetMessageAttribute. |
| | | |
| | | public void HandleSearchForMessages(INSearchForMessagesIntent intent, Action<INSearchForMessagesIntentResponse> completion) |
| | | { |
| | | // Implement your application logic to find a message that matches the information in the intent. |
| | | //public void HandleSearchForMessages(INSearchForMessagesIntent intent, Action<INSearchForMessagesIntentResponse> completion) |
| | | //{ |
| | | // // Implement your application logic to find a message that matches the information in the intent. |
| | | |
| | | var userActivity = new NSUserActivity("INSearchForMessagesIntent"); |
| | | var response = new INSearchForMessagesIntentResponse(INSearchForMessagesIntentResponseCode.Success, userActivity); |
| | | // var userActivity = new NSUserActivity("INSearchForMessagesIntent"); |
| | | // var response = new INSearchForMessagesIntentResponse(INSearchForMessagesIntentResponseCode.Success, userActivity); |
| | | |
| | | // Initialize with found message's attributes |
| | | var sender = new INPerson(new INPersonHandle("sarah@example.com", INPersonHandleType.EmailAddress), null, "Sarah", null, null, null); |
| | | var recipient = new INPerson(new INPersonHandle("+1-415-555-5555", INPersonHandleType.PhoneNumber), null, "John", null, null, null); |
| | | var message = new INMessage("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson[] { recipient }); |
| | | response.Messages = new INMessage[] { message }; |
| | | completion(response); |
| | | } |
| | | // // Initialize with found message's attributes |
| | | // var sender = new INPerson(new INPersonHandle("sarah@example.com", INPersonHandleType.EmailAddress), null, "Sarah", null, null, null); |
| | | // var recipient = new INPerson(new INPersonHandle("+1-415-555-5555", INPersonHandleType.PhoneNumber), null, "John", null, null, null); |
| | | // var message = new INMessage("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson[] { recipient }); |
| | | // response.Messages = new INMessage[] { message }; |
| | | // completion(response); |
| | | //} |
| | | |
| | | public void HandleSetMessageAttribute(INSetMessageAttributeIntent intent, Action<INSetMessageAttributeIntentResponse> completion) |
| | | { |
| | | // Implement your application logic to set the message attribute here. |
| | | //public void HandleSetMessageAttribute(INSetMessageAttributeIntent intent, Action<INSetMessageAttributeIntentResponse> completion) |
| | | //{ |
| | | // // Implement your application logic to set the message attribute here. |
| | | |
| | | var userActivity = new NSUserActivity("INSetMessageAttributeIntent"); |
| | | var response = new INSetMessageAttributeIntentResponse(INSetMessageAttributeIntentResponseCode.Success, userActivity); |
| | | completion(response); |
| | | } |
| | | // var userActivity = new NSUserActivity("INSetMessageAttributeIntent"); |
| | | // var response = new INSetMessageAttributeIntentResponse(INSetMessageAttributeIntentResponseCode.Success, userActivity); |
| | | // completion(response); |
| | | //} |
| | | } |
| | | } |
New file |
| | |
| | | using System.Collections.Generic; |
| | | using SiriKit; |
| | | |
| | | namespace SiriIntents.Server |
| | | { |
| | | public class HttpServerRequest |
| | | { |
| | | static HttpServerRequest _httpServerRequest; |
| | | public static HttpServerRequest Ins { |
| | | get |
| | | { |
| | | if(_httpServerRequest == null) |
| | | { |
| | | _httpServerRequest = new HttpServerRequest(); |
| | | } |
| | | return _httpServerRequest; |
| | | } |
| | | } |
| | | SceneDateManager _dateManager; |
| | | public SceneDateManager DataManager { |
| | | get |
| | | { |
| | | if(_dateManager== null) |
| | | { |
| | | _dateManager = new SceneDateManager(); |
| | | } |
| | | return _dateManager; |
| | | } |
| | | } |
| | | |
| | | #region ■ 通用请求接口_______________________ |
| | | /// <summary> |
| | | /// 根椐用户账号获取注册区域 免登录 // 检测账号是否注册也用这个接口 |
| | | /// </summary> |
| | | /// <param name="account"></param> |
| | | /// <returns></returns> |
| | | public ResponsePackNew GetRegionByAccount(string account) |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new RegionByAccountObj() { account = account }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_GetRegionByAccount, requestJson, HttpUtil.GlobalRequestHttpsHost); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新Token |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string RefreshToken() |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new RefreshTokenObj() |
| | | { |
| | | refreshToken = DataManager.RefreshToken, |
| | | }); |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_Login, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString()); |
| | | DataManager.RefreshToken = revertData.refreshToken; |
| | | DataManager.AccessToken = revertData.headerPrefix + revertData.accessToken; |
| | | } |
| | | return revertObj.Code; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 执行场景 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string ExecuteScene(string userSceneId) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DataManager.HomeId); |
| | | d.Add("userSceneIds", new List<string>() { userSceneId }); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome( |
| | | NewAPI.Api_Post_ExecuteSecne, requestJson).Code; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 设置安防防区状态 |
| | | /// </summary> |
| | | public ResponsePackNew SetSecurityStatus(List<object> securityStates) |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DataManager.HomeId); |
| | | d.Add("securitys", securityStates); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | var pack = HttpUtil.RequestHttpsPostFroHome( |
| | | NewAPI.Api_Post_Security_StatusSet, requestJson); |
| | | return pack; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Security.Cryptography; |
| | | using System.Text; |
| | | using RestSharp; |
| | | |
| | | namespace SiriIntents.Server |
| | | { |
| | | public class HttpUtil |
| | | { |
| | | |
| | | #region **********全局常量********** |
| | | /// <summary> |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | | public const string RegionMark = "HDL"; |
| | | /// <summary> |
| | | /// 请求超时时间 |
| | | /// </summary> |
| | | public const int TIME_OUT = 15; |
| | | /// <summary> |
| | | /// 特殊接口请求超时时间 |
| | | /// </summary> |
| | | public const int TIME_OUT_LONG = 20; |
| | | /////// <summary> |
| | | /////// Bearer 暂时设为空,从登陆成功的返回的headerPrefix参数动态获取 |
| | | /////// </summary> |
| | | //public const string TOKEN_BEARER = "Bearer "; |
| | | |
| | | #endregion |
| | | |
| | | #region **********网络请求封装********** |
| | | |
| | | |
| | | /// <summary> |
| | | /// POST请求方法 body参数 |
| | | /// 针对住宅相关接口封装 |
| | | /// 调用住宅当前所在区域域名 |
| | | /// 如果是分享住宅,使用主人的token进行相关操作 |
| | | /// </summary> |
| | | /// <param name="apiPath"></param> |
| | | /// <param name="bodyParameterJson"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPostFroHome(string apiPath, string bodyParameterJson, int mTimeout = TIME_OUT) |
| | | { |
| | | string urlHead = HttpServerRequest.Ins.DataManager.RegionUrl; |
| | | //var replaceToken = ""; |
| | | //if (DB_ResidenceData.residenceData.residecenInfo.IsOthreShare) |
| | | //{ |
| | | // replaceToken = DB_ResidenceData.residenceData.MasterToken; |
| | | //} |
| | | return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, "", mTimeout); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// POST请求方法 body参数 |
| | | /// </summary> |
| | | /// <param name="apiPath"></param> |
| | | /// <param name="bodyParameterJson"></param> |
| | | /// <param name="urlHead"></param> |
| | | /// <param name="needErrorTip"></param> |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, string bodyParameterJson, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | return RequestHttps(Method.POST, apiPath, bodyParameterJson, null, null, urlHead, replaceToken, mTimeout); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// POST请求方法 queryDictionary |
| | | /// </summary> |
| | | /// <param name="apiPath"></param> |
| | | /// <param name="queryDictionary"></param> |
| | | /// <param name="urlHead"></param> |
| | | /// <param name="needErrorTip"></param> |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttpsPost(string apiPath, Dictionary<string, object> queryDictionary, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | return RequestHttps(Method.POST, apiPath, null, queryDictionary, null, urlHead, replaceToken, mTimeout); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通用 请求服务器方法 |
| | | /// </summary> |
| | | /// <param name="method"></param> |
| | | /// <param name="apiPath"></param> |
| | | /// <param name="bodyParameterJson"></param> |
| | | /// <param name="queryDictionary"></param> |
| | | /// <param name="urlSegmentDictionary"></param> |
| | | /// <param name="urlHead"></param> |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | static ResponsePackNew RequestHttpsBase(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | //Dome模式登录 |
| | | |
| | | #region HttpWebRequest |
| | | try |
| | | { |
| | | |
| | | string requestFullUrl = urlHead + apiPath; |
| | | |
| | | |
| | | RestClient client = new RestClient(requestFullUrl); |
| | | |
| | | RestRequest request = new RestRequest(method); |
| | | request.Timeout = mTimeout * 1000; |
| | | request.AddHeader("content-type", "application/json"); |
| | | |
| | | request.AddHeader("Authorization", HttpServerRequest.Ins.DataManager.AccessToken); |
| | | |
| | | if (bodyParameterJson != null) |
| | | { |
| | | request.AddParameter("application/json", bodyParameterJson, ParameterType.RequestBody); |
| | | } |
| | | |
| | | if (queryDictionary != null) |
| | | { |
| | | foreach (var data in queryDictionary) |
| | | { |
| | | request.AddQueryParameter(data.Key, data.Value.ToString()); |
| | | } |
| | | } |
| | | |
| | | if (urlSegmentDictionary != null) |
| | | { |
| | | foreach (var data in urlSegmentDictionary) |
| | | { |
| | | request.AddUrlSegment(data.Key, data.Value.ToString()); |
| | | } |
| | | } |
| | | |
| | | IRestResponse response = client.Execute(request); |
| | | if (response.StatusCode == HttpStatusCode.OK) |
| | | { |
| | | try |
| | | { |
| | | ResponsePackNew revertObj = new ResponsePackNew() { }; |
| | | revertObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content); |
| | | //*****一些判空处理***************** |
| | | if (revertObj.Code == null) |
| | | { |
| | | revertObj.Code = StateCode.DATA_EXCEPTION; |
| | | } |
| | | |
| | | if (revertObj.Data == null) |
| | | { |
| | | revertObj.Data = ""; |
| | | } |
| | | //*****一些判空处理***************** |
| | | |
| | | return revertObj; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new ResponsePackNew() { Code = StateCode.DATA_EXCEPTION }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR }; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通用 请求服务器方法 |
| | | /// 增加token过期处理 |
| | | /// </summary> |
| | | /// <param name="method"></param> |
| | | /// <param name="apiPath"></param> |
| | | /// <param name="bodyParameterJson"></param> |
| | | /// <param name="queryDictionary"></param> |
| | | /// <param name="urlSegmentDictionary"></param> |
| | | /// <param name="urlHead"></param> |
| | | /// <param name="replaceToken"></param> |
| | | /// <param name="mTimeout"></param> |
| | | /// <returns></returns> |
| | | public static ResponsePackNew RequestHttps(Method method, string apiPath, string bodyParameterJson = null, Dictionary<string, object> queryDictionary = null, Dictionary<string, object> urlSegmentDictionary = null, string urlHead = "", string replaceToken = "", int mTimeout = TIME_OUT) |
| | | { |
| | | var responsePackNew = RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | //*****************Token过期处理***************** |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | { |
| | | //刷新Token |
| | | if (RefreshToken()) { |
| | | return RequestHttpsBase(method, apiPath, bodyParameterJson, queryDictionary, urlSegmentDictionary, urlHead, replaceToken, mTimeout); |
| | | } |
| | | else |
| | | { |
| | | return responsePackNew; |
| | | } |
| | | } |
| | | //*****************Token过期处理***************** |
| | | return responsePackNew; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 刷新 Token |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | static bool RefreshToken() |
| | | { |
| | | try |
| | | { |
| | | var requestJson = GetSignRequestJson(new RefreshTokenObj() |
| | | { |
| | | refreshToken = HttpServerRequest.Ins.DataManager.RefreshToken, |
| | | }); |
| | | var revertObj = RequestHttpsBase(Method.POST, NewAPI.API_POST_Login, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(revertObj.Data.ToString()); |
| | | HttpServerRequest.Ins.DataManager.AccessToken = revertData.headerPrefix + revertData.accessToken; |
| | | HttpServerRequest.Ins.DataManager.RefreshToken = revertData.refreshToken; |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | catch |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region **********签名校验********** |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | static string GetTimestamp() |
| | | { |
| | | System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 当地时区 |
| | | return ((long)(DateTime.Now - startTime).TotalMilliseconds).ToString(); // 相差秒数 |
| | | //return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 相差秒数 |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="signstr"></param> |
| | | /// <returns></returns> |
| | | static string SignMD5Encrypt(string s) |
| | | { |
| | | byte[] sign = MD5.Create().ComputeHash(UTF8Encoding.UTF8.GetBytes(s)); |
| | | string signstr = string.Empty; |
| | | foreach (byte item in sign) |
| | | { |
| | | signstr += item.ToString("X2"); |
| | | } |
| | | return signstr.ToLower(); |
| | | } |
| | | /// <summary> |
| | | /// 判断当前值是否需要参与签名,保持跟云端一致 |
| | | /// 空字符串不参与 |
| | | /// 数组,集合,对象不参与 |
| | | /// </summary> |
| | | /// <param name="valueStr"></param> |
| | | /// <returns></returns> |
| | | static bool IfValueNeedSign(string valueStr) |
| | | { |
| | | if (string.IsNullOrEmpty(valueStr) || valueStr.StartsWith("{") || valueStr.StartsWith("[")) |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | /// <summary> |
| | | /// 2020-11-02 |
| | | /// 基础服务的接口都要校验sign |
| | | /// 计算sign签名 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static string GetSignRequestJson(object requestObj,Dictionary<string,object> paramDictionary = null) |
| | | { |
| | | try |
| | | { |
| | | //1. 将model实体转为Dictionary<string, object> |
| | | if (paramDictionary == null) |
| | | { |
| | | paramDictionary = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(Newtonsoft.Json.JsonConvert.SerializeObject(requestObj)); |
| | | } |
| | | //2. 计算sign |
| | | if (paramDictionary != null) |
| | | { |
| | | paramDictionary.Add("appKey", APP_KEY); |
| | | paramDictionary.Add("timestamp", GetTimestamp()); |
| | | //2.1 字典升序 |
| | | paramDictionary = paramDictionary.OrderBy(o => o.Key).ToDictionary(o => o.Key, p => p.Value); |
| | | //2.2 拼接按URL键值对 |
| | | string str = string.Empty; |
| | | foreach (KeyValuePair<string, object> item in paramDictionary) |
| | | { |
| | | //Value为null不参加校验 |
| | | if (item.Value != null) |
| | | { |
| | | //Value.ToString()为null或者""也不参加校验 |
| | | //if (!string.IsNullOrEmpty(item.Value.ToString()) && (item.Value is string || item.Value.GetType().IsValueType)) |
| | | //{ |
| | | //检测当前参数是否需要参与校验 |
| | | if (IfValueNeedSign(item.Value.ToString())) |
| | | { |
| | | //如果是bool类型,要转小写 |
| | | if (item.Value is bool) |
| | | { |
| | | str += item.Key + "=" + item.Value.ToString().ToLower() + "&"; |
| | | } |
| | | else |
| | | { |
| | | str += item.Key + "=" + item.Value.ToString() + "&"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //2.3 拼接SECRET_KEY |
| | | str = str.Substring(0, str.Length - 1) + SECRET_KEY; |
| | | //2.4 MD5转换+转小写 |
| | | var signstr = SignMD5Encrypt(str); |
| | | paramDictionary.Add("sign", signstr); |
| | | var signResult = Newtonsoft.Json.JsonConvert.SerializeObject(paramDictionary); |
| | | return signResult; |
| | | } |
| | | else |
| | | { |
| | | return ""; |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 响应参数 |
| | | /// </summary> |
| | | [Serializable] |
| | | public class ResponsePackNew |
| | | { |
| | | /// <summary> |
| | | /// 响应状态码 |
| | | /// </summary> |
| | | public string Code; |
| | | |
| | | /// <summary> |
| | | /// 响应内容 |
| | | /// </summary> |
| | | public object Data; |
| | | |
| | | /// <summary> |
| | | /// 响应错误信息 |
| | | /// </summary> |
| | | public string message = ""; |
| | | |
| | | /// <summary> |
| | | /// 这个是请求错误时的扩展数据,以后所有的附带扩展数据都会放在这里面动态维护 |
| | | /// </summary> |
| | | public object extra; |
| | | |
| | | ///// <summary> |
| | | ///// isSuccess |
| | | ///// </summary> |
| | | //public bool isSuccess; |
| | | |
| | | ///// <summary> |
| | | ///// timestamp |
| | | ///// </summary> |
| | | //public string timestamp; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace SiriIntents.Server |
| | | { |
| | | /// <summary> |
| | | /// 接口类的返回信息 |
| | | /// </summary> |
| | | public class IMessageCommon |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 接口类的返回信息 |
| | | /// </summary> |
| | | private static IMessageCommon m_Current = null; |
| | | /// <summary> |
| | | /// 接口类的返回信息 |
| | | /// </summary> |
| | | public static IMessageCommon Current |
| | | { |
| | | get |
| | | { |
| | | if (m_Current == null) |
| | | { |
| | | m_Current = new IMessageCommon(); |
| | | } |
| | | return m_Current; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否在获取token |
| | | /// </summary> |
| | | public bool isGetingToken; |
| | | |
| | | /// <summary> |
| | | /// 无视错误(访问云端时,此操作将不会弹出错误) |
| | | /// </summary> |
| | | public bool IgnoreError = false; |
| | | |
| | | ///// <summary> |
| | | ///// 全部信息 |
| | | ///// </summary> |
| | | //private Dictionary<string, Dictionary<string, int>> dicMsg = null; |
| | | |
| | | /// <summary> |
| | | /// 通用错误码 |
| | | /// </summary> |
| | | private Dictionary<string, int> stateCodeDic = null; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据接口的状态码,翻译返回信息 |
| | | /// </summary> |
| | | /// <param name="requestName">接口</param> |
| | | /// <param name="revertObj">云端返回的数据</param> |
| | | /// <param name="pra">请求参数</param> |
| | | /// <returns></returns> |
| | | public string GetMsgByRequestName(string statuCode) |
| | | { |
| | | if (IgnoreError == true) |
| | | { |
| | | //无视错误 |
| | | return null; |
| | | } |
| | | |
| | | //共通码 |
| | | if (stateCodeDic.ContainsKey(statuCode) == true) |
| | | { |
| | | return "-1";// Language.StringByID(stateCodeDic[statuCode]); |
| | | } |
| | | |
| | | //if (dicMsg.ContainsKey(requestName) == true && dicMsg[requestName].ContainsKey(statuCode) == true) |
| | | //{ |
| | | // //在册的Msg |
| | | // return Language.StringByID(dicMsg[requestName][statuCode]); |
| | | //} |
| | | |
| | | return "-1";//Language.StringByID(StringId.FailedRequestServer) + "\n(" + statuCode + ")"; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// StartRefreshToken |
| | | /// </summary> |
| | | public void StartRefreshToken() |
| | | { |
| | | if (isGetingToken) return; |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | isGetingToken = true; |
| | | |
| | | try |
| | | { |
| | | var success = new HttpServerRequest().RefreshToken(); |
| | | } |
| | | catch |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | isGetingToken = false; |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 常用状态码管理 |
| | | /// </summary> |
| | | public class StateCode |
| | | { |
| | | /// <summary> |
| | | /// 网络请求异常 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string NETWORK_ERROR = "-1"; |
| | | /// <summary> |
| | | /// 数据解析错误 |
| | | /// APP自定义错误码 |
| | | /// </summary> |
| | | public const string DATA_EXCEPTION = "-2"; |
| | | /// <summary> |
| | | /// 请求成功的状态码 |
| | | /// </summary> |
| | | public const string SUCCESS = "0"; |
| | | /// <summary> |
| | | /// 验证码校验失败 |
| | | /// </summary> |
| | | public const string VERIFICATION_CODE_WRONG = "14"; |
| | | /// <summary> |
| | | /// 会话超时,请更新token |
| | | /// </summary> |
| | | public const string TOKEN_EXPIRED = "10001"; |
| | | /// <summary> |
| | | /// 账号不存在的错误码 |
| | | /// </summary> |
| | | public const string ACCOUNT_NOT_EXIST = "10010"; |
| | | /// <summary> |
| | | /// 登录锁定,密码错误次数过多 |
| | | /// 密码输入错误超过10次,请30分钟后重试! |
| | | /// </summary> |
| | | public const string AccountLoginLock = "10019"; |
| | | |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | |
| | | namespace SiriIntents.Server |
| | | { |
| | | public class NewAPI |
| | | { |
| | | //#region 新微服务接口 |
| | | //*********************************************** |
| | | //注意:和住宅相关的接口要请求住宅所在区域的域名 regionUrl |
| | | //*********************************************** |
| | | #region ■ RegionCluster -- 全球区域列表___________________________ |
| | | /// <summary> |
| | | /// 根椐用户账号获取注册区域 免登录 // 检测账号是否注册也用这个接口 |
| | | /// </summary> |
| | | public const string API_POST_GetRegionByAccount = "/smart-footstone/region/regionByAccount"; |
| | | /// <summary> |
| | | /// 获取全球区域列表 免登录 |
| | | /// </summary> |
| | | public const string API_POST_GlobalRegionList = "/smart-footstone/region/globalRegionList"; |
| | | #endregion |
| | | |
| | | #region ■ AcCluster -- 登录和注册部分___________________________ |
| | | /// <summary> |
| | | /// 帐号登录 |
| | | /// </summary> |
| | | public const string API_POST_Login = "/smart-footstone/member/oauth/login"; |
| | | /// <summary> |
| | | /// 输入验证码注册 |
| | | /// </summary> |
| | | public const string API_POST_Member_Register = "/smart-footstone/member/oauth/register"; |
| | | /// <summary> |
| | | /// 用户找回密码 |
| | | /// </summary> |
| | | public const string API_POST_Member_ForgetPwd = "/smart-footstone/member/oauth/forgetPwd"; |
| | | /// <summary> |
| | | /// 修改密码 |
| | | /// </summary> |
| | | public const string API_POST_Update_Pwd = "/smart-footstone/member/memberInfo/updatePwd"; |
| | | /// <summary> |
| | | /// 发送验证码 |
| | | /// </summary> |
| | | public const string API_POST_Verification_Send = "/smart-footstone/verification/message/send"; |
| | | /// <summary> |
| | | /// 验证消息验证码 |
| | | /// </summary> |
| | | public const string API_POST_Verification_Check = "/smart-footstone/verification/message/check"; |
| | | #region 用户信息、头像、绑定认证(手机/邮箱) |
| | | /// <summary> |
| | | /// 获取个人信息 |
| | | /// </summary> |
| | | public const string API_POST_Member_GetMemberInfo = "/smart-footstone/member/memberInfo/getMemberInfo"; |
| | | /// <summary> |
| | | /// 更新个人信息 |
| | | /// </summary> |
| | | public const string API_POST_Member_UpdateMemberInfo = "/smart-footstone/member/memberInfo/updateMemberInfo"; |
| | | /// <summary> |
| | | /// 根据账号获取个人信息 |
| | | /// </summary> |
| | | public const string API_POST_Member_GetMemberInfoByAccount = "/smart-footstone/member/memberInfo/getMemberInfoByAccount"; |
| | | ///// <summary> |
| | | ///// 上传头像 |
| | | ///// </summary> |
| | | //public const string API_POST_Head_Upload = "/home-wisdom/app/head/portrait/upload"; |
| | | ///// <summary> |
| | | ///// 下载头像 |
| | | ///// </summary> |
| | | //public const string API_POST_Head_Down = "/home-wisdom/app/head/portrait/down"; |
| | | ///// <summary> |
| | | ///// 根据账号下载头像 |
| | | ///// </summary> |
| | | //public const string API_POST_Head_DownWithAccount = "/home-wisdom/app/head/portrait/downWithAccount"; |
| | | /// <summary> |
| | | /// 绑定认证(手机/邮箱) |
| | | /// </summary> |
| | | public const string API_POST_Member_BindWithAccount = "/smart-footstone/member/memberInfo/bindWithAccount"; |
| | | /// <summary> |
| | | /// 解绑认证(手机/邮箱) |
| | | /// </summary> |
| | | public const string API_POST_Member_UnbindWithAccount = "/smart-footstone/member/memberInfo/unbindWithAccount"; |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 查询功能介绍列表 |
| | | /// </summary> |
| | | public const string API_POST_FunctionIntroductionList = "/home-wisdom/app/functionIntroduction/list"; |
| | | #endregion |
| | | |
| | | #region ■ HomeCluster -- 住宅管理接口___________________________ |
| | | |
| | | /// <summary> |
| | | /// 绑定住宅 |
| | | /// </summary> |
| | | public const string Api_Post_BindlingResidence = "/app/home/deliver"; |
| | | /// <summary> |
| | | /// 获取住宅分页 |
| | | /// </summary> |
| | | public const string API_POST_Gethomepager = "/home-wisdom/app/home/list"; |
| | | /// <summary> |
| | | /// 删除住宅 |
| | | /// </summary> |
| | | public const string API_POST_Home_Delete = "/home-wisdom/app/home/delete"; |
| | | /// <summary> |
| | | /// 更新住宅 |
| | | /// </summary> |
| | | public const string API_POST_Home_UpdateHome = "/home-wisdom/app/home/update"; |
| | | /// <summary> |
| | | /// 住宅迁移 |
| | | /// </summary> |
| | | public const string API_POST_Home_Transfer = "/home-wisdom/app/home/transfer"; |
| | | /// <summary> |
| | | /// 更改住宅权限 |
| | | /// </summary> |
| | | public const string API_Post_Home_UpdateDebugPerm = "/home-wisdom/app/home/updateDebugPerm"; |
| | | /// <summary> |
| | | /// 过户 |
| | | /// </summary> |
| | | public const string API_Post_TransferResidence = "/home-wisdom/app/home/transfer"; |
| | | /// <summary> |
| | | /// 管理员权限迁移 |
| | | /// </summary> |
| | | public const string API_Post_AdminAuthorityMigration = "/home-wisdom/app/home/ownerConvert"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 子账号 -- 添加住宅成员___________________________ |
| | | /// <summary> |
| | | /// 添加子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_Add = "/home-wisdom/app/child/account/add"; |
| | | /// <summary> |
| | | /// 删除子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_Delete = "/home-wisdom/app/child/account/delete"; |
| | | /// <summary> |
| | | /// 根据住宅 id 查询所有的子账户 |
| | | /// </summary> |
| | | public const string API_POST_Child_FindAll = "/home-wisdom/app/child/account/findAll"; |
| | | /// <summary> |
| | | /// 更新远程控制 |
| | | /// </summary> |
| | | public const string API_POST_Child_Update = "/home-wisdom/app/child/account/update"; |
| | | /// <summary> |
| | | /// 子账号管理员获取主账号授权Token |
| | | /// </summary> |
| | | public const string API_POST_Child_GetMasterToken = "/home-wisdom/app/child/account/masterToken/get"; |
| | | ///// <summary> |
| | | ///// 下载子账号头像 |
| | | ///// </summary> |
| | | //public const string API_POST_Child_DownloadHeadImage = "/home-wisdom/app/child/account/getHeadPortrait"; |
| | | /// <summary> |
| | | /// 下载账号头像 |
| | | /// </summary> |
| | | public const string API_POST_DownloadHeadImage = "/home-wisdom/app/head/portrait/downWithAccount"; |
| | | |
| | | #region 数据分享 |
| | | /// <summary> |
| | | /// 分享指定文件给指定成员 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_Add = "/home-wisdom/app/home/share/add"; |
| | | /// <summary> |
| | | /// 查询指定成员的所有分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_FindAll = "/home-wisdom/app/home/share/findAll"; |
| | | /// <summary> |
| | | /// 下载指定的分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_DownOne = "/home-wisdom/app/home/share/downOne"; |
| | | /// <summary> |
| | | /// 删除指定的分享文件 |
| | | /// </summary> |
| | | public const string API_POST_Home_Share_Delete = "/home-wisdom/app/home/share/delete"; |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region ■ GatewayCluster -- 网关___________________________ |
| | | ///// <summary> |
| | | ///// 绑定网关到住宅 |
| | | ///// </summary> |
| | | //public const string API_POST_BindGateway = "/home-wisdom/app/gateway/bindGateway"; |
| | | /// <summary> |
| | | /// 获取住宅网关分页 |
| | | /// </summary> |
| | | public const string API_POST_GetGatewayList = "/home-wisdom/app/gateway/getGatewayList"; |
| | | /// <summary> |
| | | /// 获取网关信息 |
| | | /// </summary> |
| | | public const string Api_Post_GetGatewayInfo = "/home-wisdom/app/gateway/info"; |
| | | ///// <summary> |
| | | ///// 解绑绑网关到住宅 |
| | | ///// </summary> |
| | | public const string API_POST_UntieGateway = "/home-wisdom/app/gateway/untieGateway"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ GatewayCenterCluster -- 网关中心服务器___________________________ |
| | | ///// <summary> |
| | | ///// 网关登录 |
| | | ///// </summary> |
| | | //public const string API_POST_GatewayLogin = "/GatewayCenterCluster/V1/gatewayLogin"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ ClientCenterCluster -- 客户端中心服务器___________________________ |
| | | /// <summary> |
| | | /// 获取远程连接 |
| | | /// </summary> |
| | | public const string API_POST_GetMqttRemoteInfo = "/home-wisdom/app/mqtt/getRemoteInfo"; |
| | | #endregion |
| | | |
| | | #region ■ HomebackupCluster -- 住宅备份微服务___________________________ |
| | | ///// <summary> |
| | | ///// 创建文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_Create = "/home-wisdom/app/backup/folder/create"; |
| | | |
| | | ///// <summary> |
| | | ///// 删除文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_Delete = "/home-wisdom/app/backup/folder/delete"; |
| | | |
| | | ///// <summary> |
| | | ///// 查找所有文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_FindAll = "/home-wisdom/app/backup/folder/findAll"; |
| | | |
| | | ///// <summary> |
| | | ///// 更新文件夹 |
| | | ///// </summary> |
| | | //public const string API_POST_Folder_Update = "/home-wisdom/app/backup/folder/update"; |
| | | |
| | | ///// <summary> |
| | | ///// 上传文件 |
| | | ///// </summary> |
| | | //public const string API_POST_File_Create = "/home-wisdom/app/backup/file/create"; |
| | | |
| | | /////// <summary> |
| | | /////// 删除文件 |
| | | /////// </summary> |
| | | ////public const string API_DELETE_File_Delete = "/HomebackupCluster/V1/file/delete"; |
| | | |
| | | ///// <summary> |
| | | ///// 下载备份文件 |
| | | ///// </summary> |
| | | //public const string API_POST_File_Down = "/home-wisdom/app/backup/file/downOne"; |
| | | |
| | | ///// <summary> |
| | | ///// 查询一个文件夹所有文件名 |
| | | ///// </summary> |
| | | //public const string API_POST_File_FindAll = "/home-wisdom/app/backup/file/findAll"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ Speaker -- 语音控制服务___________________________ |
| | | /// <summary> |
| | | /// 获取已授权的音箱列表 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_List_Get = "/smart-footstone/app/token/list"; |
| | | /// <summary> |
| | | /// 编辑音箱授权备注 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_Remark_Update = "/smart-footstone/app/token/update"; |
| | | /// <summary> |
| | | /// 解绑音箱 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_Unbind = "/smart-footstone/app/token/delete"; |
| | | /// <summary> |
| | | /// 获取音箱分配的设备和场景列表 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_DeviceList_Get = "/home-wisdom/app/tokenRelation/list"; |
| | | /// <summary> |
| | | /// 更新音箱控制的设备和场景目标 |
| | | /// </summary> |
| | | public const string API_POST_Speaker_DeviceList_Update = "/home-wisdom/app/tokenRelation/save"; |
| | | #endregion |
| | | |
| | | #region ■ PushSerivce -- 推送服务接口___________________________ |
| | | |
| | | /// <summary> |
| | | /// 注册推送接口 |
| | | /// 批量推送绑定家居社区接口 |
| | | /// 2021-09-09 对接新接口支持物业公告推送 |
| | | /// communityCodes 不传 默认所有住宅或者小区都收到推送 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_AddToken = "/smart-footstone/app/push-information/addPushToken"; |
| | | /// <summary> |
| | | /// 注销推送接口 |
| | | /// 批量解绑家居社区 |
| | | /// 2021-09-09 对接新接口支持物业公告推送 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/unBindPushToken"; |
| | | ///// <summary> |
| | | ///// 添加推送Token |
| | | ///// </summary> |
| | | //public const string API_POST_PushSerivce_AddToken = "/smart-footstone/app/push-information/add"; |
| | | ///// <summary> |
| | | ///// 删除推送Token |
| | | ///// </summary> |
| | | //public const string API_POST_PushSerivce_DeleteToken = "/smart-footstone/app/push-information/delete"; |
| | | ///// <summary> |
| | | /////// 获取推送消息记录 |
| | | /////// </summary> |
| | | //public const string API_POST_PushSerivce_Getpushmessagelist = "/smart-footstone/app/message/list"; |
| | | /// <summary> |
| | | /// 获取推送消息记录 分页 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_Getpushmessagelist_Paging = "/smart-footstone/app/message/page"; |
| | | /// <summary> |
| | | /// 清空推送的消息记录 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_Clearmessagelist = "/smart-footstone/app/message/clear"; |
| | | /// <summary> |
| | | /// 标记消息已读 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_Markread = "/smart-footstone/app/message/read"; |
| | | /// <summary> |
| | | /// 标记消息全部已读 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_ALLMarkread = "/smart-footstone/app/message/read_all"; |
| | | /// <summary> |
| | | /// 通过主键id删除一条推送记录 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_Deletepushinfo = "/smart-footstone/app/message/delete_by_id"; |
| | | /// <summary> |
| | | /// 获取物业公告详情 |
| | | /// </summary> |
| | | public const string API_POST_PushSerivce_GetNoticeInfo = "/community-footstone/app/notice/info"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- 检测更新接口___________________________ |
| | | /// <summary> |
| | | /// 检测更新,是否需要强制更新 |
| | | /// </summary> |
| | | public const string API_POST_CheckAppVersion = "/smart-footstone/app/appVersion/check"; |
| | | ///// <summary> |
| | | ///// 查询APP最新版本 |
| | | ///// </summary> |
| | | //public const string API_POST_GetAppVersion = "/smart-footstone/app/getAppVersion"; |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region ■ -- 房间场景背景图片上传下载接口___________________________ |
| | | /// <summary> |
| | | /// 上传图片 |
| | | /// </summary> |
| | | public const string API_POST_UploadImage = "/home-wisdom/app/images/upload_image"; |
| | | /// <summary> |
| | | /// 查询图片路径 |
| | | /// </summary> |
| | | public const string API_POST_GetImageUrl = "/home-wisdom/app/images/get_image_url"; |
| | | #endregion |
| | | |
| | | |
| | | #region Kaede -- 设备接口____________________________ |
| | | /// <summary> |
| | | /// 获取设备列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetDevcieList = "/home-wisdom/app/device/list"; |
| | | /// <summary> |
| | | /// 获取第三方品牌设备列表 |
| | | /// </summary> |
| | | public const string Api_Post_Get3tyBrandDevcieList = "/home-wisdom/app/product/list"; |
| | | /// <summary> |
| | | /// 注册第三方设备 |
| | | /// </summary> |
| | | public const string Api_Post_IndependentRegister3TyDevcie = "/home-wisdom/app/device/independentRegister"; |
| | | /// <summary> |
| | | /// 获取设备详情 |
| | | /// </summary> |
| | | public const string Api_Post_GetDevcieInfoList = "/home-wisdom/app/device/info"; |
| | | |
| | | /// <summary> |
| | | /// 刷新设备状 |
| | | /// </summary> |
| | | public const string Api_Post_RefreshDeviceStatus = "/home-wisdom/app/device/status/refresh"; |
| | | /// <summary> |
| | | /// 设备控制 |
| | | /// </summary> |
| | | public const string Api_Post_ControlDevice = "/home-wisdom/app/device/control"; |
| | | /// <summary> |
| | | /// 编辑设备信息 |
| | | /// </summary> |
| | | public const string Api_Post_EditDevice = "/home-wisdom/app/device/edit"; |
| | | /// <summary> |
| | | /// 设备绑定房间 |
| | | /// </summary> |
| | | public const string Api_Post_BindDeviceToRoom = "/home-wisdom/app/device/bindRoom"; |
| | | /// <summary> |
| | | /// 设备解绑房间 |
| | | /// </summary> |
| | | public const string Api_Post_UnbindDeviceToRoom = "/home-wisdom/app/device/unbindRoom"; |
| | | /// <summary> |
| | | /// 设备名称修改 |
| | | /// </summary> |
| | | public const string Api_Post_EditDeviceName = "/home-wisdom/app/device/rename"; |
| | | /// <summary> |
| | | /// 收藏设备 |
| | | /// </summary> |
| | | public const string Api_Post_CollectDevice = "/home-wisdom/app/device/collect"; |
| | | /// <summary> |
| | | /// 取消收藏设备 |
| | | /// </summary> |
| | | public const string Api_Post_CancelCollectDevice = "/home-wisdom/app/device/cancelCollect"; |
| | | /// <summary> |
| | | /// 获取环境传感器历史数据 小时/周/月统计数据 |
| | | /// </summary> |
| | | public const string Api_Post_EnvironmentalSensorHistoricalData = "/home-wisdom/app/statistics/device/hourWeekMonth"; |
| | | /// <summary> |
| | | /// 获取安防传感器历史数据 |
| | | /// </summary> |
| | | public const string Api_Post_ArmSensorHistoricalData = "/home-wisdom/app/device/message"; |
| | | /// <summary> |
| | | /// 读取最近一个月的数据 |
| | | /// </summary> |
| | | public const string Api_Post_SensorLastMonthHistoricalData = "/home-wisdom/app/statistics/device/monthDiff"; |
| | | #endregion |
| | | |
| | | #region Kaede -- 场景接口____________________________ |
| | | /// <summary> |
| | | /// 获取场景列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetSecneList = "/home-wisdom/app/scene/list"; |
| | | /// <summary> |
| | | /// 获取场景详情 |
| | | /// </summary> |
| | | public const string Api_Post_GetSecneInfo = "/home-wisdom/app/scene/info"; |
| | | /// <summary> |
| | | /// 添加场景 |
| | | /// </summary> |
| | | public const string Api_Post_AddSecne = "/home-wisdom/app/scene/add"; |
| | | /// <summary> |
| | | /// 编辑场景 |
| | | /// </summary> |
| | | public const string Api_Post_EditSecne = "/home-wisdom/app/scene/update"; |
| | | /// <summary> |
| | | /// 删除场景 |
| | | /// </summary> |
| | | public const string Api_Post_DeleteSecne = "/home-wisdom/app/scene/delete"; |
| | | /// <summary> |
| | | /// 执行场景 |
| | | /// </summary> |
| | | public const string Api_Post_ExecuteSecne = "/home-wisdom/app/scene/execute"; |
| | | /// <summary> |
| | | /// 收藏场景 |
| | | /// </summary> |
| | | public const string Api_Post_CollectScene = "/home-wisdom/app/scene/collect"; |
| | | /// <summary> |
| | | /// 取消收藏场景 |
| | | /// </summary> |
| | | public const string Api_Post_CancelCollectScene = "/home-wisdom/app/scene/cancelCollect"; |
| | | #endregion |
| | | |
| | | #region Kaede -- 房间接口____________________________ |
| | | /// <summary> |
| | | /// 获取设备列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetRoomList = "/home-wisdom/app/room/list"; |
| | | /// <summary> |
| | | /// 添加房间 |
| | | /// </summary> |
| | | public const string Api_Post_AddRoom = "/home-wisdom/app/room/add"; |
| | | /// <summary> |
| | | /// 删除房间 |
| | | /// </summary> |
| | | public const string Api_Post_DelRoom = "/home-wisdom/app/room/delete"; |
| | | /// <summary> |
| | | /// 修改房间 |
| | | /// </summary> |
| | | public const string Api_Post_UpdateRoom = "/home-wisdom/app/room/update"; |
| | | |
| | | #endregion |
| | | |
| | | #region Kaede -- 安防接口____________________________ |
| | | /// <summary> |
| | | /// 获取安防列表 |
| | | /// </summary> |
| | | public const string Api_Post_Security_List = "/home-wisdom/app/security/list"; |
| | | /// <summary> |
| | | /// 获取安防详情 |
| | | /// </summary> |
| | | public const string Api_Post_Security_Info = "/home-wisdom/app/security/info"; |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | public const string Api_Post_Security_Add = "/home-wisdom/app/security/add"; |
| | | /// <summary> |
| | | /// 编辑安防 |
| | | /// </summary> |
| | | public const string Api_Post_Security_Edit = "/home-wisdom/app/security/edit"; |
| | | /// <summary> |
| | | /// 删除安防 |
| | | /// </summary> |
| | | public const string Api_Post_Security_Delete = "/home-wisdom/app/security/delete"; |
| | | /// <summary> |
| | | /// 读取安防防区状态 |
| | | /// </summary> |
| | | public const string Api_Post_Security_StatusRead = "/home-wisdom/app/security/statusRead"; |
| | | /// <summary> |
| | | /// 设置安防防区状态 |
| | | /// </summary> |
| | | public const string Api_Post_Security_StatusSet = "/home-wisdom/app/security/statusSet"; |
| | | /// <summary> |
| | | /// 安防bypass设置 |
| | | /// </summary> |
| | | public const string Api_Post_Security_BypassSet = "/home-wisdom/app/security/bypassSet"; |
| | | /// <summary> |
| | | /// 安防bypass读取 |
| | | /// </summary> |
| | | public const string Api_Post_Security_BypassRead = "/home-wisdom/app/security/bypassRead"; |
| | | /// <summary> |
| | | /// 查询安防所有记录 |
| | | /// </summary> |
| | | public const string Api_Post_Security_ListSecurityLog = "/home-wisdom/app/security/listSecurityLog"; |
| | | /// <summary> |
| | | /// 查询安防报警记录 |
| | | /// </summary> |
| | | public const string Api_Post_Security_ListAlarmLog = "/home-wisdom/app/security/listAlarmLog"; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 房间、设备、场景分享___________________________ |
| | | /// <summary> |
| | | /// 添加分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_Add = "/home-wisdom/app/share/add"; |
| | | /// <summary> |
| | | /// 删除分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_Delete = "/home-wisdom/app/share/delete"; |
| | | /// <summary> |
| | | /// 获取分享 |
| | | /// </summary> |
| | | public const string API_POST_Share_GetList = "/home-wisdom/app/share/list"; |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 自动化接口___________________________ |
| | | /// <summary> |
| | | /// 获取自动化列表 |
| | | /// </summary> |
| | | public const string API_POST_Logic_List = "/home-wisdom/app/logic/list"; |
| | | /// <summary> |
| | | ///获取自动化详情 |
| | | /// </summary> |
| | | public const string API_POST_Logic_Info = "/home-wisdom/app/logic/info"; |
| | | /// <summary> |
| | | /// 添加自动化 |
| | | /// </summary> |
| | | public const string API_POST_Logic_Add = "/home-wisdom/app/logic/add"; |
| | | /// <summary> |
| | | /// 编辑自动化 |
| | | /// </summary> |
| | | public const string API_POST_Logic_Update = "/home-wisdom/app/logic/update"; |
| | | /// <summary> |
| | | /// 删除自动化 |
| | | /// </summary> |
| | | public const string API_POST_Logic_Delete = "/home-wisdom/app/logic/delete"; |
| | | /// <summary> |
| | | /// 启用禁用自动化 |
| | | /// </summary> |
| | | public const string API_POST_Logic_Enable = "/home-wisdom/app/logic/enable"; |
| | | #endregion |
| | | |
| | | #region -- 第三方设备相关接口___________________________ |
| | | /// <summary> |
| | | /// 获取添加过的品牌列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetBindBrandList = "/home-wisdom/app/product/brand/bindList"; |
| | | /// <summary> |
| | | /// 获取品牌列表 |
| | | /// </summary> |
| | | public const string Api_Post_GetBrandList = "/home-wisdom/app/product/brand/list"; |
| | | |
| | | #region ■ -- 红外宝接口___________________________ |
| | | /// <summary> |
| | | /// 红外宝设备定位 |
| | | /// </summary> |
| | | public const string API_POST_Ir_DeviceFind = "/home-wisdom/app/device/ir/deviceFind"; |
| | | /// <summary> |
| | | /// 红外宝下的遥控器列表 |
| | | /// </summary> |
| | | public const string API_POST_Ir_List = ":/home-wisdom/app/device/ir/list"; |
| | | /// <summary> |
| | | /// 遥控器红外码学习 |
| | | /// </summary> |
| | | public const string API_POST_Ir_CodeStudy = "/home-wisdom/app/device/ir/codeStudy"; |
| | | /// <summary> |
| | | ///红外宝红外码库试码 |
| | | /// </summary> |
| | | public const string API_POST_Ir_CodeTest = "/home-wisdom/app/device/ir/codeTest"; |
| | | /// <summary> |
| | | /// 红外宝遥控器添加 |
| | | /// </summary> |
| | | public const string API_POST_Ir_Add = "/home-wisdom/app/device/ir/add"; |
| | | /// <summary> |
| | | /// 遥控器自学按键删除 |
| | | /// </summary> |
| | | public const string API_POST_Ir_CodeRemove = "/home-wisdom/app/device/ir/codeRemove"; |
| | | /// <summary> |
| | | /// 获取设备详情通过(spk,sid) |
| | | /// </summary> |
| | | public const string Api_Post_GetinfoBySid = "/home-wisdom/app/device/infoBySid"; |
| | | /// <summary> |
| | | /// 红外宝/遥控器删除 |
| | | /// </summary> |
| | | public const string API_POST_Ir_DeviceDel = "/home-wisdom/app/device/remove"; |
| | | /// <summary> |
| | | /// 修改设备名称 |
| | | /// </summary> |
| | | public const string API_POST_Ir_DeviceRename = "/home-wisdom/app/device/rename"; |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 萤石SDK相关接口___________________________ |
| | | /// <summary> |
| | | /// 河东获取萤石云子账号token的接口 |
| | | /// </summary> |
| | | public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/yingshi/child/token"; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- 丰林相关相关接口___________________________ |
| | | /// <summary> |
| | | /// 检查住宅是否绑定丰林,并获取门口机列表 |
| | | /// </summary> |
| | | public const string API_POST_FL_Check = "/home-wisdom/app/fl/vi/check"; |
| | | /// <summary> |
| | | /// 接听 |
| | | /// </summary> |
| | | public const string API_POST_FL_Answer = "/home-wisdom/app/fl/vi/answer"; |
| | | /// <summary> |
| | | /// 拒接 |
| | | /// </summary> |
| | | public const string API_POST_FL_Reject = "/home-wisdom/app/fl/vi/reject"; |
| | | /// <summary> |
| | | /// 开锁成功 |
| | | /// </summary> |
| | | public const string API_POST_FL_Unlock = "/home-wisdom/app/fl/vi/unlock"; |
| | | /// <summary> |
| | | /// 通话视频截图上传 |
| | | /// </summary> |
| | | public const string API_POST_FL_Screenshot = "/home-wisdom/app/fl/vi/screenshot"; |
| | | /// <summary> |
| | | /// 挂断 |
| | | /// </summary> |
| | | public const string API_POST_FL_HangUp = "/home-wisdom/app/fl/vi/hang-up"; |
| | | /// <summary> |
| | | /// 删除通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_DeleteCallInfo = "/home-wisdom/app/fl/vi/delete"; |
| | | /// <summary> |
| | | /// 获取门口机列表 |
| | | /// </summary> |
| | | public const string API_POST_FL_List = "http://112.74.164.111:180/api.php/Device/getmonitorUUID"; |
| | | /// <summary> |
| | | /// 动态密码/二维码开锁 |
| | | /// </summary> |
| | | public const string API_POST_FL_QRcode = "http://112.74.164.111:180/api.php/Device/setdynamicpwd"; |
| | | #endregion |
| | | |
| | | |
| | | #region 可视对讲标准通用接口 |
| | | /// <summary> |
| | | /// 获取可视对讲设备列表(所有对接可视对讲都包含一起) |
| | | /// </summary> |
| | | public const string API_POST_VideoDeviceList = "/home-wisdom/platform/imou/listVisualSpeaks"; |
| | | /// <summary> |
| | | /// 远程开门 |
| | | /// </summary> |
| | | public const string API_POST_VideoDevice_OpenDoorbell = "/home-wisdom/platform/imou/openDoorbell"; |
| | | /// <summary> |
| | | /// 更改通话状态 |
| | | /// </summary> |
| | | public const string API_POST_VideoDevice_UpdateCallStatus = "/home-wisdom/platform/imou/updateCallStatus"; |
| | | /// <summary> |
| | | /// 获取通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | |
| | | /// <summary> |
| | | /// 人脸录入 |
| | | /// </summary> |
| | | public const string Api_Post_InputUserFace = "/community-wisdom/app/doorDevice/inputUserFaceHouse"; |
| | | /// <summary> |
| | | /// 开关人脸功能 |
| | | /// </summary> |
| | | public const string Api_Post_SwitchFaceFunction = "/community-wisdom/app/doorDevice/updateCustomerFaceClose"; |
| | | /// <summary> |
| | | /// 获取住户详情 |
| | | /// </summary> |
| | | public const string Api_Post_GetCustomerInfo = "/basis-footstone/app/customer/detail"; |
| | | /// 住宅sip账号获取 |
| | | /// </summary> |
| | | public const string API_POST_VideoDevice_GetSipAccount = "/home-wisdom/app/home/getSipAccount"; |
| | | #endregion |
| | | |
| | | |
| | | #region ■ -- 门锁相关接口_______________________________ |
| | | |
| | | /// <summary> |
| | | /// 判断门锁是否第一使用 |
| | | /// </summary> |
| | | public const string API_POST_DoorisFirstUse = "/home-wisdom/app/device/door/isUserBind"; |
| | | /// <summary> |
| | | /// 门锁第一次使用时,绑定的密码 |
| | | /// </summary> |
| | | public const string API_POST_DoorBindFirstUsePsw = "/home-wisdom/app/device/door/userBind"; |
| | | /// <summary> |
| | | /// 获取门锁所有的密码 |
| | | /// </summary> |
| | | public const string API_POST_GetDoorAllPsw = "/home-wisdom/app/device/door/getPwds"; |
| | | /// <summary> |
| | | /// 门锁分配密码给用户 |
| | | /// </summary> |
| | | public const string API_POST_DoorAssignPswToUser = "/home-wisdom/app/device/door/pwdAllot"; |
| | | /// <summary> |
| | | /// 门锁的历史记录 |
| | | /// </summary> |
| | | public const string API_POST_DoorHistory = "/home-wisdom/app/device/door/logs"; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ -- SIP相关接口_______________________________ |
| | | #endregion |
| | | /// <summary> |
| | | /// 绑定source面板 |
| | | /// </summary> |
| | | public const string Api_Post_BindSourcePanel = "/home-wisdom/source/screen/home/bind"; |
| | | |
| | | |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// BaseRequestObj |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class BaseRequestObj |
| | | //{ |
| | | // public string RequestVersion = MainPage.CodeIDString; |
| | | |
| | | // public string RequestSource = MainPage.ClientType; |
| | | |
| | | // public string LoginAccessToken; |
| | | //} |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace SiriIntents.Server |
| | | { |
| | | |
| | | #region **************************************新服务器************************************** |
| | | [System.Serializable] |
| | | public class BaseNoTokenObj |
| | | { |
| | | //public string RequestVersion = MainPage.CodeIDString; |
| | | ////请求来源 |
| | | //public string clientType = MainPage.ClientType; |
| | | |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class NullObj |
| | | { |
| | | |
| | | } |
| | | |
| | | #region ■ 全球区域列表 ____________________________ |
| | | [System.Serializable] |
| | | public class GetRegionListObj |
| | | { |
| | | /// <summary> |
| | | /// 区域标识 |
| | | /// </summary> |
| | | public string regionMark; |
| | | |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class RegionByAccountObj |
| | | { |
| | | /// <summary> |
| | | /// 账号 |
| | | /// </summary> |
| | | public string account; |
| | | |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class GlobalRegionListRes |
| | | { |
| | | public string regionId; |
| | | public string regionName; |
| | | public string regionUrl; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分页 |
| | | /// </summary> |
| | | public class BasePagingObj |
| | | { |
| | | public int totalCount = 0; |
| | | public int totalPage = 0; |
| | | public int pageNo = 0; |
| | | public int pageSize = 0; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 登录 ____________________________ |
| | | [System.Serializable] |
| | | public class LoginObj |
| | | { |
| | | /// <summary> |
| | | /// 账号 |
| | | /// </summary> |
| | | public string account; |
| | | /// <summary> |
| | | /// 密码 |
| | | /// </summary> |
| | | public string loginPwd; |
| | | /// <summary> |
| | | /// 授权类型,可用值:captcha,refresh_token,password,verify |
| | | /// </summary> |
| | | public string grantType = "password"; |
| | | /// <summary> |
| | | /// 平台 WEB、APP、WX、ALIPAY |
| | | /// </summary> |
| | | public string platform = "APP"; |
| | | /// <summary> |
| | | /// 验证码,短信登录时候用 |
| | | /// </summary> |
| | | public string verifyCode; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新token |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class RefreshTokenObj |
| | | { |
| | | /// <summary> |
| | | /// refreshToken |
| | | /// </summary> |
| | | public string refreshToken; |
| | | /// <summary> |
| | | /// 授权类型,可用值:captcha,refresh_token,password,verify |
| | | /// </summary> |
| | | public string grantType = "refresh_token"; |
| | | /// <summary> |
| | | /// 平台 WEB、APP、WX、ALIPAY |
| | | /// </summary> |
| | | public string platform = "APP"; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [Serializable] |
| | | public class UserLoginRes |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string expiresIn; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string refreshToken; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string accessToken; |
| | | /// <summary> |
| | | /// 账号类型 "C":C端账号 |
| | | /// </summary> |
| | | public string userType; |
| | | /// <summary> |
| | | /// Token "Bearer " |
| | | /// </summary> |
| | | public string headerPrefix; |
| | | /// <summary> |
| | | /// 用户ID |
| | | /// </summary> |
| | | public string userId; |
| | | /// <summary> |
| | | /// 用户名字 |
| | | /// </summary> |
| | | public string name; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 登录锁定后的异常扩展参数 |
| | | /// </summary> |
| | | [Serializable] |
| | | public class AccountLoginLockExtraRes |
| | | { |
| | | /// <summary> |
| | | /// 最大允许的密码错误次数 |
| | | /// </summary> |
| | | public int maxPwdErrorNum; |
| | | /// <summary> |
| | | /// 当前错误次数 |
| | | /// </summary> |
| | | public int currentPwdErrorNum; |
| | | /// <summary> |
| | | /// 解锁事件 |
| | | /// </summary> |
| | | public long unlockTime; |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ 注册 ____________________________ |
| | | |
| | | //用户输入手机验证码进行验证注册 |
| | | [System.Serializable] |
| | | public class RegisterObj |
| | | { |
| | | /// <summary> |
| | | /// 用户账号[手机号] |
| | | /// </summary> |
| | | public string memberPhone; |
| | | /// <summary> |
| | | /// 用户账号[邮箱] |
| | | /// </summary> |
| | | public string memberEmail; |
| | | /// <summary> |
| | | /// 验证码 |
| | | /// </summary> |
| | | public string verifyCode; |
| | | ///// <summary> |
| | | ///// 手机注册的要加这个,短信区域代码,如+86 |
| | | ///// </summary> |
| | | //public string phoneAreaCode; |
| | | /// <summary> |
| | | /// 登陆密码,需要MD5处理 |
| | | /// </summary> |
| | | public string loginPwd; |
| | | /// <summary> |
| | | /// 会员昵称 |
| | | /// </summary> |
| | | public string memberName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 发送验证码 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class VerifyCodeSendObj |
| | | { |
| | | /// <summary> |
| | | /// 手机号 |
| | | /// </summary> |
| | | public string phone; |
| | | /// <summary> |
| | | /// 手机号前缀 |
| | | /// </summary> |
| | | public string phonePrefix; |
| | | /// <summary> |
| | | /// 语言 |
| | | /// </summary> |
| | | public string languageType; |
| | | /// <summary> |
| | | /// 邮箱 |
| | | /// </summary> |
| | | public string mail; |
| | | /// <summary> |
| | | /// 1:注册 2:找回密码 3:绑定4:验证码登陆 5:敏感数据 |
| | | /// 默认传1 |
| | | /// </summary> |
| | | public int verifyType = 1; |
| | | /// <summary> |
| | | /// 验证码过期时间(秒),默认5分钟 |
| | | /// </summary> |
| | | public int expireSecond = 300; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 验证验证码 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class VerifyCodeCheckObj |
| | | { |
| | | /// <summary> |
| | | /// 手机号 |
| | | /// </summary> |
| | | public string phone; |
| | | /// <summary> |
| | | /// 邮箱 |
| | | /// </summary> |
| | | public string mail; |
| | | /// <summary> |
| | | /// 1:注册 2:找回密码 3:绑定 4:验证码登陆 5:敏感数据 |
| | | /// 默认传1 |
| | | /// </summary> |
| | | public int verifyType = 1; |
| | | /// <summary> |
| | | /// 验证码过期时间(秒),默认5分钟 |
| | | /// </summary> |
| | | public string verifyCode; |
| | | /// <summary> |
| | | /// 验证成功后验证码是否失效 不传值或者true失效,只有传false的时候,校验通过后验证码也不失效 |
| | | /// </summary> |
| | | public bool verifySuccessFail = true; |
| | | |
| | | } |
| | | |
| | | //[System.Serializable] |
| | | //public class SignPhoneObj |
| | | //{ |
| | | // public string phone; |
| | | // public int Company;// 短信模板编号 int 是 |
| | | //} |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 忘记密码 ____________________________ |
| | | //ForgetPwd 忘记密码,手机或邮箱方式 |
| | | [System.Serializable] |
| | | public class ForgetPwdObj |
| | | { |
| | | /// <summary> |
| | | /// 手机账号 |
| | | /// </summary> |
| | | public string memberPhone; |
| | | /// <summary> |
| | | /// 邮箱账号 |
| | | /// </summary> |
| | | public string memberEmail; |
| | | /// <summary> |
| | | /// 验证码 |
| | | /// </summary> |
| | | public string verifyCode; |
| | | /// <summary> |
| | | /// 新密码 |
| | | /// </summary> |
| | | public string loginPwd; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更改个人密码 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdatePwdObj |
| | | { |
| | | /// <summary> |
| | | /// 旧密码 |
| | | /// </summary> |
| | | public string loginPwd; |
| | | /// <summary> |
| | | /// 新密码 |
| | | /// </summary> |
| | | public string loginNewPwd; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 帐号信息 ____________________________ |
| | | /// <summary> |
| | | /// 获取个人信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class MemberInfoRes |
| | | { |
| | | /// <summary> |
| | | /// 用户ID |
| | | /// </summary> |
| | | public string memberId; |
| | | /// <summary> |
| | | /// 用户昵称 |
| | | /// </summary> |
| | | public string memberName; |
| | | /// <summary> |
| | | /// 用户邮箱 |
| | | /// </summary> |
| | | public string memberEmail; |
| | | /// <summary> |
| | | /// 用户手机号 |
| | | /// </summary> |
| | | public string memberPhone; |
| | | /// <summary> |
| | | /// 国家区号 |
| | | /// </summary> |
| | | public string memberPhonePrefix; |
| | | /// <summary> |
| | | /// 登录名 |
| | | /// </summary> |
| | | public string loginName; |
| | | /// <summary> |
| | | /// 用户头像 |
| | | /// </summary> |
| | | public string memberHeadIcon; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新个人信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateMemberNameRes |
| | | { |
| | | /// <summary> |
| | | /// 用户昵称 |
| | | /// </summary> |
| | | public string memberName; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新个人头像 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateMemberHeadIconRes |
| | | { |
| | | /// <summary> |
| | | /// 用户头像 |
| | | /// </summary> |
| | | public string memberHeadIcon; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定认证(手机/邮箱) |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class BindWithAccountObj |
| | | { |
| | | /// <summary> |
| | | /// 用户手机 |
| | | /// </summary> |
| | | public string memberPhone; |
| | | /// <summary> |
| | | /// 用户手机 |
| | | /// </summary> |
| | | public string memberEmail; |
| | | /// <summary> |
| | | /// 验证吗 |
| | | /// </summary> |
| | | public string verifyCode; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解绑绑定认证(手机/邮箱) |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UnBindAccountObj |
| | | { |
| | | /// <summary> |
| | | /// 解绑标示,PHONE,EMAIL |
| | | /// </summary> |
| | | public string unBindLabel; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 住宅相关 ____________________________ |
| | | #region 获取住宅分页 |
| | | [System.Serializable] |
| | | public class GetHomeListObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅类型 |
| | | /// </summary> |
| | | public string homeType; |
| | | /// <summary> |
| | | /// 不自动生成默认住宅 |
| | | /// </summary> |
| | | public bool autoGenerate = false; |
| | | } |
| | | |
| | | |
| | | [Serializable] |
| | | public class AddOrUpdateHomeObj |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string homeType; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public double latitude; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public double longitude; |
| | | /// <summary> |
| | | /// 住宅名称 |
| | | /// </summary> |
| | | public string homeName; |
| | | /// <summary> |
| | | /// 住宅地址 |
| | | /// </summary> |
| | | public string homeAddress; |
| | | } |
| | | |
| | | |
| | | //[Serializable] |
| | | //public class GethomepagerRes |
| | | //{ |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public int totalPages; |
| | | // public int totalElements; |
| | | // public bool last; |
| | | // public bool first; |
| | | // public int numberOfElements; |
| | | // public int size; |
| | | // public int number; |
| | | // public bool empty; |
| | | |
| | | // public List<RegionInfoRes> content = new List<RegionInfoRes> (); |
| | | //} |
| | | |
| | | |
| | | //[Serializable] |
| | | //public class HomeInfoRes |
| | | //{ |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public int totalPages; |
| | | // public int totalElements; |
| | | // public bool last; |
| | | // public bool first; |
| | | // public int numberOfElements; |
| | | // public int size; |
| | | // public int number; |
| | | // public bool empty; |
| | | |
| | | // public List<RegionInfoRes> content = new List<RegionInfoRes> (); |
| | | //} |
| | | |
| | | #endregion |
| | | |
| | | #region 绑定网关 |
| | | [System.Serializable] |
| | | public class BindGatewayObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 网关MAC |
| | | /// </summary> |
| | | public string mac; |
| | | /// <summary> |
| | | /// 住宅类型 |
| | | /// </summary> |
| | | public string gatewayType; |
| | | /// <summary> |
| | | /// 子网号 |
| | | /// </summary> |
| | | public int subnetId; |
| | | /// <summary> |
| | | /// 设备号 |
| | | /// </summary> |
| | | public int deviceId; |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 获取住宅网关列表 |
| | | //[Serializable] |
| | | //public class HomeGatewayRes |
| | | //{ |
| | | // public int totalPages; |
| | | // public int totalElements; |
| | | // public bool last; |
| | | // public bool first; |
| | | // public int numberOfElements; |
| | | // public int size; |
| | | // public int number; |
| | | // public bool empty; |
| | | // public List<HomeGatewayInfo> content = new List<HomeGatewayInfo>(); |
| | | //} |
| | | |
| | | [Serializable] |
| | | public class HomeGatewayInfo |
| | | { |
| | | /// <summary> |
| | | /// 网关ID |
| | | /// </summary> |
| | | public string gatewayId =""; |
| | | /// <summary> |
| | | /// 网关snID |
| | | /// </summary> |
| | | public string sn = ""; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string aesKey = ""; |
| | | /// <summary> |
| | | /// BUSUDPGATEWAY, |
| | | /// AGATEWAY, |
| | | /// ZIGBEEGATEWAY, |
| | | /// KNXGATEWAY |
| | | /// </summary> |
| | | public string gatewayType = ""; |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId = ""; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string mac = ""; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string primaryKey = ""; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string encryptionType = ""; |
| | | |
| | | /// <summary> |
| | | /// 子网号 |
| | | /// </summary> |
| | | public int subnetId; |
| | | /// <summary> |
| | | /// 设备号 |
| | | /// </summary> |
| | | public int deviceId; |
| | | /// <summary> |
| | | /// 网关状态 |
| | | /// ON_LINE(0,"在线"), |
| | | /// OFF_LINE(1,"下线"),; |
| | | /// </summary> |
| | | public bool gatewayStatus; |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string gwFirmwareVersion; |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string projectName; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string userName; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string groupName; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string gatewayName; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 解绑网关 |
| | | /// <summary> |
| | | /// 解绑网关 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UntieGatewayObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 网关MAC |
| | | /// </summary> |
| | | public string mac; |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 备份相关 ____________________________ |
| | | /// <summary> |
| | | /// 更新文件夹名字 |
| | | /// </summary> |
| | | /// |
| | | [System.Serializable] |
| | | public class BackupFolderCreateObj |
| | | { |
| | | /// <summary> |
| | | /// 备份分类 0:交互工程备份 1:自定义工程备份 2:用户自动备份 3:用户自定义备份 [填写 0~3] |
| | | /// </summary> |
| | | public string backupClassify = string.Empty; |
| | | /// <summary> |
| | | /// 备份数据分类 |
| | | /// </summary> |
| | | public string backupDataType = string.Empty; |
| | | /// <summary> |
| | | /// 住宅 ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// APP备份文件夹名字 |
| | | /// </summary> |
| | | public string folderName; |
| | | } |
| | | |
| | | [System.Serializable] |
| | | public class BackupFolderCreateRes |
| | | { |
| | | /// <summary> |
| | | /// 文件夹id |
| | | /// </summary> |
| | | public string id; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string homeId; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string backupDataType; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public string backupClassify; |
| | | /// <summary> |
| | | /// 文件夹名字 |
| | | /// </summary> |
| | | public string folderName; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public int backupUtcTime; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public int createonutc; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 备份列表名的信息 |
| | | /// </summary> |
| | | /// |
| | | [System.Serializable] |
| | | public class BackupListNameInfoRes |
| | | { |
| | | /// <summary> |
| | | /// 文件夹 ID |
| | | /// </summary> |
| | | public string id; |
| | | /// <summary> |
| | | /// 住宅 ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// backupDataType |
| | | /// </summary> |
| | | public string backupDataType = string.Empty; |
| | | /// <summary> |
| | | /// backupClassify |
| | | /// </summary> |
| | | public string backupClassify; |
| | | /// <summary> |
| | | /// backupClassify |
| | | /// </summary> |
| | | public string folderName = string.Empty; |
| | | /// <summary> |
| | | /// backupUtcTime |
| | | /// </summary> |
| | | public string backupUtcTime; |
| | | ///// <summary> |
| | | ///// createonutc |
| | | ///// </summary> |
| | | //public string createUtcTime; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新文件夹名字 |
| | | /// </summary> |
| | | /// |
| | | [System.Serializable] |
| | | public class UpdateBackupObj |
| | | { |
| | | ///// <summary> |
| | | ///// 备份分类 0:交互工程备份 1:自定义工程备份 2:用户自动备份 3:用户自定义备份 [填写 0~3] |
| | | ///// </summary> |
| | | //public string backupClassify = string.Empty; |
| | | ///// <summary> |
| | | ///// 备份数据分类 |
| | | ///// </summary> |
| | | //public string backupDataType = string.Empty; |
| | | /// <summary> |
| | | /// 住宅 ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// APP备份文件夹名字 |
| | | /// </summary> |
| | | public string folderName; |
| | | /// <summary> |
| | | /// 文件夹 id |
| | | /// </summary> |
| | | public string folderId; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 单个备份文件信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class BackupFileInfoRes |
| | | { |
| | | /// <summary> |
| | | /// 文件主键 id |
| | | /// </summary> |
| | | public string id; |
| | | /// <summary> |
| | | /// 文件夹主键 id |
| | | /// </summary> |
| | | public string backupFolderId; |
| | | /// <summary> |
| | | /// 手机号住宅的文件名称 |
| | | /// </summary> |
| | | public string fileName; |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public long createUtcTime; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找所有文件 或者 删除备份文件夹 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class BackupFolderIdObj |
| | | { |
| | | /// <summary> |
| | | /// 文件夹主键 id |
| | | /// </summary> |
| | | public string folderId; |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下载备份 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class BackupFileDownObj |
| | | { |
| | | /// <summary> |
| | | /// 文件夹主键 id |
| | | /// </summary> |
| | | public string folderId; |
| | | /// <summary> |
| | | /// 文件id |
| | | /// </summary> |
| | | public string fileId; |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 子账号相关 ____________________________ |
| | | |
| | | #region 添加、查询、删除子账号 |
| | | /// <summary> |
| | | /// ChildBaseObj |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ChildBaseObj |
| | | { |
| | | /// <summary> |
| | | /// 子账号ID childAccountId |
| | | /// </summary> |
| | | public string childAccountId; |
| | | /// <summary> |
| | | /// 住宅 |
| | | /// </summary> |
| | | public string homeId; |
| | | } |
| | | /// <summary> |
| | | /// 添加子账号 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ChildAddObj |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 子用户的电话或者邮箱 |
| | | /// </summary> |
| | | public string account; |
| | | /// <summary> |
| | | /// 子账户类型 ORDINARY、DEBUG、ADMIN |
| | | /// </summary> |
| | | public string childAccountType; |
| | | ///// <summary> |
| | | ///// 是否允许远程控制 0:允许 1:不允许 |
| | | ///// </summary> |
| | | //public bool isRemoteControl = true; |
| | | /// <summary> |
| | | /// 子账号昵称 |
| | | /// </summary> |
| | | public string nickName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除子账号 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ChildDeleteObj : ChildBaseObj |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// HomeIdObj |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class HomeIdObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新子账号备注名字 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateChildNickNameObj : ChildBaseObj |
| | | { |
| | | /// <summary> |
| | | /// nickName |
| | | /// </summary> |
| | | public string nickName; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新远程控制 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateRemoteObj : ChildBaseObj |
| | | { |
| | | /// <summary> |
| | | /// 是否允许远程控制 |
| | | /// </summary> |
| | | public bool isRemoteControl; |
| | | /// <summary> |
| | | /// 子账户类型 ORDINARY、DEBUG、ADMIN |
| | | /// </summary> |
| | | public string childAccountType; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 修改是否允许创建场景 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateChildAllowCreateSceneObj : ChildBaseObj |
| | | { |
| | | /// <summary> |
| | | /// 是否允许创建场景 |
| | | /// </summary> |
| | | public bool isAllowCreateScene; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AccountObj |
| | | { |
| | | /// <summary> |
| | | /// 账号 |
| | | /// </summary> |
| | | public string account; |
| | | |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 数据分享 |
| | | /// <summary> |
| | | /// 查询某住宅某子账号的分享文件信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class HomeShareFindAll : ChildBaseObj |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 查询某住宅某子账号的分享文件信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ChildShareFileInfoRes |
| | | { |
| | | /// <summary> |
| | | /// 主键ID |
| | | /// </summary> |
| | | public string id; |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 子账号ID |
| | | /// </summary> |
| | | public string childAccountId; |
| | | /// <summary> |
| | | /// 文件名 |
| | | /// </summary> |
| | | public string fileName; |
| | | /// <summary> |
| | | /// 创建时间 |
| | | /// </summary> |
| | | public string createTime; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 下载分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ShareFileDownObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 分享文件id |
| | | /// </summary> |
| | | public string homeShareId; |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region ■ GetMqttRemoteInfo ____________________________ |
| | | [Serializable] |
| | | public class GetMqttRemoteInfoObj |
| | | { |
| | | /// <summary> |
| | | /// 平台标示 ClientId账号拼接用 |
| | | /// </summary> |
| | | public string attachClientId; |
| | | /// <summary> |
| | | /// 住宅类型 1.ZIGBEE 2.BUSPRO 3.A 4.ALL |
| | | /// </summary> |
| | | public string homeType; |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 手机区号 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AreaCodeRes |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Name; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Code; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string Id; |
| | | } |
| | | |
| | | |
| | | #region 数据分享 |
| | | ///// <summary> |
| | | ///// 添加分享 |
| | | ///// </summary> |
| | | //[System.Serializable] |
| | | //public class ShareData |
| | | //{ |
| | | // /// <summary> |
| | | // /// 住宅ID |
| | | // /// </summary> |
| | | // public int homeId; |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public List<ShareDatasItem> shareDatas; |
| | | // /// <summary> |
| | | // /// 子账号ID |
| | | // /// </summary> |
| | | // public List<string> childAccountIds; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 添加分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class AddShareObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ShareData> shareDatas; |
| | | /// <summary> |
| | | /// 子账号ID |
| | | /// </summary> |
| | | public List<string> childAccountIds; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public class ShareData |
| | | { |
| | | /// <summary> |
| | | /// 分享类型表id |
| | | /// </summary> |
| | | public string shareTypeId; |
| | | /// <summary> |
| | | /// 子帐号ID |
| | | /// </summary> |
| | | public string childAccountId; |
| | | /// <summary> |
| | | /// 分享类型 1.ROOM 2.DEVICE 3.SCENE |
| | | /// </summary> |
| | | public string shareType = "DEVICE"; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class DeleteShareObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public List<ShareData> shareDatas; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取分享 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetShareObj |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 子账号ID |
| | | /// </summary> |
| | | public string childAccountId; |
| | | ///// <summary> |
| | | ///// 分享类型 1.ROOM 2.DEVICE 3.SCENE |
| | | ///// 不传默认查全部 |
| | | ///// </summary> |
| | | //public string shareType = "DEVICE"; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 图片上传下载 |
| | | /// <summary> |
| | | /// 上传图片 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UploadImageObj |
| | | { |
| | | /// <summary> |
| | | /// 前缀标识 |
| | | /// </summary> |
| | | public string prefix; |
| | | /// <summary> |
| | | /// 关联ID |
| | | /// </summary> |
| | | public string uid; |
| | | /// <summary> |
| | | /// 文件名称 |
| | | /// </summary> |
| | | public string fileName; |
| | | /// <summary> |
| | | /// 图片二进制流 |
| | | /// </summary> |
| | | public byte[] content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询图片路径 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetImageUrlObj |
| | | { |
| | | /// <summary> |
| | | /// 图片下载路径标识 |
| | | /// </summary> |
| | | public string imageKey; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 极光推送消息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class JPushMessageInfo |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string HomeId; |
| | | /// <summary> |
| | | /// 推送标题 |
| | | /// </summary> |
| | | public string Title; |
| | | /// <summary> |
| | | /// 推送内容 |
| | | /// </summary> |
| | | public string Content; |
| | | /// <summary> |
| | | /// 推送附加数据 |
| | | /// </summary> |
| | | public string Extras; |
| | | /// <summary> |
| | | /// 信息类型 |
| | | /// </summary> |
| | | public string messageType = ""; |
| | | /// <summary> |
| | | /// 扩展数据内容 |
| | | /// </summary> |
| | | public string expantContent = ""; |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 极光推送消息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class JPushExpandData |
| | | { |
| | | /// <summary> |
| | | /// 附加内容 |
| | | /// </summary> |
| | | public string expandData; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 极光推送消息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class ExpandData |
| | | { |
| | | /// <summary> |
| | | /// 住宅ID |
| | | /// </summary> |
| | | public string homeId; |
| | | /// <summary> |
| | | /// 附加内容 |
| | | /// </summary> |
| | | public string expantContent; |
| | | /// <summary> |
| | | /// 信息类型 |
| | | /// </summary> |
| | | public string messageType; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 萤石云子账号token |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class EZChildAccessToken |
| | | { |
| | | /// <summary> |
| | | /// token |
| | | /// </summary> |
| | | public string accessToken; |
| | | /// <summary> |
| | | /// 过期时间 |
| | | /// </summary> |
| | | public string expireTime; |
| | | } |
| | | |
| | | |
| | | #region 音箱 |
| | | /// <summary> |
| | | /// 获取音箱列表 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetSpeakerObj : HomeIdObj |
| | | { |
| | | /// <summary> |
| | | /// 平台名称 |
| | | /// </summary> |
| | | public string platformName; |
| | | /// <summary> |
| | | /// 页面大小 |
| | | /// </summary> |
| | | public int pageSize = 100; |
| | | /// <summary> |
| | | /// 页面序号 |
| | | /// </summary> |
| | | public int pageNo = 1; |
| | | } |
| | | |
| | | |
| | | [System.Serializable] |
| | | public class SpeakerObj : HomeIdObj |
| | | { |
| | | /// <summary> |
| | | /// 记录的主键id |
| | | /// </summary> |
| | | public string tokenId; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新音箱备注 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateSpeakerRemarkObj : SpeakerObj |
| | | { |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | public string remark; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取音箱分配的设备和场景列表 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class GetSpeakerDeviceListObj : HomeIdObj |
| | | { |
| | | /// <summary> |
| | | /// 记录的主键id |
| | | /// </summary> |
| | | public string tokenId; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 配置的语音设备和场景数据 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SpeakerTargetInfo |
| | | { |
| | | /// <summary> |
| | | /// 控制的目标Id,云端的设备Id或者场景Id |
| | | /// </summary> |
| | | public string targetId; |
| | | /// <summary> |
| | | /// 是否是设备,场景为false |
| | | /// </summary> |
| | | public bool isDevice; |
| | | /// <summary> |
| | | /// 目标名称 |
| | | /// </summary> |
| | | public string targetName; |
| | | /// <summary> |
| | | /// 扩展参数当前rowview是否选中 |
| | | /// </summary> |
| | | public bool IsSelect; |
| | | } |
| | | |
| | | //[System.Serializable] |
| | | //public class SpeakerTargetInfoRow: SpeakerTargetInfo |
| | | //{ |
| | | // /// <summary> |
| | | // /// 当前rowview是否选中 |
| | | // /// </summary> |
| | | // public bool isSelect; |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// 更新音箱控制的设备和场景目标 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class UpdateSpeakerDeviceListObj : SpeakerObj |
| | | { |
| | | /// <summary> |
| | | /// 备注 |
| | | /// </summary> |
| | | public List<SpeakerTargetInfo> targetInfos; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新音箱控制的设备和场景目标 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SpeakerListRes |
| | | { |
| | | /// <summary> |
| | | /// 音箱列表 |
| | | /// </summary> |
| | | public List<SpeakerInfo> list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 音箱信息 |
| | | /// </summary> |
| | | [System.Serializable] |
| | | public class SpeakerInfo |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string platformName { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string remark { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string tokenId { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string userId { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string userRegion { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string homeId { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string homeRegion { get; set; } |
| | | } |
| | | #endregion |
| | | |
| | | //#region 旧接口 |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public class FindCityObj |
| | | //{ |
| | | // /// <summary> |
| | | // /// 城市ID |
| | | // /// </summary> |
| | | // public string Cid; |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string Location; |
| | | |
| | | // /// <summary> |
| | | // /// 城市 |
| | | // /// </summary> |
| | | // public string City; |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string Province; |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string Country; |
| | | |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string TimeZone; |
| | | //} |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | //public class GetWeatherObj |
| | | //{ |
| | | |
| | | |
| | | // public string Temperature; |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string Humidity; |
| | | |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string PM25; |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // public string Weather; |
| | | |
| | | //} |
| | | //#endregion |
| | | |
| | | } |
| | |
| | | <MtouchArch>ARM64</MtouchArch>
|
| | | <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
| | | <MtouchVerbosity></MtouchVerbosity>
|
| | | <CodesignProvision>OnproSiri211116-1</CodesignProvision>
|
| | | <CodesignProvision>OnProSiri211125-1-Dev</CodesignProvision>
|
| | | </PropertyGroup>
|
| | | <ItemGroup>
|
| | | <Reference Include="System" />
|
| | | <Reference Include="System.Xml" />
|
| | | <Reference Include="System.Core" />
|
| | | <Reference Include="Xamarin.iOS" />
|
| | | <Reference Include="Shared.IOS.HDLSceneSiri">
|
| | | <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
|
| | | </Reference>
|
| | | <Reference Include="Newtonsoft.Json">
|
| | | <HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
|
| | | </Reference>
|
| | | <Reference Include="RestSharp">
|
| | | <HintPath>..\packages\RestSharp.106.13.0\lib\netstandard2.0\RestSharp.dll</HintPath>
|
| | | </Reference>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="Resources\" />
|
| | | <Folder Include="Server\" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <None Include="Info.plist" />
|
| | | <None Include="Entitlements.plist" />
|
| | | <None Include="packages.config" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Compile Include="IntentHandler.cs" />
|
| | | <Compile Include="Server\HttpServerRequest.cs" />
|
| | | <Compile Include="Server\HttpUtil.cs" />
|
| | | <Compile Include="Server\IMessageCommon.cs" />
|
| | | <Compile Include="Server\NewAPI.cs" />
|
| | | <Compile Include="Server\NewApiRes.cs" />
|
| | | <Compile Include="HDLRunSceneIntentHandlder.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ProjectReference Include="..\SiriKit\SiriKit.csproj">
|
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <packages> |
| | | <package id="Newtonsoft.Json" version="13.0.1" targetFramework="xamarinios10" /> |
| | | <package id="RestSharp" version="106.13.0" targetFramework="xamarinios10" /> |
| | | </packages> |
| | |
| | | </array> |
| | | <key>com.apple.developer.siri</key> |
| | | <true/> |
| | | <key>com.apple.developer.associated-domains</key> |
| | | <array/> |
| | | </dict> |
| | | </plist> |
| | |
| | | |
| | | using CoreGraphics; |
| | | using Foundation; |
| | | using HDLSceneSiri; |
| | | //using HDLSceneSiri; |
| | | using Intents; |
| | | using IntentsUI; |
| | |
| | | |
| | | |
| | | |
| | | //if (@available(iOS 12.0, *)) |
| | | { |
| | | //HDLRunSceneIntentResponse rsp = interaction.IntentResponse as HDLRunSceneIntentResponse; |
| | | //if (rsp.Code == HDLRunSceneIntentResponseCode.Success) |
| | | //{ |
| | | // this.messageLabel.Text = rsp.SuccessMessage; |
| | | //} |
| | | //else if (rsp.Code == HDLRunSceneIntentResponseCode.Failure || rsp.Code == HDLRunSceneIntentResponseCode.Error) |
| | | //{ |
| | | // this.messageLabel.Text = rsp.ErrorMessage; |
| | | //} |
| | | //else |
| | | { |
| | | //messageLabel.Text = "执行成功";// rsp.SuccessMessage; |
| | | } |
| | | } |
| | | CGSize size = new CGSize(DesiredSize().Width, 80); |
| | | HDLRunSceneIntentResponse rsp = interaction.IntentResponse as HDLRunSceneIntentResponse; |
| | | this.lblMsg.Text = rsp.SuccessMessage; |
| | | this.lblMsg.TextColor = UIColor.Black; |
| | | this.lblMsg.Frame = new CGRect(0, 0, DesiredSize().Width, 180); |
| | | CGSize size = new CGSize(DesiredSize().Width, 180); |
| | | |
| | | |
| | | //if (completion != null) |
| | | if (completion != null) |
| | | completion(true, parameters, size); |
| | | |
| | | |
| | |
| | | partial class IntentViewController |
| | | { |
| | | [Outlet] |
| | | UIKit.UILabel messageLabel { get; set; } |
| | | [GeneratedCode("iOS Designer", "1.0")] |
| | | UIKit.UILabel lblMsg { get; set; } |
| | | |
| | | void ReleaseDesignerOutlets () |
| | | { |
| | | if (messageLabel != null) { |
| | | messageLabel.Dispose (); |
| | | messageLabel = null; |
| | | if (lblMsg != null) { |
| | | lblMsg.Dispose (); |
| | | lblMsg = null; |
| | | } |
| | | } |
| | | } |
| | |
| | | <rect key="frame" x="0.0" y="0.0" width="320" height="81"/> |
| | | <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
| | | <subviews> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NjV-Uo-AhC"> |
| | | <rect key="frame" x="16" y="44" width="288" height="37"/> |
| | | <constraints> |
| | | <constraint firstAttribute="height" constant="80" id="nTr-aC-LKs"/> |
| | | </constraints> |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IGu-QP-NsY"> |
| | | <rect key="frame" x="0.0" y="0.0" width="320" height="81"/> |
| | | <fontDescription key="fontDescription" type="system" pointSize="17"/> |
| | | <nil key="textColor"/> |
| | | <nil key="highlightedColor"/> |
| | |
| | | </subviews> |
| | | <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
| | | <constraints> |
| | | <constraint firstItem="NjV-Uo-AhC" firstAttribute="top" secondItem="qkL-Od-lgU" secondAttribute="bottom" id="FYi-qJ-8bD"/> |
| | | <constraint firstAttribute="trailingMargin" secondItem="NjV-Uo-AhC" secondAttribute="trailing" id="Gl4-Hb-09m"/> |
| | | <constraint firstItem="n38-gi-rB5" firstAttribute="top" secondItem="NjV-Uo-AhC" secondAttribute="bottom" id="IeL-md-xmX"/> |
| | | <constraint firstItem="NjV-Uo-AhC" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leadingMargin" id="QQ2-K1-0tQ"/> |
| | | <constraint firstItem="n38-gi-rB5" firstAttribute="top" secondItem="IGu-QP-NsY" secondAttribute="bottom" id="SeT-jr-PQR"/> |
| | | <constraint firstItem="IGu-QP-NsY" firstAttribute="top" secondItem="zMn-AG-sqS" secondAttribute="top" id="XNh-gA-gK1"/> |
| | | <constraint firstAttribute="trailing" secondItem="IGu-QP-NsY" secondAttribute="trailing" id="a0D-RT-Dwt"/> |
| | | <constraint firstItem="IGu-QP-NsY" firstAttribute="leading" secondItem="zMn-AG-sqS" secondAttribute="leading" id="dPA-2W-Z8X"/> |
| | | </constraints> |
| | | </view> |
| | | <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> |
| | | <size key="freeformSize" width="320" height="81"/> |
| | | <connections> |
| | | <outlet property="messageLabel" destination="NjV-Uo-AhC" id="Jnc-sC-lVC"/> |
| | | <outlet property="lblMsg" destination="IGu-QP-NsY" id="gfv-7M-crM"/> |
| | | </connections> |
| | | </viewController> |
| | | <placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/> |
| | |
| | | <MtouchArch>ARM64</MtouchArch>
|
| | | <MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
| | | <MtouchVerbosity></MtouchVerbosity>
|
| | | <CodesignProvision>OnproSiriUI211116-1</CodesignProvision>
|
| | | <CodesignProvision>OnProSiriUI211125-1-Dev</CodesignProvision>
|
| | | <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
| | | </PropertyGroup>
|
| | | <ItemGroup>
|
| | |
| | | <Reference Include="System.Xml" />
|
| | | <Reference Include="System.Core" />
|
| | | <Reference Include="Xamarin.iOS" />
|
| | | <Reference Include="Shared.IOS.HDLSceneSiri">
|
| | | <HintPath>..\DLL\IOS\Shared.IOS.HDLSceneSiri.dll</HintPath>
|
| | | </Reference>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="Resources\" />
|
| | |
| | | <DependentUpon>IntentViewController.cs</DependentUpon>
|
| | | </Compile>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ProjectReference Include="..\SiriKit\SiriKit.csproj">
|
| | | <Project>{8B1652FA-5158-4D57-B90D-07BB91766625}</Project>
|
| | | <Name>SiriKit</Name>
|
| | | </ProjectReference>
|
| | | </ItemGroup>
|
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.AppExtension.CSharp.targets" />
|
| | | </Project> |
| | |
| | | /* |
| | | See LICENSE folder for this sample’s licensing information. |
| | | ///* |
| | | //See LICENSE folder for this sample’s licensing information. |
| | | |
| | | Abstract: |
| | | A data manager that manages data conforming to `Codable` and stores it in `UserDefaults`. |
| | | */ |
| | | //Abstract: |
| | | //A data manager that manages data conforming to `Codable` and stores it in `UserDefaults`. |
| | | //*/ |
| | | |
| | | using System; |
| | | using Foundation; |
| | | using CoreFoundation; |
| | | //using System; |
| | | //using Foundation; |
| | | //using CoreFoundation; |
| | | |
| | | namespace Other.Siri |
| | | { |
| | | public struct UserDefaultsStorageDescriptor |
| | | { |
| | | public string Key { get; set; } |
| | | public UserDefaultsStorageDescriptor(string key) |
| | | { |
| | | Key = key; |
| | | } |
| | | } |
| | | //namespace SiriKit |
| | | //{ |
| | | // public struct UserDefaultsStorageDescriptor |
| | | // { |
| | | // public string Key { get; set; } |
| | | // public UserDefaultsStorageDescriptor(string key) |
| | | // { |
| | | // Key = key; |
| | | // } |
| | | // } |
| | | |
| | | public static class NotificationKeys |
| | | { |
| | | // Clients of `DataManager` that want to know when the data changes can |
| | | // listen for this notification. |
| | | public const string DataChanged = "DataChangedNotification"; |
| | | } |
| | | // public static class NotificationKeys |
| | | // { |
| | | // // Clients of `DataManager` that want to know when the data changes can |
| | | // // listen for this notification. |
| | | // public const string DataChanged = "DataChangedNotification"; |
| | | // } |
| | | |
| | | public class DataManager<ManagedDataType> : NSObject |
| | | where ManagedDataType : NSObject, INSCoding |
| | | { |
| | | // This sample uses App Groups to share a suite of data between the |
| | | // main app and the different extensions. |
| | | protected NSUserDefaults UserDefaults = NSUserDefaultsHelper.DataSuite; |
| | | // public class DataManager<ManagedDataType> : NSObject |
| | | // where ManagedDataType : NSObject, INSCoding |
| | | // { |
| | | // // This sample uses App Groups to share a suite of data between the |
| | | // // main app and the different extensions. |
| | | // protected NSUserDefaults UserDefaults = NSUserDefaultsHelper.DataSuite; |
| | | |
| | | // To prevent data races, all access to `UserDefaults` uses this queue. |
| | | protected DispatchQueue UserDefaultsAccessQueue = new DispatchQueue("User Defaults Access Queue"); |
| | | // // To prevent data races, all access to `UserDefaults` uses this queue. |
| | | // protected DispatchQueue UserDefaultsAccessQueue = new DispatchQueue("User Defaults Access Queue"); |
| | | |
| | | // Storage and observation information. |
| | | protected UserDefaultsStorageDescriptor StorageDescriptor; |
| | | // // Storage and observation information. |
| | | // protected UserDefaultsStorageDescriptor StorageDescriptor; |
| | | |
| | | // A flag to avoid receiving notifications about data this instance just |
| | | // wrote to `UserDefaults`. |
| | | protected bool IgnoreLocalUserDefaultsChanges = false; |
| | | // // A flag to avoid receiving notifications about data this instance just |
| | | // // wrote to `UserDefaults`. |
| | | // protected bool IgnoreLocalUserDefaultsChanges = false; |
| | | |
| | | // The observer object handed back after registering to observe a |
| | | // property. |
| | | IDisposable UserDefaultsObserver; |
| | | // // The observer object handed back after registering to observe a |
| | | // // property. |
| | | // IDisposable UserDefaultsObserver; |
| | | |
| | | // The data managed by this `DataManager`. |
| | | //此“DataManager”管理的数据。 |
| | | protected ManagedDataType ManagedDataBackingInstance; |
| | | // // The data managed by this `DataManager`. |
| | | // //此“DataManager”管理的数据。 |
| | | // protected ManagedDataType ManagedDataBackingInstance; |
| | | |
| | | // Access to `managedDataBackingInstance` needs to occur on a dedicated |
| | | // queue to avoid data races. |
| | | protected DispatchQueue DataAccessQueue = new DispatchQueue("Data Access Queue"); |
| | | // // Access to `managedDataBackingInstance` needs to occur on a dedicated |
| | | // // queue to avoid data races. |
| | | // protected DispatchQueue DataAccessQueue = new DispatchQueue("Data Access Queue"); |
| | | |
| | | // Public access to the managed data for clients of `DataManager` |
| | | public ManagedDataType ManagedData |
| | | { |
| | | get |
| | | { |
| | | ManagedDataType data = null; |
| | | DataAccessQueue.DispatchSync(() => data = ManagedDataBackingInstance); |
| | | return data; |
| | | } |
| | | } |
| | | // // Public access to the managed data for clients of `DataManager` |
| | | // public ManagedDataType ManagedData |
| | | // { |
| | | // get |
| | | // { |
| | | // ManagedDataType data = null; |
| | | // DataAccessQueue.DispatchSync(() => data = ManagedDataBackingInstance); |
| | | // return data; |
| | | // } |
| | | // } |
| | | |
| | | // See note below about createInitialData and initialData |
| | | public DataManager(UserDefaultsStorageDescriptor storageDescriptor, ManagedDataType initialData) |
| | | { |
| | | StorageDescriptor = storageDescriptor; |
| | | LoadData(); |
| | | if (ManagedDataBackingInstance is null) |
| | | { |
| | | ManagedDataBackingInstance = initialData; |
| | | WriteData(); |
| | | } |
| | | ObserveChangesInUserDefaults(); |
| | | } |
| | | // // See note below about createInitialData and initialData |
| | | // public DataManager(UserDefaultsStorageDescriptor storageDescriptor, ManagedDataType initialData) |
| | | // { |
| | | // StorageDescriptor = storageDescriptor; |
| | | // LoadData(); |
| | | // if (ManagedDataBackingInstance is null) |
| | | // { |
| | | // ManagedDataBackingInstance = initialData; |
| | | // WriteData(); |
| | | // } |
| | | // ObserveChangesInUserDefaults(); |
| | | // } |
| | | |
| | | // createInitialData |
| | | // |
| | | // The Swift version of this app has a createInitialData method. |
| | | // Each child class of the DataManager class overrides this method, and |
| | | // then the DataManager base class calls the derived versions to get |
| | | // the initial data. C# gives a compiler warning for this ("Virtual |
| | | // member call in constructor"). Since in C# the base class constructor |
| | | // is run before the child class constructor, having the base clas |
| | | // constructor call out to a method on the derived class is calling |
| | | // a method on an object that has not yet been fully constructed. |
| | | // The C# version of this sample works around this problem by passing |
| | | // in the initial data to the constructor. |
| | | // // createInitialData |
| | | // // |
| | | // // The Swift version of this app has a createInitialData method. |
| | | // // Each child class of the DataManager class overrides this method, and |
| | | // // then the DataManager base class calls the derived versions to get |
| | | // // the initial data. C# gives a compiler warning for this ("Virtual |
| | | // // member call in constructor"). Since in C# the base class constructor |
| | | // // is run before the child class constructor, having the base clas |
| | | // // constructor call out to a method on the derived class is calling |
| | | // // a method on an object that has not yet been fully constructed. |
| | | // // The C# version of this sample works around this problem by passing |
| | | // // in the initial data to the constructor. |
| | | |
| | | void ObserveChangesInUserDefaults() |
| | | { |
| | | var weakThis = new WeakReference<DataManager<ManagedDataType>>(this); |
| | | Action<NSObservedChange> changeHandler = (change) => |
| | | { |
| | | if (weakThis.TryGetTarget(out var dataManager)) |
| | | { |
| | | // Ignore any change notifications coming from data this |
| | | // instance just saved to `NSUserDefaults`. |
| | | if (dataManager is null || dataManager.IgnoreLocalUserDefaultsChanges) |
| | | { |
| | | return; |
| | | } |
| | | // void ObserveChangesInUserDefaults() |
| | | // { |
| | | // var weakThis = new WeakReference<DataManager<ManagedDataType>>(this); |
| | | // Action<NSObservedChange> changeHandler = (change) => |
| | | // { |
| | | // if (weakThis.TryGetTarget(out var dataManager)) |
| | | // { |
| | | // // Ignore any change notifications coming from data this |
| | | // // instance just saved to `NSUserDefaults`. |
| | | // if (dataManager is null || dataManager.IgnoreLocalUserDefaultsChanges) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // The underlying data changed in `NSUserDefaults`, so |
| | | // update this instance with the change and notify clients |
| | | // of the change. |
| | | dataManager.LoadData(); |
| | | dataManager.NotifyClientsDataChanged(); |
| | | } |
| | | }; |
| | | UserDefaultsObserver = UserDefaults.AddObserver( |
| | | StorageDescriptor.Key, |
| | | NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.New, |
| | | changeHandler |
| | | ); |
| | | } |
| | | // // The underlying data changed in `NSUserDefaults`, so |
| | | // // update this instance with the change and notify clients |
| | | // // of the change. |
| | | // dataManager.LoadData(); |
| | | // dataManager.NotifyClientsDataChanged(); |
| | | // } |
| | | // }; |
| | | // UserDefaultsObserver = UserDefaults.AddObserver( |
| | | // StorageDescriptor.Key, |
| | | // NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.New, |
| | | // changeHandler |
| | | // ); |
| | | // } |
| | | |
| | | // Notifies clients the data changed by posting an `NSNotification` with |
| | | // the key `NotificationKeys.DataChanged` |
| | | void NotifyClientsDataChanged() |
| | | { |
| | | var notification = NSNotification.FromName(NotificationKeys.DataChanged, this); |
| | | NSNotificationCenter.DefaultCenter.PostNotification(notification); |
| | | } |
| | | // // Notifies clients the data changed by posting an `NSNotification` with |
| | | // // the key `NotificationKeys.DataChanged` |
| | | // void NotifyClientsDataChanged() |
| | | // { |
| | | // var notification = NSNotification.FromName(NotificationKeys.DataChanged, this); |
| | | // NSNotificationCenter.DefaultCenter.PostNotification(notification); |
| | | // } |
| | | |
| | | protected virtual void FinishUnarchiving(NSObject unarchivedData) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | // protected virtual void FinishUnarchiving(NSObject unarchivedData) |
| | | // { |
| | | // throw new NotImplementedException(); |
| | | // } |
| | | |
| | | // Loads the data from `NSUserDefaults`. |
| | | void LoadData() |
| | | { |
| | | UserDefaultsAccessQueue.DispatchSync(() => |
| | | { |
| | | NSData archivedData = UserDefaults.DataForKey(StorageDescriptor.Key); |
| | | try |
| | | { |
| | | // Let the derived classes handle the specifics of |
| | | // putting the unarchived data in the correct format. |
| | | // This is necessary because the derived classes |
| | | // (SoupMenuManager, SoupOrderMenuManager) are using |
| | | // generic data formats (NSMutableSet<T> or NSMutableArray<T>) |
| | | // and these types cannot be casted directly from the |
| | | // deserialized data. |
| | | NSObject unarchivedData = NSKeyedUnarchiver.UnarchiveObject(archivedData); |
| | | FinishUnarchiving(unarchivedData); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (!(e is null)) |
| | | { |
| | | Console.WriteLine($"Error: {e.Message}"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | // // Loads the data from `NSUserDefaults`. |
| | | // void LoadData() |
| | | // { |
| | | // UserDefaultsAccessQueue.DispatchSync(() => |
| | | // { |
| | | // NSData archivedData = UserDefaults.DataForKey(StorageDescriptor.Key); |
| | | // try |
| | | // { |
| | | // // Let the derived classes handle the specifics of |
| | | // // putting the unarchived data in the correct format. |
| | | // // This is necessary because the derived classes |
| | | // // (SoupMenuManager, SoupOrderMenuManager) are using |
| | | // // generic data formats (NSMutableSet<T> or NSMutableArray<T>) |
| | | // // and these types cannot be casted directly from the |
| | | // // deserialized data. |
| | | // NSObject unarchivedData = NSKeyedUnarchiver.UnarchiveObject(archivedData); |
| | | // FinishUnarchiving(unarchivedData); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // if (!(e is null)) |
| | | // { |
| | | // Console.WriteLine($"Error: {e.Message}"); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | // Writes the data to `NSUserDefaults` |
| | | protected void WriteData() |
| | | { |
| | | UserDefaultsAccessQueue.DispatchAsync(() => |
| | | { |
| | | try |
| | | { |
| | | NSData encodedData = NSKeyedArchiver.ArchivedDataWithRootObject(ManagedDataBackingInstance); |
| | | IgnoreLocalUserDefaultsChanges = true; |
| | | UserDefaults.SetValueForKey(encodedData, (NSString)StorageDescriptor.Key); |
| | | IgnoreLocalUserDefaultsChanges = false; |
| | | NotifyClientsDataChanged(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw new Exception($"Could not save data. Reason: {e.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | // // Writes the data to `NSUserDefaults` |
| | | // protected void WriteData() |
| | | // { |
| | | // UserDefaultsAccessQueue.DispatchAsync(() => |
| | | // { |
| | | // try |
| | | // { |
| | | // NSData encodedData = NSKeyedArchiver.ArchivedDataWithRootObject(ManagedDataBackingInstance); |
| | | // IgnoreLocalUserDefaultsChanges = true; |
| | | // UserDefaults.SetValueForKey(encodedData, (NSString)StorageDescriptor.Key); |
| | | // IgnoreLocalUserDefaultsChanges = false; |
| | | // NotifyClientsDataChanged(); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // throw new Exception($"Could not save data. Reason: {e.Message}"); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |
| | |
| | | using System; |
| | | using Foundation; |
| | | using System.Resources; |
| | | namespace Other.Siri |
| | | namespace SiriKit |
| | | { |
| | | public static class NSUserDefaultsHelper |
| | | { |
| | |
| | | |
| | | public static class StorageKeys |
| | | { |
| | | public const string SoupMenu = "soupMenu"; |
| | | public const string OrderHistory = "orderHistory"; |
| | | public const string VoiceShortcutHistory = "voiceShortcutHistory"; |
| | | |
| | | public const string APP_KEY = "HDL-HOME-APP-TEST"; |
| | | public const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss"; |
| | |
| | | public const string GLOBAL_GRefreshToken = "RefreshToken"; |
| | | |
| | | public const string GLOBAL_GRegionUrl = "RegionUrl"; |
| | | |
| | | public const string GLOBAL_GHomeId = "HomeId"; |
| | | } |
| | | |
| | | public static NSUserDefaults DataSuite { |
| | |
| | | using System; |
| | | using System.Linq; |
| | | |
| | | namespace Other.Siri |
| | | namespace SiriKit |
| | | { |
| | | public class SceneDateManager : DataManager<NSMutableArray<SiriScene>> |
| | | public class SceneDateManager //: DataManager<NSMutableArray<HDLSceneSiri.HDLSiriSceneModel>> |
| | | { |
| | | public SceneDateManager() : base(new UserDefaultsStorageDescriptor(NSUserDefaultsHelper.StorageKeys.OrderHistory), new NSMutableArray<SiriScene>()) { } |
| | | public SceneDateManager() { }//: base(new UserDefaultsStorageDescriptor(NSUserDefaultsHelper.StorageKeys.OrderHistory), new NSMutableArray<HDLSceneSiri.HDLSiriSceneModel>()) { } |
| | | protected NSUserDefaults UserDefaults = NSUserDefaultsHelper.DataSuite; |
| | | |
| | | |
| | | #region Public API for clients of `SoupOrderDataManager` |
| | | // Convenience method to access the data with a property name that makes |
| | | // sense in the caller's context. |
| | | public NSMutableArray<SiriScene> OrderHistory |
| | | { |
| | | get |
| | | { |
| | | return ManagedData as NSMutableArray<SiriScene>; |
| | | } |
| | | } |
| | | //#region Public API for clients of `SoupOrderDataManager` |
| | | //// Convenience method to access the data with a property name that makes |
| | | //// sense in the caller's context. |
| | | //public NSMutableArray<HDLSceneSiri.HDLSiriSceneModel> OrderHistory |
| | | //{ |
| | | // get |
| | | // { |
| | | // return ManagedData as NSMutableArray<HDLSceneSiri.HDLSiriSceneModel>; |
| | | // } |
| | | //} |
| | | |
| | | #endregion |
| | | //#endregion |
| | | |
| | | #region Support methods for unarchiving saved data |
| | | override protected void FinishUnarchiving(NSObject unarchivedData) |
| | | { |
| | | var array = (NSArray)unarchivedData; |
| | | SiriScene[] orders = NSArray.FromArray<SiriScene>(array); |
| | | ManagedDataBackingInstance = new NSMutableArray<SiriScene>(orders); |
| | | } |
| | | #endregion |
| | | |
| | | public NSData GetData(string key) |
| | | { |
| | | var data = UserDefaults.DataForKey(key); |
| | | var d = UserDefaults.BoolForKey(key); |
| | | return data; |
| | | } |
| | | //#region Support methods for unarchiving saved data |
| | | //override protected void FinishUnarchiving(NSObject unarchivedData) |
| | | //{ |
| | | // var array = (NSArray)unarchivedData; |
| | | // HDLSceneSiri.HDLSiriSceneModel[] orders = NSArray.FromArray<HDLSceneSiri.HDLSiriSceneModel>(array); |
| | | // ManagedDataBackingInstance = new NSMutableArray<HDLSceneSiri.HDLSiriSceneModel>(orders); |
| | | //} |
| | | //#endregion |
| | | |
| | | public bool IsLgoin |
| | | { |
| | |
| | | var d = UserDefaults.BoolForKey(NSUserDefaultsHelper.StorageKeys.GLOBAL_GIsLogin); |
| | | return d; |
| | | } |
| | | set |
| | | { |
| | | UserDefaults.SetBool(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GIsLogin); |
| | | } |
| | | } |
| | | |
| | | public void SetIsLoginValue(bool value) |
| | | { |
| | | UserDefaults.SetBool(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GIsLogin); |
| | | } |
| | | |
| | | public string AccessToken |
| | | { |
| | |
| | | var d = UserDefaults.StringForKey(NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | return d; |
| | | } |
| | | } |
| | | public void SetAccessTokenValue(string accessToken) |
| | | { |
| | | UserDefaults.SetString(accessToken, NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | set |
| | | { |
| | | UserDefaults.SetString(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | |
| | | } |
| | | } |
| | | |
| | | public string RefreshToken |
| | |
| | | var d = UserDefaults.StringForKey(NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | return d; |
| | | } |
| | | } |
| | | public void SetRefreshTokenValue(string refreshToken) |
| | | { |
| | | UserDefaults.SetString(refreshToken, NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | set |
| | | { |
| | | UserDefaults.SetString(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | var d = UserDefaults.StringForKey(NSUserDefaultsHelper.StorageKeys.GLOBAL_GRegionUrl); |
| | | return d; |
| | | } |
| | | set |
| | | { |
| | | UserDefaults.SetString(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GRegionUrl); |
| | | } |
| | | } |
| | | public void SetRegionUrlValue(string regionUrl) |
| | | |
| | | public string HomeId |
| | | { |
| | | UserDefaults.SetString(regionUrl, NSUserDefaultsHelper.StorageKeys.GLOBAL_GRegionUrl); |
| | | get |
| | | { |
| | | var d = UserDefaults.StringForKey(NSUserDefaultsHelper.StorageKeys.GLOBAL_GHomeId); |
| | | return d; |
| | | } |
| | | set |
| | | { |
| | | UserDefaults.SetString(value, NSUserDefaultsHelper.StorageKeys.GLOBAL_GHomeId); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Compile Include="Properties\AssemblyInfo.cs" /> |
| | | <Compile Include="SiriScene.cs" /> |
| | | <Compile Include="VoiceShortcutDataManager.cs" /> |
| | | <Compile Include="Data\DataManager.cs" /> |
| | | <Compile Include="Data\SceneDateManager.cs" /> |
| | | <Compile Include="Support\NSUserActivityHelper.cs" /> |
| | | <Compile Include="HDLRunSceneIntentHandlder.cs" /> |
| | | <Compile Include="Data\NSUserDefaultsHelper.cs" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |