From 82ac381936f6dfc40ff4de61d148e3c5d7ac8bc7 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 24 Nov 2023 14:38:33 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=EB=B0=9C=EC=86=A1=20-=20=EB=B3=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=ED=91=B8=EC=8B=9C=20=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9C=EC=86=A1=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20isAuth=20=ED=94=8C=EB=9E=98=EA=B7=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/vividnext/sodalive/fcm/FcmEvent.kt | 8 +++---- .../co/vividnext/sodalive/fcm/PushRequest.kt | 3 ++- .../sodalive/member/MemberRepository.kt | 24 ++++++++++++------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmEvent.kt b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmEvent.kt index 37b4820..8b0c4d9 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmEvent.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmEvent.kt @@ -20,7 +20,7 @@ class FcmEvent( val container: String = "", val recipients: List = listOf(), val recipientsMap: Map>>? = null, - val isAuth: Boolean = false, + val isAuth: Boolean? = null, 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, + isAuth = fcmEvent.isAuth ?: false, container = fcmEvent.container ) @@ -118,7 +118,7 @@ class FcmSendListener( val pushTokens = memberRepository.getStartLiveRoomNotificationRecipientPushTokens( creatorId = fcmEvent.creatorId!!, roomId = fcmEvent.roomId!!, - isAuth = fcmEvent.isAuth, + isAuth = fcmEvent.isAuth ?: false, container = fcmEvent.container ) @@ -166,7 +166,7 @@ class FcmSendListener( if (fcmEvent.container.isNotBlank()) { val pushTokens = memberRepository.getUploadContentNotificationRecipientPushTokens( creatorId = fcmEvent.creatorId!!, - isAuth = fcmEvent.isAuth, + isAuth = fcmEvent.isAuth ?: false, container = fcmEvent.container ) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/PushRequest.kt b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/PushRequest.kt index c0966b4..c73a26c 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/PushRequest.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/PushRequest.kt @@ -3,5 +3,6 @@ package kr.co.vividnext.sodalive.fcm data class PushRequest( val memberIds: List, val title: String, - val message: String + val message: String, + val isAuth: Boolean? ) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt index c85cefa..db9eacf 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt @@ -25,7 +25,7 @@ interface MemberQueryRepository { fun findByPushToken(pushToken: String): List fun findByNicknameAndOtherCondition(nickname: String, member: Member): List fun findCreatorByIdOrNull(memberId: Long): Member? - fun getAllRecipientPushTokens(isAuth: Boolean, container: String): List> + fun getAllRecipientPushTokens(isAuth: Boolean?, container: String): List> fun getCreateLiveRoomNotificationRecipientPushTokens( creatorId: Long, isAuth: Boolean, @@ -46,7 +46,7 @@ interface MemberQueryRepository { ): List> fun getMessageRecipientPushToken(messageId: Long): GetMessageRecipientPushTokenResponse - fun getIndividualRecipientPushTokens(recipients: List, isAuth: Boolean): Map>> + fun getIndividualRecipientPushTokens(recipients: List, isAuth: Boolean?): Map>> 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> { + override fun getAllRecipientPushTokens(isAuth: Boolean?, container: String): List> { 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, - isAuth: Boolean + isAuth: Boolean? ): Map>> { 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 -- 2.40.1 From 3ada2dea871ed00109d7f71547982674cff43be4 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 24 Nov 2023 14:58:30 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=EB=B0=9C=EC=86=A1=20-=20=EB=B3=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=ED=91=B8=EC=8B=9C=20=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9C=EC=86=A1=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20isAuth=20=ED=94=8C=EB=9E=98=EA=B7=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/kr/co/vividnext/sodalive/fcm/FcmController.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmController.kt index eaaccea..b01d4c9 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/fcm/FcmController.kt @@ -22,6 +22,7 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli FcmEvent( type = FcmEventType.INDIVIDUAL, title = request.title, + isAuth = request.isAuth, message = request.message, recipients = request.memberIds ) @@ -32,7 +33,8 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli type = FcmEventType.ALL, title = request.title, message = request.message, - container = "ios" + container = "ios", + isAuth = request.isAuth ) ) @@ -41,7 +43,8 @@ class FcmController(private val applicationEventPublisher: ApplicationEventPubli type = FcmEventType.ALL, title = request.title, message = request.message, - container = "aos" + container = "aos", + isAuth = request.isAuth ) ) } -- 2.40.1 From 84102bb95ae36d2e90d39b3c6d61d6fc49596345 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 24 Nov 2023 15:03:15 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=EB=B0=9C=EC=86=A1=20-=20=EB=B3=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=ED=91=B8=EC=8B=9C=20=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9C=EC=86=A1=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20isAuth=20=ED=94=8C=EB=9E=98=EA=B7=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vividnext/sodalive/can/charge/event/ChargeEventService.kt | 4 ++-- .../co/vividnext/sodalive/can/charge/free/AdsChargeService.kt | 2 +- .../kr/co/vividnext/sodalive/content/AudioContentService.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/event/ChargeEventService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/event/ChargeEventService.kt index 2306751..a37ebb1 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/event/ChargeEventService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/event/ChargeEventService.kt @@ -81,7 +81,7 @@ class ChargeEventService( title = chargeEvent.title, message = "$additionalCan 캔이 추가 지급되었습니다.", recipients = listOf(member.id!!), - isAuth = false + isAuth = null ) ) } @@ -103,7 +103,7 @@ class ChargeEventService( title = "첫 충전 이벤트", message = "$additionalCan 캔이 추가 지급되었습니다.", recipients = listOf(member.id!!), - isAuth = false + isAuth = null ) ) } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/free/AdsChargeService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/free/AdsChargeService.kt index d18e372..1541fde 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/free/AdsChargeService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/charge/free/AdsChargeService.kt @@ -78,7 +78,7 @@ class AdsChargeService( title = "제휴보상", message = "${adsCharge.point.toInt()} 캔이 지급되었습니다.", recipients = listOf(member.id!!), - isAuth = false + isAuth = null ) ) } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt index d0c2fe3..a2d20e4 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/AudioContentService.kt @@ -341,7 +341,7 @@ class AudioContentService( title = "콘텐츠 등록완료", message = audioContent.title, recipients = listOf(audioContent.member!!.id!!), - isAuth = audioContent.isAdult, + isAuth = null, contentId = contentId ) ) -- 2.40.1 From 11bb799bd55d51a0e273b5b74836b9d7daef67c4 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 24 Nov 2023 15:52:47 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=ED=91=B8?= =?UTF-8?q?=EC=8B=9C=20=EB=B0=9C=EC=86=A1=20-=20=EB=B3=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=ED=91=B8=EC=8B=9C=20=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EB=B0=9C=EC=86=A1=ED=95=A0=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20isAuth=20=ED=94=8C=EB=9E=98=EA=B7=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/co/vividnext/sodalive/member/MemberRepository.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt index db9eacf..1c6094c 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/member/MemberRepository.kt @@ -101,9 +101,9 @@ class MemberQueryRepositoryImpl( if (isAuth != null) { where = if (isAuth) { - where.and(member.auth.isNotNull) + where.and(auth.isNotNull) } else { - where.and(member.auth.isNull) + where.and(auth.isNull) } } @@ -289,9 +289,9 @@ class MemberQueryRepositoryImpl( if (isAuth != null) { where = if (isAuth) { - where.and(member.auth.isNotNull) + where.and(auth.isNotNull) } else { - where.and(member.auth.isNull) + where.and(auth.isNull) } } -- 2.40.1