|
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.microsvc.toolkit.middleware.rtc.RTCRoomPluginService;
|
|
|
+import com.microsvc.toolkit.middleware.rtc.message.TencentRequest;
|
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.ImNetworkRoomDao;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.SysConfigDao;
|
|
@@ -464,19 +466,12 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
|
|
|
.set(CourseSchedule::getMuteAll,!deviceControl.getEnable())
|
|
|
.set(CourseSchedule::getCancelMuteFlag,deviceControl.getCancelMuteFlag())
|
|
|
.update();
|
|
|
- }
|
|
|
- /*CourseSchedule courseSchedule = courseScheduleService.getById(deviceControl.getRoomId());
|
|
|
- // 修改网管课群自定义属性
|
|
|
- RTCRoomPluginService pluginService = rtcRoomPluginContext.getPluginService(courseSchedule.getServiceProvider());
|
|
|
- if (Objects.nonNull(pluginService) && Objects.nonNull(newCourseSchedule)) {
|
|
|
- // 更新群自定义字段
|
|
|
- updateChatRoomGroupData(data.getRoomId(), newCourseSchedule, pluginService);
|
|
|
+ CourseSchedule courseSchedule = courseScheduleService.getById(deviceControl.getRoomId());
|
|
|
+ // 修改网管课群自定义属性
|
|
|
+ RTCRoomPluginService pluginService = imGroupService.getRTCRoomPluginService(courseSchedule.getServiceProvider());
|
|
|
+ updateChatRoomGroupData(deviceControl.getRoomId(), courseSchedule, pluginService);
|
|
|
}
|
|
|
|
|
|
- // 取消网络课群静音
|
|
|
- if (Objects.isNull(data.getMicrophoneOn())) {
|
|
|
- return true;
|
|
|
- }*/
|
|
|
if (!CollectionUtils.isEmpty(roomMembers)) {
|
|
|
for (ImNetworkRoomMember roomMember : roomMembers) {
|
|
|
deviceControl.setUserId(roomMember.getUserId());
|
|
@@ -487,6 +482,32 @@ public class ImNetworkRoomServiceImpl extends ServiceImpl<ImNetworkRoomDao, ImNe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void updateChatRoomGroupData(String roomId, CourseSchedule courseSchedule, RTCRoomPluginService pluginService) {
|
|
|
+ // 生成群组自定义字段
|
|
|
+ List<TencentRequest.ChatRoomGroupDefinedData> definedDataList = Lists.newArrayList();
|
|
|
+
|
|
|
+ // 全员静音
|
|
|
+ definedDataList.add(TencentRequest.ChatRoomGroupDefinedData.builder()
|
|
|
+ .key("isMuteAll").value(courseSchedule.getMuteAll().toString())
|
|
|
+ .build());
|
|
|
+ // 取消静音
|
|
|
+ definedDataList.add(TencentRequest.ChatRoomGroupDefinedData.builder()
|
|
|
+ .key("cancelMuteFlag").value(courseSchedule.getCancelMuteFlag().toString())
|
|
|
+ .build());
|
|
|
+
|
|
|
+ if (org.apache.commons.collections.CollectionUtils.isNotEmpty(definedDataList)) {
|
|
|
+
|
|
|
+ try {
|
|
|
+ pluginService.chatRoomGroupDefinedData(TencentRequest.ChatRoomGroup.builder()
|
|
|
+ .groupId(roomId)
|
|
|
+ .appDefinedData(definedDataList)
|
|
|
+ .build());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("直播网管课自定义字段设置失败: roomId={}", roomId, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void controlDevice(ImNetworkDeviceControlDto deviceControl) throws Exception {
|