From fa64146111f02e7ebf1f877ff31c8fba4433f7ac Mon Sep 17 00:00:00 2001 From: EunJiJung Date: Sun, 24 Nov 2024 05:22:13 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor/#143=20:=20?= =?UTF-8?q?=ED=8B=B0=EC=BC=93=20=EB=A7=8C=EB=A3=8C=EC=9D=BC=20=EA=B8=B0?= =?UTF-8?q?=EC=A4=80=20=EB=B9=A0=EB=A5=B8=EC=88=9C=20=EC=A0=95=EB=A0=AC?= 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 43c7b56..4155bd5 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.findByUserOrderByExpirationDateDesc(user, pageable); + Page ticketsPage = ticketRepository.findByUserOrderByExpirationDateAsc(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 24d72df..3b7a71a 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 findByUserOrderByExpirationDateDesc(User user, Pageable pageable); + Page findByUserOrderByExpirationDateAsc(User user, Pageable pageable); // user로 Ticket 수 조회 Long countByUser(User user);