diff --git a/src/main/java/ohsoontaxi/backend/domain/reservation/domain/repository/ReservationRepository.java b/src/main/java/ohsoontaxi/backend/domain/reservation/domain/repository/ReservationRepository.java index af9bd7c..18f1f1f 100644 --- a/src/main/java/ohsoontaxi/backend/domain/reservation/domain/repository/ReservationRepository.java +++ b/src/main/java/ohsoontaxi/backend/domain/reservation/domain/repository/ReservationRepository.java @@ -14,23 +14,18 @@ public interface ReservationRepository extends JpaRepository,ReservationRepositoryCustom { @Override Optional findById(Long id); - Slice findSliceBy(Pageable pageable); + + Slice findSliceByOrderByLastModifyDateDesc(Pageable pageable); List findTop5ByOrderByIdDesc(); @Query("select distinct r from Reservation r"+ " join fetch r.participations p"+ - " where p.user.id = :userId order by r.createdDate desc") + " where p.user.id = :userId order by r.lastModifyDate desc") List findParticipatedReservation(@Param("userId") Long userId); @Query("select distinct r from Reservation r"+ - " join fetch r.participations p"+ - " where p.user.id = :userId order by r.createdDate desc") - Slice findParticipatedReservationTest(@Param("userId") Long userId); - - @Query("select distinct r from Reservation r"+ - " where r.user.id = :userId order by r.createdDate desc") + " where r.user.id = :userId order by r.lastModifyDate desc") List findReservedByMe(@Param("userId") Long userId); - } diff --git a/src/main/java/ohsoontaxi/backend/domain/reservation/service/ReservationService.java b/src/main/java/ohsoontaxi/backend/domain/reservation/service/ReservationService.java index 7467f0a..d39a81c 100644 --- a/src/main/java/ohsoontaxi/backend/domain/reservation/service/ReservationService.java +++ b/src/main/java/ohsoontaxi/backend/domain/reservation/service/ReservationService.java @@ -136,7 +136,7 @@ public ReservationResponse updateReservation(Long reservationId, UpdateReservati public Slice findAllReservation(PageRequest pageRequest) { Slice sliceReservation = - reservationRepository.findSliceBy(pageRequest); + reservationRepository.findSliceByOrderByLastModifyDateDesc(pageRequest); return sliceReservation.map(reservation -> new ReservationBriefInfoDto(reservation.getReservationBaseInfoVo())); }