관리자 라이브 정산 API - 인원 추가

This commit is contained in:
Klaus 2023-10-03 19:57:28 +09:00
parent 90732e137f
commit 236aeb0258
4 changed files with 16 additions and 4 deletions

View File

@ -34,6 +34,7 @@ class AdminCalculateQueryRepository(private val queryFactory: JPAQueryFactory) {
liveRoom.title,
liveRoom.price,
useCan.canUsage,
useCanCalculate.id.count(),
useCanCalculate.can.sum()
)
)

View File

@ -26,11 +26,17 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
.asSequence()
.map {
val canUsageStr = if (it.canUsage == CanUsage.LIVE) {
"유료방 참여"
"유료"
} else {
"후원"
}
val numberOfPeople = if (it.canUsage == CanUsage.LIVE) {
it.memberCount.toInt()
} else {
0
}
// 원화 = totalCoin * 100 ( 캔 1개 = 100원 )
val totalKrw = it.totalAmount * 100
@ -52,7 +58,8 @@ class AdminCalculateService(private val repository: AdminCalculateQueryRepositor
date = it.date,
title = it.title,
entranceFee = it.entranceFee,
coinUsageStr = canUsageStr,
canUsageStr = canUsageStr,
numberOfPeople = numberOfPeople,
totalAmount = it.totalAmount,
totalKrw = totalKrw,
paymentFee = paymentFee.roundToInt(),

View File

@ -12,6 +12,8 @@ data class GetCalculateLiveQueryData @QueryProjection constructor(
val entranceFee: Int,
// 코인 사용 구분
val canUsage: CanUsage,
// 참여인원
val memberCount: Long,
// 합계
val totalAmount: Int
)

View File

@ -7,8 +7,10 @@ data class GetCalculateLiveResponse(
val title: String,
// 유료방 입장 금액
val entranceFee: Int,
// 코인 사용 구분
val coinUsageStr: String,
// 캔 사용 구분
val canUsageStr: String,
// 인원
val numberOfPeople: Int,
// 합계
val totalAmount: Int,
// 원화