|
@@ -1087,10 +1087,15 @@ namespace WingDeviceService.Service
|
|
|
var notify = new DeviceParametersNotification()
|
|
|
{
|
|
|
DeviceCode = deviceCode,
|
|
|
- ProbeApplication = request.ProbeApplication,
|
|
|
- Parameter = request.Parameter,
|
|
|
IsResponse = true
|
|
|
};
|
|
|
+ CacheMaintenance.Instance.Get<IControllingParametersManager>().Remove(deviceCode);
|
|
|
+ CacheMaintenance.Instance.Get<IControllingParametersManager>().Add(new CacheControllingParameter()
|
|
|
+ {
|
|
|
+ Code = deviceCode,
|
|
|
+ ProbeApplication = Newtonsoft.Json.JsonConvert.SerializeObject(request.ProbeApplication),
|
|
|
+ Parameter = Newtonsoft.Json.JsonConvert.SerializeObject(request.Parameter),
|
|
|
+ });
|
|
|
var notificationRequest = new SendNotificationRequest()
|
|
|
{
|
|
|
ClientId = userCode,
|
|
@@ -1105,6 +1110,31 @@ namespace WingDeviceService.Service
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 获取设备参数调节数据请求
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<DeviceControlParameterDataDTO> GetControlParametersAsync(GetControlParametersRequest request)
|
|
|
+ {
|
|
|
+ var deviceCode = request.DeviceCode;
|
|
|
+ //检查设备编码不为空
|
|
|
+ if (string.IsNullOrWhiteSpace(deviceCode))
|
|
|
+ {
|
|
|
+ ThrowCustomerException(CustomerRpcCode.DeviceCodeIsEmpty, "Required parameter:DeviceCode cannot be empty");
|
|
|
+ }
|
|
|
+ var controlParameterData = CacheMaintenance.Instance.Get<IControllingParametersManager>().Get(request.DeviceCode);
|
|
|
+ if (controlParameterData != null)
|
|
|
+ {
|
|
|
+ return new DeviceControlParameterDataDTO()
|
|
|
+ {
|
|
|
+ DeviceCode = controlParameterData.Code,
|
|
|
+ ProbeApplication = controlParameterData.ProbeApplication,
|
|
|
+ Parameter = controlParameterData.Parameter
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 用户进入设备直播房间
|
|
|
/// </summary>
|