라이브 매출 API - 30분 캐시 적용

This commit is contained in:
Klaus 2023-11-14 00:07:31 +09:00
parent 9458a3976b
commit 8da7ee0bb3
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,11 @@ import kotlin.math.roundToInt
@Service
class AdminCalculateService(private val repository: AdminCalculateQueryRepository) {
@Transactional(readOnly = true)
@Cacheable(
cacheNames = ["default"],
key = "'calculateLive:' + " + "#startDateStr + ':' + #endDateStr"
)
fun getCalculateLive(startDateStr: String, endDateStr: String): List<GetCalculateLiveResponse> {
val dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
val startDate = LocalDate.parse(startDateStr, dateTimeFormatter).atTime(0, 0, 0)