Skip to content

Commit

Permalink
FIX: 더미 데이터 판별 시 status, category가 아닌 user로 판별
Browse files Browse the repository at this point in the history
  • Loading branch information
saewoo1 committed Oct 29, 2024
1 parent bf0cad6 commit e241438
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,13 @@ List<Presentation> findPresentationsWithinPeriod(
@Param("start") LocalDateTime start,
@Param("end") LocalDateTime end,
Pageable pageable);

@Query("SELECT p "
+ "FROM Presentation p "
+ "WHERE p.user IS NULL AND "
+ "p.dateTime BETWEEN :start AND :end")
List<Presentation> findDummiesWithinPeriod(
@Param("start") LocalDateTime start,
@Param("end") LocalDateTime end,
Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ public List<Presentation> getDummyDateBetweenMonth(
}

public List<Presentation> findPresentationsWithStatusWithinPeriod(
PresentationStatus status,
LocalDateTime start,
LocalDateTime end, PageRequest pageRequest) {
return presentationRepository.findPresentationsWithinPeriod(status,
start, end, pageRequest);
return presentationRepository.findDummiesWithinPeriod(start, end, pageRequest);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public List<Presentation> getLatestPastPresentations(int count) {
PageRequest pageRequest = PageRequest.of(DEFAULT_PAGE, count,
Sort.by(DATE_TIME).descending());

return presentationQueryService.findPresentationsWithStatusWithinPeriod(
PresentationStatus.DONE, start, limit, pageRequest);
return presentationQueryService.findPresentationsWithStatusWithinPeriod(start, limit,
pageRequest);
}

/**
Expand All @@ -122,8 +122,8 @@ public List<Presentation> getLatestUpcomingPresentationsByCount(int count) {
PageRequest pageRequest = PageRequest.of(DEFAULT_PAGE, count,
Sort.by(DATE_TIME).ascending());

return presentationQueryService.findPresentationsWithStatusWithinPeriod(
PresentationStatus.EXPECTED, start, end, pageRequest);
return presentationQueryService.findPresentationsWithStatusWithinPeriod(start, end,
pageRequest);
}

/**
Expand Down

0 comments on commit e241438

Please sign in to comment.