ソースを参照

网络教室优化

zouxuan 3 年 前
コミット
1136cc5f28

+ 1 - 8
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -621,8 +621,6 @@ public class RoomServiceImpl implements RoomService {
         SysUser authUser = sysUserFeignService.queryUserInfo();
         String userId = authUser.getId().toString();
         log.info("display in room: {}, type = {}, uri = {}", roomId, type, uri);
-        CheckUtils.checkArgument(roomId != null, "roomId must't be null");
-        CheckUtils.checkArgument(type >= 0 && type < DisplayEnum.values().length, "type not exist");
         DisplayEnum displayEnum = DisplayEnum.values()[type];
 
         if (displayEnum.equals(DisplayEnum.None)) {
@@ -1265,12 +1263,7 @@ public class RoomServiceImpl implements RoomService {
         String userId = authUser.getId().toString();
         log.info("inviteUpgradeRole roomId = {}, targetUserId = {}, targetRole = {}", roomId, targetUserId, targetRole);
 
-        RoomMember targetUser = roomMemberDao.findOne(roomId, targetUserId);
-        if (targetUser == null) {
-            throw new ApiException(ErrorEnum.ERR_USER_NOT_EXIST_IN_ROOM);
-        }
-
-        checkOverMax(roomId, targetUser, targetRole);
+        checkOverMax(roomId, roomMember, targetRole);
 
         String ticket = IdentifierUtils.uuid();