| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | | using Shared; |
| | |
| | | //2.Body字符串转为byte数组 |
| | | byte[] bodyBytes = Encoding.UTF8.GetBytes(bodyDataString); |
| | | //判断是否需加密Body数据 |
| | | if (isEncryption && IsLocalEncryptAndGetAesKey) |
| | | //if (isEncryption && IsLocalEncryptAndGetAesKey) |
| | | { |
| | | bodyBytes = Securitys.EncryptionService.AesEncryptPayload(bodyBytes, DB_ResidenceData.Instance.CurrentRegion.localSecret); |
| | | //bodyDataString = Encoding.UTF8.GetString(bodyBytes); |
| | |
| | | var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid); |
| | | if (localFunction == null) |
| | | { |
| | | Console.WriteLine("找不到音乐播放器添=======" + revString); |
| | | MainPage.Log("找不到音乐播放器添=======" + revString); |
| | | continue; |
| | | } |
| | | MainPage.Log(localFunction.name); |
| | | |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | | { |
| | | if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk)) |
| | |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | //Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #region 门锁 |
| | | |
| | | /// <summary> |
| | | /// //一键(远程)开锁 |
| | | /// </summary> |
| | | public void OneKeyUnlocking(Function doorlock,string extStr) |
| | | { |
| | | if (Ins.GatewayOnline_Local) |
| | | { |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID,extStr); |
| | | var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); |
| | | var sendBytes = Ins.ConvertSendBodyData($"/base/{Control.Ins.GatewayId}/thing/service/doorRemoteOpen/down", functionControlDataJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 0); |
| | | } |
| | | else |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceId", doorlock.deviceId); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | HttpUtil.RequestHttpsPost("/home-wisdom/app/device/door/remoteOpen", requestJson); |
| | | } |
| | | } |
| | | //密码冻结 |
| | | //密码验证 |
| | | |
| | | #endregion |
| | | } |
| | | } |