Compare commits
2 Commits
a096b16945
...
15d0952de8
Author | SHA1 | Date | |
---|---|---|---|
15d0952de8 | |||
84ebc1762b |
@@ -74,7 +74,7 @@ class CanService(private val repository: CanRepository) {
|
||||
CanUsage.AUDITION_VOTE -> "[오디션 투표] ${it.auditionApplicant?.role?.audition?.title ?: ""}"
|
||||
CanUsage.CHAT_MESSAGE_PURCHASE -> "[메시지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}"
|
||||
CanUsage.CHARACTER_IMAGE_PURCHASE -> "[캐릭터 이미지 구매] ${it.characterImage?.chatCharacter?.name ?: ""}"
|
||||
CanUsage.CHAT_QUOTA_PURCHASE -> "AI 채팅 개수 구매"
|
||||
CanUsage.CHAT_QUOTA_PURCHASE -> "캐릭터 톡 이용권 구매"
|
||||
}
|
||||
|
||||
val createdAt = it.createdAt!!
|
||||
|
@@ -61,15 +61,9 @@ class ChatQuotaService(
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly = true)
|
||||
@Transactional
|
||||
fun getStatus(memberId: Long): QuotaStatus {
|
||||
val q = repo.findByMemberId(memberId) ?: return QuotaStatus(
|
||||
totalRemaining = FREE_BUCKET,
|
||||
nextRechargeAtEpochMillis = null
|
||||
)
|
||||
val total = q.remainingFree + q.remainingPaid
|
||||
val epoch = q.nextRechargeAt?.atZone(ZoneId.systemDefault())?.toInstant()?.toEpochMilli()
|
||||
return QuotaStatus(totalRemaining = total, nextRechargeAtEpochMillis = epoch)
|
||||
return applyRefillOnEnterAndGetStatus(memberId)
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
Reference in New Issue
Block a user