From 7ee3081e588336d7fcade195a8c5033b1b942d8f Mon Sep 17 00:00:00 2001 From: EunJiJung Date: Sun, 24 Nov 2024 00:04:28 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor/#139=20:=20?= =?UTF-8?q?=EB=82=98=EC=9D=98=20=EC=8B=9D=EA=B6=8C=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?DESC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: EunJiJung --- .../onjung/event/application/service/ReadTicketService.java | 2 +- .../daon/onjung/event/repository/mysql/TicketRepository.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/daon/onjung/event/application/service/ReadTicketService.java b/src/main/java/com/daon/onjung/event/application/service/ReadTicketService.java index 4155bd5..43c7b56 100644 --- a/src/main/java/com/daon/onjung/event/application/service/ReadTicketService.java +++ b/src/main/java/com/daon/onjung/event/application/service/ReadTicketService.java @@ -40,7 +40,7 @@ public ReadTicketResponseDto execute( User user = userRepository.findById(accountId) .orElseThrow(() -> new CommonException(ErrorCode.NOT_FOUND_RESOURCE)); - Page ticketsPage = ticketRepository.findByUserOrderByExpirationDateAsc(user, pageable); + Page ticketsPage = ticketRepository.findByUserOrderByExpirationDateDesc(user, pageable); // dto로 변환 List ticketDtos = ticketsPage.stream() diff --git a/src/main/java/com/daon/onjung/event/repository/mysql/TicketRepository.java b/src/main/java/com/daon/onjung/event/repository/mysql/TicketRepository.java index 3b7a71a..24d72df 100644 --- a/src/main/java/com/daon/onjung/event/repository/mysql/TicketRepository.java +++ b/src/main/java/com/daon/onjung/event/repository/mysql/TicketRepository.java @@ -11,7 +11,7 @@ public interface TicketRepository extends JpaRepository { // user로 Ticket 조회, expirationDate를 ASC로 정렬 - Page findByUserOrderByExpirationDateAsc(User user, Pageable pageable); + Page findByUserOrderByExpirationDateDesc(User user, Pageable pageable); // user로 Ticket 수 조회 Long countByUser(User user);