commit
dbe9b72feb
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -198,7 +198,7 @@ class ExplorerQueryRepository(
|
||||||
member.role.eq(MemberRole.CREATOR)
|
member.role.eq(MemberRole.CREATOR)
|
||||||
.and(member.isActive.isTrue)
|
.and(member.isActive.isTrue)
|
||||||
.and(auth.gender.eq(gender))
|
.and(auth.gender.eq(gender))
|
||||||
.and(member.id.notIn(3, 351, 19209, 8103))
|
.and(member.id.notIn(3, 351, 19209, 8103, 19775))
|
||||||
)
|
)
|
||||||
.orderBy(caseExpression.asc(), randomExpression)
|
.orderBy(caseExpression.asc(), randomExpression)
|
||||||
.offset(0)
|
.offset(0)
|
||||||
|
|
|
@ -229,6 +229,7 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
||||||
liveRoom.id.eq(roomId)
|
liveRoom.id.eq(roomId)
|
||||||
.and(useCan.canUsage.eq(CanUsage.DONATION).or(useCan.canUsage.eq(CanUsage.SPIN_ROULETTE)))
|
.and(useCan.canUsage.eq(CanUsage.DONATION).or(useCan.canUsage.eq(CanUsage.SPIN_ROULETTE)))
|
||||||
.and(useCan.isRefund.isFalse)
|
.and(useCan.isRefund.isFalse)
|
||||||
|
.and(useCan.isSecret.isFalse)
|
||||||
)
|
)
|
||||||
.fetchOne()
|
.fetchOne()
|
||||||
}
|
}
|
||||||
|
@ -253,6 +254,7 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
||||||
useCan.room.id.eq(roomId)
|
useCan.room.id.eq(roomId)
|
||||||
.and(useCan.canUsage.eq(CanUsage.DONATION).or(useCan.canUsage.eq(CanUsage.SPIN_ROULETTE)))
|
.and(useCan.canUsage.eq(CanUsage.DONATION).or(useCan.canUsage.eq(CanUsage.SPIN_ROULETTE)))
|
||||||
.and(useCan.isRefund.isFalse)
|
.and(useCan.isRefund.isFalse)
|
||||||
|
.and(useCan.isSecret.isFalse)
|
||||||
)
|
)
|
||||||
.orderBy(useCan.can.sum().add(useCan.rewardCan.sum()).desc())
|
.orderBy(useCan.can.sum().add(useCan.rewardCan.sum()).desc())
|
||||||
.fetch()
|
.fetch()
|
||||||
|
|
|
@ -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!!)
|
||||||
|
|
|
@ -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 = false,
|
||||||
val container: String,
|
val container: String,
|
||||||
val message: String = ""
|
val message: String = ""
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue