Skip to content

Commit 6dbcf76

Browse files
committed
fix: 최근 생성된, 모집 중인 클럽 보기 API에서 사용하는 필드를 엔티티 생성시간에서 활성 시작시간으로 변경
1 parent a05d2fa commit 6dbcf76

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

bookduck/src/main/java/com/mmc/bookduck/domain/club/repository/ClubRepository.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Page<Club> searchClubs(@Param("keyword") String keyword,
3535
Pageable pageable);
3636

3737
@Query("SELECT c FROM Club c WHERE c.clubStatus = :status AND c.activeEndAt < :now")
38-
List<Club> findByStatusAndActiveEndAtBefore(@Param("status") ClubStatus status,
39-
@Param("now") LocalDateTime now);
38+
List<Club> findByClubStatusAndActiveEndAtBefore(@Param("status") ClubStatus status,
39+
@Param("now") LocalDateTime now);
4040

41-
Page<Club> findByStatusOrderByCreatedAtDesc(ClubStatus status, Pageable pageable);
41+
Page<Club> findByClubStatusOrderByActiveStartAtDesc(ClubStatus status, Pageable pageable);
4242
}

bookduck/src/main/java/com/mmc/bookduck/domain/club/service/ClubService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public LocalDateTime getLastReadAt(ClubMember clubMember) {
357357

358358
@Transactional(readOnly = true)
359359
public ClubSearchListResponseDto findRecentActiveClubs(Pageable pageable) {
360-
Page<Club> clubPage = clubRepository.findByStatusOrderByCreatedAtDesc(ClubStatus.ACTIVE, pageable);
360+
Page<Club> clubPage = clubRepository.findByClubStatusOrderByActiveStartAtDesc(ClubStatus.ACTIVE, pageable);
361361

362362
Page<ClubSearchResponseDto> dtoPage = clubPage.map(club -> {
363363
BookInfo bookInfo = club.getBookInfo();

bookduck/src/main/java/com/mmc/bookduck/global/schedule/ClubStatusScheduler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ClubStatusScheduler {
2424
@Transactional
2525
public void updateExpiredClubs() {
2626
try {
27-
List<Club> expiredClubs = clubRepository.findByStatusAndActiveEndAtBefore(
27+
List<Club> expiredClubs = clubRepository.findByClubStatusAndActiveEndAtBefore(
2828
ClubStatus.ACTIVE, LocalDateTime.now());
2929
if (expiredClubs.isEmpty()) {
3030
log.info("종료된 클럽 없음.");

0 commit comments

Comments
 (0)