Skip to content

[feature/#727] 게임판 알림 기능 구현 - #736

Merged
kanghana1 merged 6 commits into
developfrom
feature/#727
Sep 4, 2026
Merged

kanghana1 merged 6 commits into
developfrom
feature/#727

Conversation

@kanghana1

@kanghana1 kanghana1 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

❤️ 기능 설명

게임판 기능 추가에 따라 게임 관련 푸시/인앱 알림 2종을 구현했습니다. 두 알림 모두 클릭 시 게임판 페이지(GAME_BOARD)로 이동합니다.

  1. 게임 시작 알림 - '○○코트' 입장해주세요!
  • 트리거: 대기 게임이 코트에 배치되어 시작될 때 (GameCommandService.startGame)
  • 수신자: 해당 게임에 배정된 회원(게스트 제외). 전원 게스트면 미발송
  • 문구: court.getCourtName() 사용 → 사용자가 지정한 코트 이름, 없으면 "N번 코트" 기본값 자동 반영
  1. 게임 진행자 지정 알림 - 게임 진행자로 지정되었습니다.
  • 트리거: 게임 진행자 변경 시 (ExerciseGameHostCommandService.changeGameHost)
  • 수신자: 새로 지정된 진행자 본인 1명

연결된 issue

연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #727



🩷 Approve 하기 전 확인해주세요!

  • 게임 참여자에 게스트가 있는 경우 알림을 그냥 못받는게 맞을지 고민입니다. 초대자에게 대리로 보내기에는 매번 같이 운동한다는 보장이 없다보니 고민이 되네요.

✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 테스트 결과 사진을 넣었는가?
  • 이슈넘버를 적었는가?

- NotificationResourceType.GAME_BOARD, NotificationSource.GAME 추가
- NotificationOutboxEventType에 GAME_STARTED, GAME_HOST_ASSIGNED 추가
- NotificationMessageGenerator에 게임 시작/진행자 지정 메시지 추가
- GameStartedEvent 추가 (게임 시작 시 배정 회원 대상, 게스트 제외)
- GameNotificationStrategy 추가: GAME_STARTED -> GAME_BOARD destination 변환
- NotificationOutboxEventListener에 게임 시작 이벤트 핸들러 배선
- GameCommandService.startGame에서 회원 수집 후 이벤트 발행
- 코트 이름(사용자 지정/기본값)을 알림 문구에 사용
- 전략/발행 단위 테스트 추가
@kanghana1
kanghana1 requested a review from Dimo-2562 September 2, 2026 05:54
@kanghana1 kanghana1 self-assigned this Sep 2, 2026
@kanghana1 kanghana1 added the 🛠️ FEAT This issue or pull request already exists label Sep 2, 2026
@kanghana1 kanghana1 changed the title [feature/#727] [feature/#727] 게임판 알림 기능 구현 Sep 2, 2026
@kanghana1
kanghana1 merged commit 82fd27f into develop Sep 4, 2026
1 check passed

@Dimo-2562 Dimo-2562 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FcmService:64-70을 보면 현재 푸시 알림에서 단순 title와 content만 적혀 있습니다.
프론트에서 여러 종류의 푸시 알림마다 이동되는 페이지가 다를텐데 혹시 알림의 종류를 주는 건 어떨까요?

ExerciseErrorCode.INVALID_GAME_HOST_CANDIDATE));

exercise.changeGameHost(command.participantId());
publishGameHostAssigned(exercise, command.participantId());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 게임 지정자 변경을 할 때 자기 자신으로 유지하는 경우에도 성공을 보장하고 있습니다.

하지만 이 경우 자기자신으로 유지했음에도 변경 이벤트가 발행되어 푸시 알림이 갈 우려가 있으므로 이벤트 발행을 조건부로 하는 건 어떨까요??

return;
}

Exercise exercise = exerciseRepository.findByGameBoardId(gameBoardId)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

별건 아닌데 startGame()의 gameBoardAccessValidator.validateGameHost()에서 exercise를 조회함에도 푸시 알림을 위해 다시 조회를 진행하여 중복이 있는 것 같습니다!

* @param imageKey 알림 이미지 키 (모임 이미지, 없으면 null)
* @param recipientMemberId 알림 수신 대상 회원 ID (새로 지정된 진행자 본인)
*/
public record GameHostAssignedEvent(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gameHostId의 소유권이 exercise 도메인에 있으므로 gameHostAssignedEvent를 exercise 도메인으로 옮기는 방향은 어떨까요?

@kanghana1 kanghana1 mentioned this pull request Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ FEAT This issue or pull request already exists

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 게임판 알림기능 추가

2 participants