From 42b402d4ef22b949b4468f3dabfaadb1c6844bd2 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Wed, 15 Oct 2025 15:14:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../leopard/core/service/StockService.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/leopard-core/src/main/java/com/lanyuanxiaoyao/leopard/core/service/StockService.java b/leopard-core/src/main/java/com/lanyuanxiaoyao/leopard/core/service/StockService.java index 712c575..c560b59 100644 --- a/leopard-core/src/main/java/com/lanyuanxiaoyao/leopard/core/service/StockService.java +++ b/leopard-core/src/main/java/com/lanyuanxiaoyao/leopard/core/service/StockService.java @@ -41,7 +41,7 @@ public class StockService extends SimpleServiceSupport { this.dailyRepository = dailyRepository; } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findFinanceIndicator", cacheManager = "long-cache", sync = true) public Optional findFinanceIndicator(Long stockId, Integer year) { return financeIndicatorRepository.findOne( QFinanceIndicator.financeIndicator.year.eq(year) @@ -49,7 +49,7 @@ public class StockService extends SimpleServiceSupport { ); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findFinanceIndicatorRecent", cacheManager = "long-cache", sync = true) public List findFinanceIndicatorRecent(Long stockId, int years) { var current = LocalDate.now(); return financeIndicatorRepository.findAll( @@ -59,7 +59,7 @@ public class StockService extends SimpleServiceSupport { ); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findDailyRecent", cacheManager = "long-cache", sync = true) public List findDailyRecent(Long stockId, int days) { var current = LocalDate.now(); return dailyRepository.findAll( @@ -69,12 +69,12 @@ public class StockService extends SimpleServiceSupport { ); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findDailyLatest", cacheManager = "long-cache", sync = true) public Optional findDailyLatest(Long stockId) { return dailyRepository.findLatest(stockId); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findYearlyRecent", cacheManager = "long-cache", sync = true) public List findYearlyRecent(Long stockId, int years) { var current = LocalDate.now().withMonth(1).withDayOfMonth(1); var start = current.minusYears(years).getYear(); @@ -112,7 +112,7 @@ public class StockService extends SimpleServiceSupport { .toList(); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findMonthlyRecent", cacheManager = "long-cache", sync = true) public List findMonthlyRecent(Long stockId, int months) { var end = LocalDate.now().withDayOfMonth(1); var start = end.minusMonths(months); @@ -162,7 +162,7 @@ public class StockService extends SimpleServiceSupport { .toList(); } - @Cacheable(value = "long-cache", sync = true) + @Cacheable(value = "findWeeklyRecent", cacheManager = "long-cache", sync = true) public List findWeeklyRecent(Long stockId, int weeks) { var end = LocalDate.now().with(ChronoField.DAY_OF_WEEK, 1); var start = end.minusWeeks(weeks);