Skip to content

Conversation

@lehojun
Copy link
Member

@lehojun lehojun commented Jun 10, 2025

#️⃣연관된 이슈

#42

📝작업 내용

        WebhookEvent event = webhookReceiver.receive(body, authHeader);
        String roomName = event.getRoom().getName();
        Room room = roomRepository.findByTitle(roomName);
        long createAt = event.getRoom().getCreationTime();
        System.out.println("LiveKit Webhook: " + event.toString());

        switch (event.toString()) {
            case "room_started" -> {
                room = Room.builder()
                        .title(roomName)
                        .createDate(createAt)
                        .build();
                roomRepository.save(room);
            }
            case "room_finished" -> roomRepository.delete(room);
            case "participant_joined" -> {
                room.setParticipantCount(room.getParticipantCount() + 1);
                roomRepository.save(room);
            }
            case "participant_left" -> {
                room.setParticipantCount(room.getParticipantCount() - 1);
                roomRepository.save(room);
            }
        }

이벤트를 수신하여, 이벤트의 이름에 따라 데이터베이스에 방을 생성하고, 참가자를 더하고 빼고, 방을 삭제하는 로직을 추가하였습니다.

@lehojun lehojun self-assigned this Jun 10, 2025
@lehojun lehojun added the ✨ Feature 기능 개발 label Jun 10, 2025
@lehojun lehojun linked an issue Jun 10, 2025 that may be closed by this pull request
2 tasks
@lehojun lehojun merged commit ccfd1c6 into main Jun 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 스터디룸 목록 조회 방식 변경

2 participants