|
@@ -13,13 +13,11 @@ import java.util.concurrent.CompletableFuture;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.function.BiFunction;
|
|
|
import java.util.function.BiPredicate;
|
|
|
-import java.util.function.Consumer;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import com.microsvc.toolkit.middleware.live.LivePluginContext;
|
|
|
import com.microsvc.toolkit.middleware.live.LivePluginService;
|
|
|
import com.microsvc.toolkit.middleware.live.impl.RongCloudLivePlugin;
|
|
@@ -379,6 +377,9 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
} else {
|
|
|
room.setRoomUid(c.getRoomUid());
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(teacherIds) && Arrays.asList(teacherIds.split(",")).contains(room.getSpeakerId().toString())) {
|
|
|
+ room.setOs("pc");
|
|
|
+ }
|
|
|
room.setRoomTitle(titleMap.get(c.getCourseGroupId()));
|
|
|
room.setLiveRemark(remarkMap.get(c.getCourseGroupId()));
|
|
|
room.setSpeakerId(c.getTeacherId());
|
|
@@ -521,17 +522,22 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
|
|
|
// 生成录制任务
|
|
|
log.info("createLiveRoom>>>>>> recordStart:{}", recordStart.jsonString());
|
|
|
- RTCRoom.RecordResp resp = pluginService.rtcRoomRecordStart(recordStart);
|
|
|
-
|
|
|
- // 设置录制任务Id
|
|
|
- LiveRoom update = new LiveRoom();
|
|
|
- update.setId(room.getId());
|
|
|
- if (StringUtils.isBlank(room.getVideoRecord())) {
|
|
|
- update.setVideoRecord(resp.getRecordId());
|
|
|
- } else {
|
|
|
- update.setVideoRecord(room.getVideoRecord() + "," + resp.getRecordId());
|
|
|
+ try {
|
|
|
+
|
|
|
+ RTCRoom.RecordResp resp = pluginService.rtcRoomRecordStart(recordStart);
|
|
|
+ // 设置录制任务Id
|
|
|
+ LiveRoom update = new LiveRoom();
|
|
|
+ update.setId(room.getId());
|
|
|
+ if (StringUtils.isBlank(room.getVideoRecord())) {
|
|
|
+ update.setVideoRecord(resp.getRecordId());
|
|
|
+ } else {
|
|
|
+ update.setVideoRecord(room.getVideoRecord() + "," + resp.getRecordId());
|
|
|
+ }
|
|
|
+ updateById(update);
|
|
|
+ }catch (Exception e) {
|
|
|
+ log.error("createLiveRoom>>>>>> recordStart error:{}", e.getMessage());
|
|
|
}
|
|
|
- updateById(update);
|
|
|
+
|
|
|
}
|
|
|
// 设置直播间房间属性默认值
|
|
|
setDefaultRoomDefinedInfo(room);
|
|
@@ -2163,12 +2169,7 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
roomVo.setTotalLookNum(0);
|
|
|
roomVo.setLookNum(0);
|
|
|
|
|
|
- ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto roomMemberNumDto = imLiveBroadcastRoomMemberMapper.queryMemberNum(roomVo.getRoomUid());
|
|
|
- if (roomMemberNumDto == null) {
|
|
|
- roomMemberNumDto = new ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto();
|
|
|
- roomMemberNumDto.setTotalNum(0);
|
|
|
- roomMemberNumDto.setOnlineNum(0);
|
|
|
- }
|
|
|
+ ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto roomMemberNumDto = getRoomMemberNumDto(roomVo.getRoomUid());
|
|
|
roomVo.setTotalLookNum(roomMemberNumDto.getTotalNum() == null? 0 : roomMemberNumDto.getTotalNum());
|
|
|
roomVo.setLookNum(roomMemberNumDto.getOnlineNum() == null? 0 : roomMemberNumDto.getOnlineNum());
|
|
|
|
|
@@ -2192,6 +2193,18 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto getRoomMemberNumDto(String roomUid) {
|
|
|
+ ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto roomMemberNumDto = imLiveBroadcastRoomMemberMapper.queryMemberNum(roomUid);
|
|
|
+ if (roomMemberNumDto == null) {
|
|
|
+ roomMemberNumDto = new ImLiveBroadcastRoomMemberWrapper.RoomMemberNumDto();
|
|
|
+ roomMemberNumDto.setTotalNum(0);
|
|
|
+ roomMemberNumDto.setOnlineNum(0);
|
|
|
+ }
|
|
|
+ return roomMemberNumDto;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 同步直播间点赞数
|
|
|
*
|