zouxuan 5 vuotta sitten
vanhempi
commit
02ae757683

+ 0 - 1
edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/client/ImFeignService.java

@@ -102,7 +102,6 @@ public interface ImFeignService {
 	 * @return
 	 */
 	@PostMapping(value = "room/kick")
-	@Async
 	void kickRoom(@RequestBody ReqUserData reqUserData);
 
 	/**

+ 1 - 0
edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java

@@ -390,6 +390,7 @@ public class IMHelper {
      * @return
      * @throws Exception
      */
+    @Async
     public IMApiResultInfo stopRecord(String roomId) throws Exception {
         if (roomId == null) {
             throw new IllegalArgumentException("Paramer 'roomId' is required");

+ 4 - 18
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -479,8 +479,8 @@ public class RoomServiceImpl implements RoomService {
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
-    public Boolean kickMember(ReqUserData data) throws ApiException, Exception {
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean kickMember(ReqUserData data) throws Exception {
         StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(data.getRegistrationId());
         String roomId = examResult.getRoomId();
 
@@ -499,30 +499,16 @@ public class RoomServiceImpl implements RoomService {
             UserInfo userInfo = userDao.findByUid(data.getUserId());
             if (userInfo != null) {
                 msg.setUserName(userInfo.getName());
-            }/*
-            if("recorded".equals(data.getType())){
-                msg.setRoomId("recorded" + roomId);
-            }*/
-            imHelper.stopRecord(roomId);
+            }
             IMApiResultInfo apiResultInfo = imHelper.publishMessage(userId, roomId, msg, 1);
             if (!apiResultInfo.isSuccess()) {
                 throw new ApiException(ErrorEnum.ERR_MESSAGE_ERROR);
             }
-//            Thread.sleep(50);
             log.info("published msg: msg={}", msg);
-            /*List<Room> roomList = roomDao.findByRid(roomId);
-            if (kickedUsers.get(0).getRole() != Student.getValue() && isUserDisplay(roomList.get(0), userId)) {
-                updateDisplay(roomId, userId, "", 1);
-            } else {
-                log.info("don't update display: room={}, userRole={}", roomId, RoleEnum.getEnumByValue(kickedUsers.get(0).getRole()));
-            }*/
             eduUserFeignService.upsetStudentAttendance(data.getRegistrationId(),1);
+            imHelper.stopRecord(roomId);
         }
         userDao.deleteByUid(data.getUserId());
-        /*IMApiResultInfo apiResultInfo = imHelper.quit(new String[]{data.getUserId()}, roomId);
-        if (!apiResultInfo.isSuccess()) {
-            throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, apiResultInfo.getErrorMessage());
-        }*/
         return true;
     }