Skip to content
Merged

Dev #131

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Optional<Vote> findTopByReactivityUpdatedAtBetweenOrderByReactivityScoreDescCrea
LocalDateTime start, LocalDateTime end
);

Optional<Vote> findTopByCreatedAtBetweenOrderByReactivityScoreDescCreatedAtDesc(
LocalDateTime start, LocalDateTime end);

// 추가: 전체 기간 중 반응성이 가장 높은 투표 조회 (작일 데이터 없을 때 사용)
Optional<Vote> findTopByOrderByReactivityScoreDescCreatedAtDesc();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public HotIssueVoteResponse getHotIssueVote() { // 파라미터 없음

// 2. 작일 동안 반응성이 가장 높은 투표 조회 시도
Optional<Vote> yesterdayHotIssue = voteRepository
.findTopByReactivityUpdatedAtBetweenOrderByReactivityScoreDescCreatedAtDesc(yesterdayStart, now);
.findTopByCreatedAtBetweenOrderByReactivityScoreDescCreatedAtDesc(yesterdayStart, now);

Vote hotIssueVote;
if (yesterdayHotIssue.isPresent()) {
Expand Down Expand Up @@ -149,7 +149,7 @@ public HotIssueVoteResponse getTrendingVote() {

// 2. 최근 7일 내 반응성이 가장 높은 투표 조회
Optional<Vote> recentTrendingVote = voteRepository
.findTopByReactivityUpdatedAtBetweenOrderByReactivityScoreDescCreatedAtDesc(sevenDaysAgo, LocalDateTime.now());
.findTopByCreatedAtBetweenOrderByReactivityScoreDescCreatedAtDesc(sevenDaysAgo, LocalDateTime.now());

Vote trendingVote;
if (recentTrendingVote.isPresent()) {
Expand Down
Loading