Skip to content

Commit fdefe26

Browse files
committed
fix: 병합 오류 제어
1 parent 25e6685 commit fdefe26

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/main/java/com/back/domain/studyroom/service/RoomService.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,22 @@ public void kickMember(Long roomId, Long targetUserId, Long requesterId) {
719719

720720
// 4. Redis에서 제거 (강제 퇴장) - VISITOR 포함 모든 사용자
721721
roomParticipantService.exitRoom(targetUserId, roomId);
722+
723+
// 5. 추방당한 유저에게 개인 WebSocket 메시지 전송
724+
java.util.Map<String, Object> kickNotification = new java.util.HashMap<>();
725+
kickNotification.put("type", "MEMBER_KICKED");
726+
kickNotification.put("roomId", roomId);
727+
kickNotification.put("message", "방에서 추방되었습니다");
728+
729+
messagingTemplate.convertAndSendToUser(
730+
targetUserId.toString(),
731+
"/queue/kick",
732+
kickNotification
733+
);
734+
735+
log.info("추방 알림 전송 완료 - RoomId: {}, TargetUserId: {}", roomId, targetUserId);
722736

723-
// 5. 멤버 추방 이벤트 발행
737+
// 6. 멤버 추방 이벤트 발행 (알림 시스템용)
724738
Room room = roomRepository.findById(roomId)
725739
.orElseThrow(() -> new CustomException(ErrorCode.ROOM_NOT_FOUND));
726740

0 commit comments

Comments
 (0)