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)); } }