temp(quota): 기다리면 무료 쿼터 시간

- 테스트를 위해 임시로 1분으로 수정
This commit is contained in:
Klaus 2025-08-26 17:00:19 +09:00
parent fcb68be006
commit 37ac52116a
1 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class ChatQuotaService(
) { ) {
companion object { companion object {
private const val FREE_BUCKET = 10 private const val FREE_BUCKET = 10
private const val RECHARGE_HOURS = 6L private const val RECHARGE_HOURS = 1L
} }
data class QuotaStatus( data class QuotaStatus(
@ -41,20 +41,20 @@ class ChatQuotaService(
quota.remainingFree > 0 -> { quota.remainingFree > 0 -> {
quota.remainingFree -= 1 quota.remainingFree -= 1
if (quota.remainingFree + quota.remainingPaid == 0 && quota.nextRechargeAt == null) { if (quota.remainingFree + quota.remainingPaid == 0 && quota.nextRechargeAt == null) {
quota.nextRechargeAt = now.plusHours(RECHARGE_HOURS) quota.nextRechargeAt = now.plusMinutes(RECHARGE_HOURS)
} }
} }
quota.remainingPaid > 0 -> { quota.remainingPaid > 0 -> {
quota.remainingPaid -= 1 quota.remainingPaid -= 1
if (quota.remainingFree + quota.remainingPaid == 0 && quota.nextRechargeAt == null) { if (quota.remainingFree + quota.remainingPaid == 0 && quota.nextRechargeAt == null) {
quota.nextRechargeAt = now.plusHours(RECHARGE_HOURS) quota.nextRechargeAt = now.plusMinutes(RECHARGE_HOURS)
} }
} }
else -> { else -> {
if (quota.nextRechargeAt == null) { if (quota.nextRechargeAt == null) {
quota.nextRechargeAt = now.plusHours(RECHARGE_HOURS) quota.nextRechargeAt = now.plusMinutes(RECHARGE_HOURS)
} }
throw SodaException("채팅 가능 횟수가 모두 소진되었습니다. 다음 무료 충전 이후 이용해주세요.") throw SodaException("채팅 가능 횟수가 모두 소진되었습니다. 다음 무료 충전 이후 이용해주세요.")
} }