|
@@ -89,7 +89,13 @@ public class RoomServiceImpl implements RoomService {
|
|
@Override
|
|
@Override
|
|
public void startRecord(String roomId) throws Exception {
|
|
public void startRecord(String roomId) throws Exception {
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
- imHelper.startRecord(sysUser.getId().toString(),roomId);
|
|
|
|
|
|
+ IMApiResultInfo imApiResultInfo = imHelper.startRecord(sysUser.getId().toString(), roomId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void stopRecord(String roomId) throws Exception {
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ imHelper.stopRecord(sysUser.getId().toString(),roomId);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -343,6 +349,8 @@ public class RoomServiceImpl implements RoomService {
|
|
eduUserFeignService.updateFinishedExam(registrationId,0);
|
|
eduUserFeignService.updateFinishedExam(registrationId,0);
|
|
}
|
|
}
|
|
this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
|
|
+ IMApiResultInfo imApiResultInfo = imHelper.startRecord(userId, roomId);
|
|
|
|
+ eduUserFeignService.updateSessionId(registrationId,imApiResultInfo.getSessionId());
|
|
}
|
|
}
|
|
return baseResponse;
|
|
return baseResponse;
|
|
}
|
|
}
|
|
@@ -471,20 +479,21 @@ public class RoomServiceImpl implements RoomService {
|
|
public Boolean leaveRoom(Long registrationId,String userId,String roomId) throws Exception {
|
|
public Boolean leaveRoom(Long registrationId,String userId,String roomId) throws 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();
|
|
if(recordFlag != null && recordFlag == 1){
|
|
if(recordFlag != null && recordFlag == 1){
|
|
levelRecorded(registrationId);
|
|
levelRecorded(registrationId);
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
roomId = examResult.getRoomId();
|
|
roomId = examResult.getRoomId();
|
|
}
|
|
}
|
|
|
|
|
|
- SysUser user = null;
|
|
|
|
- if(StringUtils.isEmpty(userId)){
|
|
|
|
|
|
+ SysUser user = sysUserFeignService.queryUserInfo();
|
|
|
|
+ userId = user.getId().toString();
|
|
|
|
+ /*if(StringUtils.isEmpty(userId)){
|
|
user = sysUserFeignService.queryUserInfo();
|
|
user = sysUserFeignService.queryUserInfo();
|
|
userId = user.getId().toString();
|
|
userId = user.getId().toString();
|
|
}else {
|
|
}else {
|
|
user = sysUserFeignService.queryUserById(Integer.parseInt(userId));
|
|
user = sysUserFeignService.queryUserById(Integer.parseInt(userId));
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
log.info("leaveRoom: roomId={}, userId={}", roomId,userId);
|
|
log.info("leaveRoom: roomId={}, userId={}", roomId,userId);
|
|
|
|
|
|
CheckUtils.checkArgument(userId != null, "userId must't be null");
|
|
CheckUtils.checkArgument(userId != null, "userId must't be null");
|
|
@@ -539,29 +548,16 @@ public class RoomServiceImpl implements RoomService {
|
|
}*/
|
|
}*/
|
|
} else {
|
|
} else {
|
|
roomMemberDao.deleteUserByRidAndUid(roomId, userId);
|
|
roomMemberDao.deleteUserByRidAndUid(roomId, userId);
|
|
-
|
|
|
|
- /*IMApiResultInfo apiResultInfo = null;
|
|
|
|
- try {
|
|
|
|
- apiResultInfo = imHelper.quit(new String[]{userId}, roomId);
|
|
|
|
- if (apiResultInfo.isSuccess()) {
|
|
|
|
- roomMemberDao.deleteUserByRidAndUid(roomId, userId);
|
|
|
|
- MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
|
|
|
|
- msg.setUserName(user.getUsername());
|
|
|
|
- imHelper.publishMessage(userId, roomId, msg);
|
|
|
|
- imHelper.quit(new String[]{userId}, roomId);
|
|
|
|
- log.info("quit group: roomId={},userId: {}", roomId,userId);
|
|
|
|
- } else {
|
|
|
|
- throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, apiResultInfo.getErrorMessage());
|
|
|
|
- }
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("leave room error: roomId={}, {}", roomId, e.getMessage());
|
|
|
|
- throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR);
|
|
|
|
- }*/
|
|
|
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
|
|
|
|
+ msg.setUserName(user.getUsername());
|
|
|
|
+ imHelper.publishMessage(userId, roomId, msg);
|
|
|
|
+ log.info("quit group: roomId={},userId: {}", roomId,userId);
|
|
}
|
|
}
|
|
userDao.deleteByUid(userId);
|
|
userDao.deleteByUid(userId);
|
|
// this.signOut(Long.parseLong(roomId));
|
|
// this.signOut(Long.parseLong(roomId));
|
|
|
|
+// this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
if(registrationId != null){
|
|
if(registrationId != null){
|
|
- this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
|
|
|
|
|
|
+ imHelper.stopRecord(userId,roomId);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|