푸시 알림 전송 언어 처리
This commit is contained in:
+10
-6
@@ -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)
|
||||
|
||||
+4
-3
@@ -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
|
||||
|
||||
-8
@@ -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