|
@@ -8,6 +8,7 @@ import com.keao.edu.im.api.entity.MemberChangedMessage;
|
|
import com.keao.edu.im.api.entity.PublishMessageDto;
|
|
import com.keao.edu.im.api.entity.PublishMessageDto;
|
|
import com.keao.edu.im.api.entity.ReqUserData;
|
|
import com.keao.edu.im.api.entity.ReqUserData;
|
|
import com.keao.edu.im.common.ApiException;
|
|
import com.keao.edu.im.common.ApiException;
|
|
|
|
+import com.keao.edu.im.common.BaseResponse;
|
|
import com.keao.edu.im.common.ErrorEnum;
|
|
import com.keao.edu.im.common.ErrorEnum;
|
|
import com.keao.edu.im.config.IMProperties;
|
|
import com.keao.edu.im.config.IMProperties;
|
|
import com.keao.edu.im.dao.*;
|
|
import com.keao.edu.im.dao.*;
|
|
@@ -189,9 +190,14 @@ public class RoomServiceImpl implements RoomService {
|
|
return roomResult;
|
|
return roomResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private BaseResponse getBaseResponse(BaseResponse baseResponse){
|
|
|
|
+ baseResponse.setErrCode(500);
|
|
|
|
+ return baseResponse;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
|
|
@Override
|
|
@Override
|
|
- public RoomResult joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera,boolean isMusicMode,String roomId) throws ApiException, Exception {
|
|
|
|
|
|
+ public BaseResponse joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera, boolean isMusicMode, String roomId) throws ApiException, Exception {
|
|
if(registrationId != null){
|
|
if(registrationId != null){
|
|
StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
|
|
StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
|
|
Integer recordFlag = examResult.getRecordFlag();
|
|
Integer recordFlag = examResult.getRecordFlag();
|
|
@@ -234,6 +240,7 @@ public class RoomServiceImpl implements RoomService {
|
|
}*/
|
|
}*/
|
|
RoleEnum roleEnum;
|
|
RoleEnum roleEnum;
|
|
RoomResult roomResult = new RoomResult();
|
|
RoomResult roomResult = new RoomResult();
|
|
|
|
+ BaseResponse baseResponse = new BaseResponse(roomResult);
|
|
RoomResult.MemberResult userResult = new RoomResult.MemberResult();
|
|
RoomResult.MemberResult userResult = new RoomResult.MemberResult();
|
|
List<RoomMember> memberList = roomMemberDao.findByRidAndUid(roomId, userId);
|
|
List<RoomMember> memberList = roomMemberDao.findByRidAndUid(roomId, userId);
|
|
if (memberList.isEmpty()) {
|
|
if (memberList.isEmpty()) {
|
|
@@ -244,10 +251,14 @@ public class RoomServiceImpl implements RoomService {
|
|
}else {
|
|
}else {
|
|
ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(registrationId);
|
|
ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(registrationId);
|
|
if(examRoomStudentRelation == null){
|
|
if(examRoomStudentRelation == null){
|
|
- throw new BizException("学员考试数据异常");
|
|
|
|
|
|
+ log.info("user join the room: roomId={} , userId={}", roomId, userId);
|
|
|
|
+ baseResponse.setErrMsg("学员考试数据异常");
|
|
|
|
+ return getBaseResponse(baseResponse);
|
|
}
|
|
}
|
|
if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
|
|
if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
|
|
- throw new BizException("考级入口已关闭");
|
|
|
|
|
|
+ log.info("user join the room: roomId={} , userId={}", roomId, userId);
|
|
|
|
+ baseResponse.setErrMsg("考级入口已关闭");
|
|
|
|
+ return getBaseResponse(baseResponse);
|
|
}
|
|
}
|
|
roleEnum = Student;
|
|
roleEnum = Student;
|
|
}
|
|
}
|
|
@@ -267,10 +278,14 @@ public class RoomServiceImpl implements RoomService {
|
|
if(roleEnum == Student){
|
|
if(roleEnum == Student){
|
|
ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(registrationId);
|
|
ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(registrationId);
|
|
if(examRoomStudentRelation == null){
|
|
if(examRoomStudentRelation == null){
|
|
- throw new BizException("学员考试数据异常");
|
|
|
|
|
|
+ log.info("user join the room: roomId={} , userId={}", roomId, userId);
|
|
|
|
+ baseResponse.setErrMsg("学员考试数据异常");
|
|
|
|
+ return getBaseResponse(baseResponse);
|
|
}
|
|
}
|
|
if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
|
|
if(examRoomStudentRelation.getClassroomSwitch() == YesOrNoEnum.NO){
|
|
- throw new BizException("考级入口已关闭");
|
|
|
|
|
|
+ log.info("user join the room: roomId={} , userId={}", roomId, userId);
|
|
|
|
+ baseResponse.setErrMsg("考级入口已关闭");
|
|
|
|
+ return getBaseResponse(baseResponse);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// roomMemberDao.updateCameraByRidAndUid(roomId, userId, !isDisableCamera);
|
|
// roomMemberDao.updateCameraByRidAndUid(roomId, userId, !isDisableCamera);
|
|
@@ -326,7 +341,7 @@ public class RoomServiceImpl implements RoomService {
|
|
if(registrationId != null){
|
|
if(registrationId != null){
|
|
this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
}
|
|
}
|
|
- return roomResult;
|
|
|
|
|
|
+ return baseResponse;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|