feat(creator-community): 커뮤니티 댓글 알림 딥링크에 게시글 식별자를 포함한다

This commit is contained in:
2026-03-13 18:54:14 +09:00
parent 5b547cb73c
commit b13a9888d4
8 changed files with 252 additions and 9 deletions

View File

@@ -49,6 +49,7 @@ class FcmEvent(
val auditionId: Long? = null,
val deepLinkValue: FcmDeepLinkValue? = null,
val deepLinkId: Long? = null,
val deepLinkCommentPostId: Long? = null,
val commentParentId: Long? = null,
val myMemberId: Long? = null,
val isAvailableJoinCreator: Boolean? = null,
@@ -193,7 +194,8 @@ class FcmSendListener(
creatorId = creatorId ?: fcmEvent.creatorId,
auditionId = auditionId ?: fcmEvent.auditionId,
deepLinkValue = fcmEvent.deepLinkValue,
deepLinkId = fcmEvent.deepLinkId
deepLinkId = fcmEvent.deepLinkId,
deepLinkCommentPostId = fcmEvent.deepLinkCommentPostId
)
}
}

View File

@@ -32,7 +32,8 @@ class FcmService(
creatorId: Long? = null,
auditionId: Long? = null,
deepLinkValue: FcmDeepLinkValue? = null,
deepLinkId: Long? = null
deepLinkId: Long? = null,
deepLinkCommentPostId: Long? = null
) {
if (tokens.isEmpty()) return
logger.info("os: $container")
@@ -89,7 +90,7 @@ class FcmService(
multicastMessage.putData("audition_id", auditionId.toString())
}
val deepLink = createDeepLink(deepLinkValue, deepLinkId)
val deepLink = createDeepLink(deepLinkValue, deepLinkId, deepLinkCommentPostId)
if (deepLink != null) {
multicastMessage.putData("deep_link", deepLink)
}
@@ -127,8 +128,12 @@ class FcmService(
}
}
private fun createDeepLink(deepLinkValue: FcmDeepLinkValue?, deepLinkId: Long?): String? {
return buildDeepLink(serverEnv, deepLinkValue, deepLinkId)
private fun createDeepLink(
deepLinkValue: FcmDeepLinkValue?,
deepLinkId: Long?,
deepLinkCommentPostId: Long?
): String? {
return buildDeepLink(serverEnv, deepLinkValue, deepLinkId, deepLinkCommentPostId)
}
fun sendPointGranted(tokens: List<String>, point: Int) {
@@ -201,7 +206,8 @@ class FcmService(
fun buildDeepLink(
serverEnv: String,
deepLinkValue: FcmDeepLinkValue?,
deepLinkId: Long?
deepLinkId: Long?,
deepLinkCommentPostId: Long? = null
): String? {
if (deepLinkValue == null || deepLinkId == null) {
return null
@@ -213,7 +219,12 @@ class FcmService(
"voiceon-test"
}
return "$uriScheme://${deepLinkValue.value}/$deepLinkId"
val baseDeepLink = "$uriScheme://${deepLinkValue.value}/$deepLinkId"
if (deepLinkValue == FcmDeepLinkValue.COMMUNITY && deepLinkCommentPostId != null) {
return "$baseDeepLink?postId=$deepLinkCommentPostId"
}
return baseDeepLink
}
}
}

View File

@@ -49,7 +49,12 @@ class PushNotificationService(
val category = resolveCategory(fcmEvent) ?: return
val senderSnapshot = resolveSenderSnapshot(fcmEvent)
val deepLink = FcmService.buildDeepLink(serverEnv, fcmEvent.deepLinkValue, fcmEvent.deepLinkId)
val deepLink = FcmService.buildDeepLink(
serverEnv = serverEnv,
deepLinkValue = fcmEvent.deepLinkValue,
deepLinkId = fcmEvent.deepLinkId,
deepLinkCommentPostId = fcmEvent.deepLinkCommentPostId
)
val notification = PushNotificationList(
senderNicknameSnapshot = senderSnapshot.nickname,