From 591eabcb4e074c9cd88b9e426dcdd935486f9613 Mon Sep 17 00:00:00 2001 From: Sangwon Yang Date: Wed, 11 Dec 2024 11:43:51 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20=EC=A7=80=EB=82=9C=20=ED=95=9C?= =?UTF-8?q?=EB=8B=AC=EA=B0=84=20=ED=94=BD=20=EB=A7=8E=EC=9D=B4=ED=95=9C=20?= =?UTF-8?q?=EA=B8=B0=EC=A4=80=EC=9D=84=20=EC=96=B4=EC=A0=9C=EA=B0=80=20?= =?UTF-8?q?=EC=95=84=EB=8B=8C=20=EC=98=A4=EB=8A=98=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#733)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 지난 한달간 픽 많이한 기준을 어제가 아닌 오늘로 변경 * refactor: 주석 변경 * refactor: 주석 변경 --- .../api/domain/ranking/service/RankingService.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/techpick-api/src/main/java/techpick/api/domain/ranking/service/RankingService.java b/backend/techpick-api/src/main/java/techpick/api/domain/ranking/service/RankingService.java index 764fed847..5d8d472ec 100644 --- a/backend/techpick-api/src/main/java/techpick/api/domain/ranking/service/RankingService.java +++ b/backend/techpick-api/src/main/java/techpick/api/domain/ranking/service/RankingService.java @@ -27,8 +27,13 @@ public RankingResult getUrlRanking(int limit) { var past7DaysViewRanking = // 일주일 전 ~ 어제 rankingApi.getUrlRankingByViewCount(before7Days, before1Day, limit).getBody(); - var past30DaysPickRanking = // 한달 전 ~ 어제 - rankingApi.getUrlRankingByPickedCount(before30Days, before1Day, limit).getBody(); + /** + * @author sangwon + * 어제가 아닌 오늘로 변경한 이유는 가장 많이 저장한 픽을 즉시 확인하기 위함. + * 집계 테이블이 추가되고, 캐싱 처리한다면 오늘 데이터는 즉시 보여줄 필요가 없기 때문에 어제부터로 하는 것은 어떨지? - psh + */ + var past30DaysPickRanking = // 한달 전 ~ 오늘 + rankingApi.getUrlRankingByPickedCount(before30Days, currentDay, limit).getBody(); return new RankingResult(dailyViewRanking, past7DaysViewRanking, past30DaysPickRanking); }