Compare commits

..

No commits in common. "3795fb4a403af2317f61dee1db95a6e2a87ee0dd" and "0c01aeec5009b5558bd77c44ff4f534cda39b91d" have entirely different histories.

7 changed files with 19 additions and 31 deletions

View File

@ -81,7 +81,7 @@ class ChargeEventService(
title = chargeEvent.title,
message = "$additionalCan 캔이 추가 지급되었습니다.",
recipients = listOf(member.id!!),
isAuth = null
isAuth = false
)
)
}
@ -103,7 +103,7 @@ class ChargeEventService(
title = "첫 충전 이벤트",
message = "$additionalCan 캔이 추가 지급되었습니다.",
recipients = listOf(member.id!!),
isAuth = null
isAuth = false
)
)
}

View File

@ -78,7 +78,7 @@ class AdsChargeService(
title = "제휴보상",
message = "${adsCharge.point.toInt()} 캔이 지급되었습니다.",
recipients = listOf(member.id!!),
isAuth = null
isAuth = false
)
)
}

View File

@ -341,7 +341,7 @@ class AudioContentService(
title = "콘텐츠 등록완료",
message = audioContent.title,
recipients = listOf(audioContent.member!!.id!!),
isAuth = null,
isAuth = audioContent.isAdult,
contentId = contentId
)
)

View File

@ -22,7 +22,6 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli
FcmEvent(
type = FcmEventType.INDIVIDUAL,
title = request.title,
isAuth = request.isAuth,
message = request.message,
recipients = request.memberIds
)
@ -33,8 +32,7 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli
type = FcmEventType.ALL,
title = request.title,
message = request.message,
container = "ios",
isAuth = request.isAuth
container = "ios"
)
)
@ -43,8 +41,7 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli
type = FcmEventType.ALL,
title = request.title,
message = request.message,
container = "aos",
isAuth = request.isAuth
container = "aos"
)
)
}

View File

@ -20,7 +20,7 @@ class FcmEvent(
val container: String = "",
val recipients: List<Long> = listOf(),
val recipientsMap: Map<String, List<List<String>>>? = null,
val isAuth: Boolean? = null,
val isAuth: Boolean = false,
val roomId: Long? = null,
val contentId: Long? = null,
val messageId: Long? = null,
@ -97,7 +97,7 @@ class FcmSendListener(
if (fcmEvent.container.isNotBlank()) {
val pushTokens = memberRepository.getCreateLiveRoomNotificationRecipientPushTokens(
creatorId = fcmEvent.creatorId!!,
isAuth = fcmEvent.isAuth ?: false,
isAuth = fcmEvent.isAuth,
container = fcmEvent.container
)
@ -118,7 +118,7 @@ class FcmSendListener(
val pushTokens = memberRepository.getStartLiveRoomNotificationRecipientPushTokens(
creatorId = fcmEvent.creatorId!!,
roomId = fcmEvent.roomId!!,
isAuth = fcmEvent.isAuth ?: false,
isAuth = fcmEvent.isAuth,
container = fcmEvent.container
)
@ -166,7 +166,7 @@ class FcmSendListener(
if (fcmEvent.container.isNotBlank()) {
val pushTokens = memberRepository.getUploadContentNotificationRecipientPushTokens(
creatorId = fcmEvent.creatorId!!,
isAuth = fcmEvent.isAuth ?: false,
isAuth = fcmEvent.isAuth,
container = fcmEvent.container
)

View File

@ -3,6 +3,5 @@ package kr.co.vividnext.sodalive.fcm
data class PushRequest(
val memberIds: List<Long>,
val title: String,
val message: String,
val isAuth: Boolean?
val message: String
)

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,18 +93,14 @@ 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 != null) {
where = if (isAuth) {
where.and(auth.isNotNull)
} else {
where.and(auth.isNull)
}
if (isAuth) {
where = where.and(member.auth.isNotNull)
}
return queryFactory
@ -280,19 +276,15 @@ 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 != null) {
where = if (isAuth) {
where.and(auth.isNotNull)
} else {
where.and(auth.isNull)
}
if (isAuth) {
where = where.and(member.auth.isNotNull)
}
val aosPushTokens = queryFactory