|
@@ -378,15 +378,8 @@ public class RoomServiceImpl implements RoomService {
|
|
|
log.info("createImGroup: roomId = {}, userId = {}", roomId, actualTeacherId);
|
|
|
if (TencentCloudRTCPlugin.PLUGIN_NAME.equals(pluginService.pluginName())) {
|
|
|
|
|
|
- try {
|
|
|
- // 生成群组,更新服务提供方
|
|
|
- pluginService.chatRoomCreate(roomId, courseSchedule.getName(), actualTeacherId.toString());
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("joinImGroup TENCENT_CLOUD error: roomId = {}, userId = {}", roomId, actualTeacherId, e);
|
|
|
- }
|
|
|
-
|
|
|
- // 更新网络课服务提供方
|
|
|
- courseScheduleDao.updateServiceProvider(courseSchedule.getId(), courseSchedule.getServiceProvider());
|
|
|
+ // 生成群组
|
|
|
+ pluginService.chatRoomCreate(roomId, courseSchedule.getName(), courseSchedule.getTeacherId().toString());
|
|
|
|
|
|
// 群组老师信息
|
|
|
List<ImGroupMemberWrapper.ImGroupMember> groupMembers = Lists.newArrayList(ImGroupMemberWrapper.ImGroupMember
|
|
@@ -419,6 +412,8 @@ public class RoomServiceImpl implements RoomService {
|
|
|
imHelper.joinGroup(integers, roomId, roomId);
|
|
|
}
|
|
|
|
|
|
+ // 更新网络课服务提供方
|
|
|
+ courseScheduleDao.updateServiceProvider(courseSchedule.getId(), courseSchedule.getServiceProvider());
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -563,9 +558,9 @@ public class RoomServiceImpl implements RoomService {
|
|
|
.action(EMemberAction.JOIN.getValue());
|
|
|
|
|
|
if (roleEnum == RoleTeacher) {
|
|
|
- action.role(EMemberRole.TEACHER.getValue());
|
|
|
+ action.role(roleEnum.getValue());
|
|
|
} else {
|
|
|
- action.role(EMemberRole.STUDENT.getValue());
|
|
|
+ action.role(roleEnum.getValue());
|
|
|
}
|
|
|
action.handUpOn(roomMember.isHand())
|
|
|
.microphone(playMidi)
|
|
@@ -715,7 +710,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
RTCRoomMessage.MessageContent messageContent = RTCRoomMessage.MessageContent
|
|
|
.builder()
|
|
|
.action(EMemberAction.LEAVE.getValue())
|
|
|
- .role(EMemberRole.STUDENT.getValue())
|
|
|
+ .role(roleEnum.getValue())
|
|
|
.handUpOn(false)
|
|
|
.timestamp(System.currentTimeMillis())
|
|
|
.microphone(false)
|
|
@@ -723,10 +718,6 @@ public class RoomServiceImpl implements RoomService {
|
|
|
.sendUserInfo(getSendUser(userId, roleEnum))
|
|
|
.build();
|
|
|
|
|
|
- if (roleEnum == RoleTeacher) {
|
|
|
- messageContent.setRole(EMemberRole.TEACHER.getValue());
|
|
|
- }
|
|
|
-
|
|
|
RTCRoomMessage roomMessage = RTCRoomMessage.builder()
|
|
|
.objectName(RTCRoomMessage.MEMBER_CHANGE_MESSAGE)
|
|
|
.toChatRoomId(roomId)
|