From e373e6ab0f377103fe229f8de072ab794d779a29 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 23 Aug 2024 15:10:34 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=ED=9B=84?= =?UTF-8?q?=EC=9B=90=20-=20=EB=B9=84=EB=B0=80=20=ED=9B=84=EC=9B=90=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 --- .../co/vividnext/sodalive/can/payment/CanPaymentService.kt | 4 +++- src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCan.kt | 4 +++- .../kr/co/vividnext/sodalive/live/room/LiveRoomService.kt | 6 ++++-- .../sodalive/live/room/donation/LiveRoomDonationRequest.kt | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/payment/CanPaymentService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/payment/CanPaymentService.kt index 29da205..14479c8 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/payment/CanPaymentService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/payment/CanPaymentService.kt @@ -36,6 +36,7 @@ class CanPaymentService( memberId: Long, needCan: Int, canUsage: CanUsage, + isSecret: Boolean = false, liveRoom: LiveRoom? = null, order: Order? = null, audioContent: AudioContent? = null, @@ -65,7 +66,8 @@ class CanPaymentService( val useCan = UseCan( canUsage = canUsage, can = useChargeCan?.total ?: 0, - rewardCan = useRewardCan.total + rewardCan = useRewardCan.total, + isSecret = isSecret ) var recipientId: Long? = null diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCan.kt b/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCan.kt index 916d4b0..31ac687 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCan.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/can/use/UseCan.kt @@ -25,7 +25,9 @@ data class UseCan( val rewardCan: Int, - var isRefund: Boolean = false + var isRefund: Boolean = false, + + val isSecret: Boolean = false ) : BaseEntity() { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "member_id", nullable = false) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt index 1d026e0..32b0c0e 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt @@ -1052,11 +1052,12 @@ class LiveRoomService( memberId = member.id!!, needCan = request.can, canUsage = CanUsage.DONATION, + isSecret = request.isSecret, liveRoom = room, container = request.container ) - if (request.message.isNotBlank()) { + if (!request.isSecret && request.message.isNotBlank()) { val lock = getOrCreateLock(memberId = member.id!!) lock.write { val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!) @@ -1095,11 +1096,12 @@ class LiveRoomService( memberId = member.id!!, needCan = request.can, canUsage = CanUsage.DONATION, + isSecret = request.isSecret, liveRoom = room, container = request.container ) - if (request.message.isNotBlank()) { + if (!request.isSecret && request.message.isNotBlank()) { val lock = getOrCreateLock(memberId = member.id!!) lock.write { val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/donation/LiveRoomDonationRequest.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/donation/LiveRoomDonationRequest.kt index 732bd84..9adfdf2 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/donation/LiveRoomDonationRequest.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/donation/LiveRoomDonationRequest.kt @@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.live.room.donation data class LiveRoomDonationRequest( val roomId: Long, val can: Int, + val isSecret: Boolean, val container: String, val message: String = "" )