캐릭터 챗봇 #338
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue