푸시 알림 전송 언어 처리
This commit is contained in:
@@ -459,7 +459,7 @@ class AudioContentService(
|
||||
applicationEventPublisher.publishEvent(
|
||||
FcmEvent(
|
||||
type = FcmEventType.INDIVIDUAL,
|
||||
title = formatMessage("content.notification.upload_complete_title"),
|
||||
titleKey = "content.notification.upload_complete_title",
|
||||
message = audioContent.title,
|
||||
recipients = listOf(audioContent.member!!.id!!),
|
||||
isAuth = null,
|
||||
@@ -474,23 +474,11 @@ class AudioContentService(
|
||||
FcmEvent(
|
||||
type = FcmEventType.UPLOAD_CONTENT,
|
||||
title = audioContent.member!!.nickname,
|
||||
message = formatMessage("content.notification.uploaded_message", audioContent.title),
|
||||
messageKey = "content.notification.uploaded_message",
|
||||
args = listOf(audioContent.title),
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = contentId,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "ios"
|
||||
)
|
||||
)
|
||||
|
||||
applicationEventPublisher.publishEvent(
|
||||
FcmEvent(
|
||||
type = FcmEventType.UPLOAD_CONTENT,
|
||||
title = audioContent.member!!.nickname,
|
||||
message = formatMessage("content.notification.uploaded_message", audioContent.title),
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = contentId,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "aos"
|
||||
creatorId = audioContent.member!!.id
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -508,23 +496,11 @@ class AudioContentService(
|
||||
FcmEvent(
|
||||
type = FcmEventType.UPLOAD_CONTENT,
|
||||
title = audioContent.member!!.nickname,
|
||||
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||
messageKey = "content.notification.uploaded_message",
|
||||
args = listOf(audioContent.title),
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = audioContent.id!!,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "ios"
|
||||
)
|
||||
)
|
||||
|
||||
applicationEventPublisher.publishEvent(
|
||||
FcmEvent(
|
||||
type = FcmEventType.UPLOAD_CONTENT,
|
||||
title = audioContent.member!!.nickname,
|
||||
message = "콘텐츠를 업로드 하였습니다. - ${audioContent.title}",
|
||||
isAuth = audioContent.isAdult,
|
||||
contentId = audioContent.id!!,
|
||||
creatorId = audioContent.member!!.id,
|
||||
container = "aos"
|
||||
creatorId = audioContent.member!!.id
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.querydsl.core.types.dsl.Expressions
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory
|
||||
import kr.co.vividnext.sodalive.content.QAudioContent.audioContent
|
||||
import kr.co.vividnext.sodalive.content.comment.QAudioContentComment.audioContentComment
|
||||
import kr.co.vividnext.sodalive.fcm.PushTokenInfo
|
||||
import kr.co.vividnext.sodalive.fcm.QPushToken.pushToken
|
||||
import kr.co.vividnext.sodalive.fcm.QPushTokenInfo
|
||||
import kr.co.vividnext.sodalive.member.QMember.member
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import org.springframework.stereotype.Repository
|
||||
@@ -38,7 +40,7 @@ interface AudioContentCommentQueryRepository {
|
||||
contentId: Long,
|
||||
commentParentId: Long?,
|
||||
myMemberId: Long
|
||||
): List<FindPushTokenByContentIdAndCommentParentIdMyMemberIdResponse>
|
||||
): List<PushTokenInfo>
|
||||
}
|
||||
|
||||
@Repository
|
||||
@@ -191,7 +193,7 @@ class AudioContentCommentQueryRepositoryImpl(
|
||||
contentId: Long,
|
||||
commentParentId: Long?,
|
||||
myMemberId: Long
|
||||
): List<FindPushTokenByContentIdAndCommentParentIdMyMemberIdResponse> {
|
||||
): List<PushTokenInfo> {
|
||||
var where = audioContent.id.eq(contentId)
|
||||
.and(member.id.ne(myMemberId))
|
||||
|
||||
@@ -206,9 +208,10 @@ class AudioContentCommentQueryRepositoryImpl(
|
||||
val response = if (commentParentId != null) {
|
||||
queryFactory
|
||||
.select(
|
||||
QFindPushTokenByContentIdAndCommentParentIdMyMemberIdResponse(
|
||||
QPushTokenInfo(
|
||||
pushToken.token,
|
||||
pushToken.deviceType
|
||||
pushToken.deviceType,
|
||||
pushToken.languageCode.coalesce("ko")
|
||||
)
|
||||
)
|
||||
.from(audioContentComment)
|
||||
@@ -220,9 +223,10 @@ class AudioContentCommentQueryRepositoryImpl(
|
||||
} else {
|
||||
queryFactory
|
||||
.select(
|
||||
QFindPushTokenByContentIdAndCommentParentIdMyMemberIdResponse(
|
||||
QPushTokenInfo(
|
||||
pushToken.token,
|
||||
pushToken.deviceType
|
||||
pushToken.deviceType,
|
||||
pushToken.languageCode.coalesce("ko")
|
||||
)
|
||||
)
|
||||
.from(audioContent)
|
||||
|
||||
@@ -83,11 +83,12 @@ class AudioContentCommentService(
|
||||
} else {
|
||||
member.nickname
|
||||
},
|
||||
message = if (parent != null) {
|
||||
formatMessage("content.comment.notification.reply", audioContent.title)
|
||||
messageKey = if (parent != null) {
|
||||
"content.comment.notification.reply"
|
||||
} else {
|
||||
formatMessage("content.comment.notification.new", audioContent.title)
|
||||
"content.comment.notification.new"
|
||||
},
|
||||
args = listOf(audioContent.title),
|
||||
contentId = audioContentId,
|
||||
commentParentId = parentId,
|
||||
myMemberId = member.id
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package kr.co.vividnext.sodalive.content.comment
|
||||
|
||||
import com.querydsl.core.annotations.QueryProjection
|
||||
|
||||
data class FindPushTokenByContentIdAndCommentParentIdMyMemberIdResponse @QueryProjection constructor(
|
||||
val pushToken: String,
|
||||
val container: String
|
||||
)
|
||||
Reference in New Issue
Block a user