|
@@ -227,6 +227,11 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}
|
|
|
Long courseId = Long.parseLong(roomId);
|
|
|
+ // 默认获取首节课的课程信息
|
|
|
+ if (Objects.isNull(schedule)) {
|
|
|
+ schedule = courseScheduleDao.get(courseId);
|
|
|
+ }
|
|
|
+
|
|
|
//记录用户实际选择的房间
|
|
|
if (courseSchedule.getGroupType() == GroupType.COMM) {
|
|
|
roomId = "I" + roomId;
|
|
@@ -284,17 +289,17 @@ public class RoomServiceImpl implements RoomService {
|
|
|
|
|
|
// 直播形式网络课
|
|
|
ImLiveBroadcastRoom liveRoom;
|
|
|
- if (StringUtils.isNotBlank(courseSchedule.getLiveRoomId())) {
|
|
|
+ if (StringUtils.isNotBlank(schedule.getLiveRoomId())) {
|
|
|
|
|
|
// 直播间状态判断
|
|
|
liveRoom = imLiveBroadcastRoomService.lambdaQuery()
|
|
|
- .eq(ImLiveBroadcastRoom::getRoomUid, courseSchedule.getLiveRoomId())
|
|
|
+ .eq(ImLiveBroadcastRoom::getRoomUid, schedule.getLiveRoomId())
|
|
|
.last("LIMIT 1")
|
|
|
.one();
|
|
|
|
|
|
if (Objects.isNull(liveRoom)) {
|
|
|
// 创建网络课直播教室
|
|
|
- liveRoom = createVipGroupLiveRoom(roomId, courseSchedule);
|
|
|
+ liveRoom = createVipGroupLiveRoom(roomId, schedule);
|
|
|
}
|
|
|
|
|
|
// 直播间状态不在进行中
|
|
@@ -315,7 +320,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
} else {
|
|
|
|
|
|
// 创建网络课直播教室
|
|
|
- liveRoom = createVipGroupLiveRoom(roomId, courseSchedule);
|
|
|
+ liveRoom = createVipGroupLiveRoom(roomId, schedule);
|
|
|
}
|
|
|
|
|
|
// 返回直播间配置参数
|
|
@@ -329,11 +334,11 @@ public class RoomServiceImpl implements RoomService {
|
|
|
// 创建聊天群组
|
|
|
if (Optional.ofNullable(joinRoom).orElse(true)) {
|
|
|
// 创建IM群聊
|
|
|
- this.joinImGroup(roomId, courseSchedule.getActualTeacherId(), courseSchedule);
|
|
|
+ this.joinImGroup(roomId, schedule.getActualTeacherId(), schedule);
|
|
|
}
|
|
|
|
|
|
// RTC房间网络课
|
|
|
- genRtcRoomMemberInfoConfig(roomId, joinRoom, sysUser, userId, teacher, courseSchedule, curTime, roomResult, courseId);
|
|
|
+ genRtcRoomMemberInfoConfig(roomId, joinRoom, sysUser, userId, teacher, schedule, curTime, roomResult, courseId);
|
|
|
}
|
|
|
|
|
|
log.info("join room: roomId = {}, userId = {}", roomId, userId);
|