fly 2 years ago
parent
commit
87cda6f68e
1 changed files with 16 additions and 2 deletions
  1. 16 2
      Service/DeviceService.cs

+ 16 - 2
Service/DeviceService.cs

@@ -1364,7 +1364,14 @@ namespace WingDeviceService.Service
                 ReceiverType = ApplicantTypeEnum.Client
             };
             await _notificationService.PostMessageAsync(notificationRequest);
-            //todo 更改房间调参状态 1 根据设备code获取房间 2 修改房间内某个人的调参状态
+            //更改房间调参状态 
+            var getRoomRequest = new FindRoomByCodeRequest { DeviceCode = deviceCode, UserCode = userCode };
+            var room = await _rtcService.GetLiveRoomByCodeAsync(getRoomRequest);
+            if (room != null && !string.IsNullOrWhiteSpace(room.RoomId))
+            {
+                var changeControllingParameterStateRequest = new SetLiveParamsRequest { UserCode = userCode, RoomId = room.RoomId, IsControllingParameter = false };
+                await _rtcService.ChangeControllingParameterStateAsync(changeControllingParameterStateRequest);
+            }
             return true;
         }
 
@@ -1402,7 +1409,14 @@ namespace WingDeviceService.Service
                 ReceiverType = ApplicantTypeEnum.Client
             };
             await _notificationService.PostMessageAsync(notificationRequest);
-            //todo 更改房间调参状态 1 根据设备code获取房间 2 修改房间内某个人的调参状态
+            //更改房间调参状态 
+            var getRoomRequest = new FindRoomByCodeRequest { DeviceCode = deviceCode, UserCode = userCode };
+            var room = await _rtcService.GetLiveRoomByCodeAsync(getRoomRequest);
+            if (room != null && !string.IsNullOrWhiteSpace(room.RoomId))
+            {
+                var changeControllingParameterStateRequest = new SetLiveParamsRequest { UserCode = userCode, RoomId = room.RoomId, IsControllingParameter = false };
+                await _rtcService.ChangeControllingParameterStateAsync(changeControllingParameterStateRequest);
+            }
             return true;
         }
     }