관리자 - 푸시 발송

- 본인 인증 여부에 따라 푸시 메시지를 발송할 수 있도록 isAuth 플래그 추가
This commit is contained in:
2023-11-24 14:38:33 +09:00
parent 3c72ae048e
commit 82ac381936
3 changed files with 22 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ interface MemberQueryRepository {
fun findByPushToken(pushToken: String): List<Member>
fun findByNicknameAndOtherCondition(nickname: String, member: Member): List<Member>
fun findCreatorByIdOrNull(memberId: Long): Member?
fun getAllRecipientPushTokens(isAuth: Boolean, container: String): List<List<String>>
fun getAllRecipientPushTokens(isAuth: Boolean?, container: String): List<List<String>>
fun getCreateLiveRoomNotificationRecipientPushTokens(
creatorId: Long,
isAuth: Boolean,
@@ -46,7 +46,7 @@ interface MemberQueryRepository {
): List<List<String>>
fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse
fun getIndividualRecipientPushTokens(recipients: List<Long>, isAuth: Boolean): Map<String, List<List<String>>>
fun getIndividualRecipientPushTokens(recipients: List<Long>, isAuth: Boolean?): Map<String, List<List<String>>>
fun getChangeNicknamePrice(memberId: Long): GetChangeNicknamePriceResponse
fun getMemberByEmail(email: String): Member?
@@ -93,14 +93,18 @@ class MemberQueryRepositoryImpl(
.fetchFirst()
}
override fun getAllRecipientPushTokens(isAuth: Boolean, container: String): List<List<String>> {
override fun getAllRecipientPushTokens(isAuth: Boolean?, container: String): List<List<String>> {
var where = member.isActive.isTrue
.and(member.email.notIn("admin@sodalive.net"))
.and(member.container.eq(container))
.and(member.pushToken.isNotNull)
if (isAuth) {
where = where.and(member.auth.isNotNull)
if (isAuth != null) {
where = if (isAuth) {
where.and(member.auth.isNotNull)
} else {
where.and(member.auth.isNull)
}
}
return queryFactory
@@ -276,15 +280,19 @@ class MemberQueryRepositoryImpl(
override fun getIndividualRecipientPushTokens(
recipients: List<Long>,
isAuth: Boolean
isAuth: Boolean?
): Map<String, List<List<String>>> {
var where = member.isActive.isTrue
.and(member.email.notIn("admin@sodalive.net"))
.and(member.id.`in`(*recipients.toTypedArray()))
.and(member.pushToken.isNotNull)
if (isAuth) {
where = where.and(member.auth.isNotNull)
if (isAuth != null) {
where = if (isAuth) {
where.and(member.auth.isNotNull)
} else {
where.and(member.auth.isNull)
}
}
val aosPushTokens = queryFactory