parent
4c9277f61a
commit
9425889e93
|
@ -1177,12 +1177,14 @@ class LiveRoomService(
|
||||||
val room = repository.getLiveRoom(roomId) ?: throw SodaException("잘못된 요청입니다.")
|
val room = repository.getLiveRoom(roomId) ?: throw SodaException("잘못된 요청입니다.")
|
||||||
val isLiveCreator = room.member!!.id == memberId
|
val isLiveCreator = room.member!!.id == memberId
|
||||||
val donationList = repository.getDonationList(roomId = room.id!!, isLiveCreator = isLiveCreator)
|
val donationList = repository.getDonationList(roomId = room.id!!, isLiveCreator = isLiveCreator)
|
||||||
val totalCan = donationList.sumOf { it.can + it.secretCan }
|
val totalCan = donationList.sumOf { it.can }
|
||||||
|
val totalSecretCan = donationList.sumOf { it.secretCan }
|
||||||
|
|
||||||
return GetLiveRoomDonationStatusResponse(
|
return GetLiveRoomDonationStatusResponse(
|
||||||
donationList = donationList,
|
donationList = donationList,
|
||||||
totalCount = donationList.size,
|
totalCount = donationList.size,
|
||||||
totalCan = totalCan
|
totalCan = totalCan,
|
||||||
|
totalSecretCan = totalSecretCan
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ import com.querydsl.core.annotations.QueryProjection
|
||||||
data class GetLiveRoomDonationStatusResponse(
|
data class GetLiveRoomDonationStatusResponse(
|
||||||
val donationList: List<GetLiveRoomDonationItem>,
|
val donationList: List<GetLiveRoomDonationItem>,
|
||||||
val totalCount: Int,
|
val totalCount: Int,
|
||||||
val totalCan: Int
|
val totalCan: Int,
|
||||||
|
val totalSecretCan: Int
|
||||||
)
|
)
|
||||||
|
|
||||||
data class GetLiveRoomDonationItem @QueryProjection constructor(
|
data class GetLiveRoomDonationItem @QueryProjection constructor(
|
||||||
|
|
Loading…
Reference in New Issue