Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 4개 초과 채팅방 참여 요청시 가장 오래된 채팅방 퇴장 로직 추가 #97

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

suakang17
Copy link
Collaborator

@suakang17 suakang17 commented Feb 21, 2024

Related Issue

#70

Changes

4개 초과 채팅방 참여 요청시 가장 오래된 채팅방 퇴장 로직 추가

Screenshots

.

To Reviewer

@Transactional
    public ChatMessageDto join(ChatMessageDto chatMessageDto) {

        List<Room> roomList = roomRepository.findJoinedRoomsByUid(chatMessageDto.getSenderId());
        if (roomList.size() == 4) {
            log.info("참여 가능한 채팅방 수 초과. 가장 오래된 채팅방에서 퇴장합니다.");
            String exitedRoomId = roomList.get(3).getId();
            roomRepository.exitRoom(exitedRoomId, chatMessageDto.getSenderId());
            log.info("가장 오래된 방 나가기 성공 uid={}, roomId={}", chatMessageDto.getSenderId(), exitedRoomId);
        }

Additional Context(optional)

현재 로컬 웹소켓 연결이 네트워크 연결로 안되어서 테스트하지 못했습니다.

How Has This Been Tested?

.

Checklist

  • PR 제목은 포맷과 내용 둘 다 알맞게 작성되었는가
  • PR에 대해 구체적으로 설명이 되어있는가

@suakang17 suakang17 added the enhancement New feature or request label Feb 21, 2024
@suakang17 suakang17 self-assigned this Feb 21, 2024
@github-actions github-actions bot added server 서버 관리 feature labels Feb 21, 2024
@suakang17 suakang17 merged commit 63d4ec8 into develop Feb 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature server 서버 관리
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant