feat(fcm): 채팅 deep link payload를 정리한다

This commit is contained in:
2026-06-19 03:57:12 +09:00
parent 0811f92bf5
commit 7f13cccde0
2 changed files with 16 additions and 9 deletions

View File

@@ -24,7 +24,8 @@ enum class FcmDeepLinkValue(val value: String) {
CONTENT("content"), CONTENT("content"),
SERIES("series"), SERIES("series"),
AUDITION("audition"), AUDITION("audition"),
COMMUNITY("community") COMMUNITY("community"),
CHAT("chat")
} }
class FcmEvent( class FcmEvent(

View File

@@ -6,22 +6,28 @@ import org.junit.jupiter.api.Test
class FcmServiceTest { class FcmServiceTest {
@Test @Test
@DisplayName("메시지 푸시 data payload는 채팅 이동에 필요한 chat_type을 포함한다") @DisplayName("v2 채팅 푸시 data payload는 deep_link만 포함한다")
fun shouldBuildMessagePayloadWithChatType() { fun shouldBuildV2ChatPayloadWithOnlyDeepLink() {
val payload = FcmService.buildDataPayload( val payload = FcmService.buildDataPayload(
roomId = 10L, roomId = null,
messageId = 204L, messageId = null,
contentId = null, contentId = null,
creatorId = null, creatorId = null,
auditionId = null, auditionId = null,
deepLinkValue = null, deepLinkValue = null,
deepLinkId = null, deepLinkId = null,
deepLinkCommentPostId = null, deepLinkCommentPostId = null,
chatType = "USER_CREATOR" deepLink = "voiceon-test://chat/10",
chatType = null
) )
assertEquals("10", payload["room_id"]) assertEquals(mapOf("deep_link" to "voiceon-test://chat/10"), payload)
assertEquals("204", payload["message_id"]) }
assertEquals("USER_CREATOR", payload["chat_type"])
@Test
@DisplayName("v2 채팅 deep_link는 환경별 scheme과 chat room id로 생성된다")
fun shouldBuildV2ChatDeepLinkWithRoomId() {
assertEquals("voiceon://chat/10", FcmService.buildDeepLink("voiceon", FcmDeepLinkValue.CHAT, 10L))
assertEquals("voiceon-test://chat/10", FcmService.buildDeepLink("local", FcmDeepLinkValue.CHAT, 10L))
} }
} }