라이브 후원

- 비밀 후원 추가
This commit is contained in:
Klaus 2024-08-23 15:10:34 +09:00
parent 6dd2a3136f
commit e373e6ab0f
4 changed files with 11 additions and 4 deletions

View File

@ -36,6 +36,7 @@ class CanPaymentService(
memberId: Long, memberId: Long,
needCan: Int, needCan: Int,
canUsage: CanUsage, canUsage: CanUsage,
isSecret: Boolean = false,
liveRoom: LiveRoom? = null, liveRoom: LiveRoom? = null,
order: Order? = null, order: Order? = null,
audioContent: AudioContent? = null, audioContent: AudioContent? = null,
@ -65,7 +66,8 @@ class CanPaymentService(
val useCan = UseCan( val useCan = UseCan(
canUsage = canUsage, canUsage = canUsage,
can = useChargeCan?.total ?: 0, can = useChargeCan?.total ?: 0,
rewardCan = useRewardCan.total rewardCan = useRewardCan.total,
isSecret = isSecret
) )
var recipientId: Long? = null var recipientId: Long? = null

View File

@ -25,7 +25,9 @@ data class UseCan(
val rewardCan: Int, val rewardCan: Int,
var isRefund: Boolean = false var isRefund: Boolean = false,
val isSecret: Boolean = false
) : BaseEntity() { ) : BaseEntity() {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false) @JoinColumn(name = "member_id", nullable = false)

View File

@ -1052,11 +1052,12 @@ class LiveRoomService(
memberId = member.id!!, memberId = member.id!!,
needCan = request.can, needCan = request.can,
canUsage = CanUsage.DONATION, canUsage = CanUsage.DONATION,
isSecret = request.isSecret,
liveRoom = room, liveRoom = room,
container = request.container container = request.container
) )
if (request.message.isNotBlank()) { if (!request.isSecret && request.message.isNotBlank()) {
val lock = getOrCreateLock(memberId = member.id!!) val lock = getOrCreateLock(memberId = member.id!!)
lock.write { lock.write {
val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!) val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!)
@ -1095,11 +1096,12 @@ class LiveRoomService(
memberId = member.id!!, memberId = member.id!!,
needCan = request.can, needCan = request.can,
canUsage = CanUsage.DONATION, canUsage = CanUsage.DONATION,
isSecret = request.isSecret,
liveRoom = room, liveRoom = room,
container = request.container container = request.container
) )
if (request.message.isNotBlank()) { if (!request.isSecret && request.message.isNotBlank()) {
val lock = getOrCreateLock(memberId = member.id!!) val lock = getOrCreateLock(memberId = member.id!!)
lock.write { lock.write {
val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!) val roomInfo = roomInfoRepository.findByIdOrNull(room.id!!)

View File

@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.live.room.donation
data class LiveRoomDonationRequest( data class LiveRoomDonationRequest(
val roomId: Long, val roomId: Long,
val can: Int, val can: Int,
val isSecret: Boolean,
val container: String, val container: String,
val message: String = "" val message: String = ""
) )