From 2200ac9f165011ed8a71aaf33a87a17cdf34bf78 Mon Sep 17 00:00:00 2001 From: dradnats1012 Date: Sun, 15 Dec 2024 20:17:36 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ExcelDownloadCache.from=20=EB=A7=A4?= =?UTF-8?q?=EA=B0=9C=EB=B3=80=EC=88=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../koreatech/koin/domain/coop/model/ExcelDownloadCache.java | 5 +++-- .../in/koreatech/koin/domain/coop/service/CoopService.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/in/koreatech/koin/domain/coop/model/ExcelDownloadCache.java b/src/main/java/in/koreatech/koin/domain/coop/model/ExcelDownloadCache.java index fa586a6ea..c37d131d4 100644 --- a/src/main/java/in/koreatech/koin/domain/coop/model/ExcelDownloadCache.java +++ b/src/main/java/in/koreatech/koin/domain/coop/model/ExcelDownloadCache.java @@ -1,5 +1,6 @@ package in.koreatech.koin.domain.coop.model; +import java.time.LocalDate; import java.util.concurrent.TimeUnit; import org.springframework.data.redis.core.RedisHash; @@ -27,9 +28,9 @@ private ExcelDownloadCache(String id, Long expiration) { this.expiration = expiration; } - public static ExcelDownloadCache from(String id) { + public static ExcelDownloadCache from(LocalDate startDate, LocalDate endDate) { return ExcelDownloadCache.builder() - .id(id) + .id(startDate.toString() + endDate.toString()) .expiration(CACHE_EXPIRE_SECONDS) .build(); } diff --git a/src/main/java/in/koreatech/koin/domain/coop/service/CoopService.java b/src/main/java/in/koreatech/koin/domain/coop/service/CoopService.java index e0f111c97..692c6aeda 100644 --- a/src/main/java/in/koreatech/koin/domain/coop/service/CoopService.java +++ b/src/main/java/in/koreatech/koin/domain/coop/service/CoopService.java @@ -292,6 +292,6 @@ private void checkDuplicateExcelRequest(LocalDate startDate, LocalDate endDate) if (isCacheExist) { throw DuplicateExcelRequestException.withDetail(startDate, endDate); } - excelDownloadCacheRepository.save(ExcelDownloadCache.from(startDate.toString() + endDate.toString())); + excelDownloadCacheRepository.save(ExcelDownloadCache.from(startDate, endDate)); } }