|
@@ -256,6 +256,12 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
// imHelper.joinGroup(new String[]{userId}, roomId, roomId);
|
|
|
|
|
|
+ // 主讲老师信息
|
|
|
+ SysUser teacherInfo = sysUserFeignService.queryUserById(courseSchedule.getActualTeacherId());
|
|
|
+ if (Objects.isNull(teacherInfo)) {
|
|
|
+ throw new BizException("主讲老师不存在");
|
|
|
+ }
|
|
|
+
|
|
|
// 获取RTC服务提供方
|
|
|
String rtcServiceProvider = Optional.ofNullable(sysConfigDao.findConfigValue("rtc_service_provider")).orElse("rongCloud");
|
|
|
|
|
@@ -270,20 +276,22 @@ public class RoomServiceImpl implements RoomService {
|
|
|
log.error("直播房间用户注册失败: userId={}", sysUser.getId(), e);
|
|
|
}
|
|
|
|
|
|
- // 主讲老师信息
|
|
|
- SysUser teacherInfo = sysUserFeignService.queryUserById(courseSchedule.getActualTeacherId());
|
|
|
- if (Objects.isNull(teacherInfo)) {
|
|
|
- throw new BizException("主讲老师不存在");
|
|
|
- }
|
|
|
+ // 返回配置参数
|
|
|
+ roomResult.userSig(userSig)
|
|
|
+ .rtcRoomConfig(rtcRoomPluginContext.getPluginService().getRTCRoomConfig(String.valueOf(sysUser.getId())))
|
|
|
+ .setGroupId(roomId);
|
|
|
+ } else {
|
|
|
+ // 融云RTC
|
|
|
+ // TODO:创建IM群聊,后续注释掉,统一使用后续流程
|
|
|
+ this.joinImGroup(roomId, courseSchedule.getActualTeacherId());
|
|
|
+ }
|
|
|
|
|
|
+ // 创建网络课聊天室
|
|
|
+ {
|
|
|
String joinImGroupKey = "joinImGroup:" + roomId;
|
|
|
// VIP课或网络课,IM群聊已创建标识
|
|
|
Boolean exists = redisTemplate.opsForValue().setIfAbsent(joinImGroupKey, roomId, 1L, TimeUnit.DAYS);
|
|
|
|
|
|
- // 缓存RTC服务提供方
|
|
|
- String rtcRoomPluginKey = "rtcRoomPlugin:" + roomId;
|
|
|
- redisTemplate.opsForValue().setIfAbsent(rtcRoomPluginKey, pluginService.pluginName(), 1L, TimeUnit.DAYS);
|
|
|
-
|
|
|
if (Optional.ofNullable(exists).orElse(false)) {
|
|
|
// 创建群组
|
|
|
log.info("createImGroup: roomId = {}, userId = {}", roomId, teacherInfo.getId());
|
|
@@ -311,16 +319,10 @@ public class RoomServiceImpl implements RoomService {
|
|
|
// 加入群组成员
|
|
|
log.info("joinImGroup: roomId = {}, userIds = {}", roomId, groupMembers);
|
|
|
pluginService.chatRoomGroupJoin(roomId, courseSchedule.getName(), groupMembers);
|
|
|
- }
|
|
|
|
|
|
- // 返回配置参数
|
|
|
- roomResult.userSig(userSig)
|
|
|
- .rtcRoomConfig(rtcRoomPluginContext.getPluginService().getRTCRoomConfig(String.valueOf(sysUser.getId())))
|
|
|
- .setGroupId(roomId);
|
|
|
- } else {
|
|
|
- // 融云RTC
|
|
|
- // 创建IM群聊
|
|
|
- this.joinImGroup(roomId, courseSchedule.getActualTeacherId());
|
|
|
+ // 更新网络课服务提供方
|
|
|
+ courseScheduleDao.updateServiceProvider(courseSchedule.getId(), rtcServiceProvider);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
List<CourseScheduleStudentMusicScore> scheduleStudentMusicScores = courseScheduleStudentMusicScoreDao.queryByScoreIdAndCourseId(null, courseId, null, null, null);
|