From e24143824a301bd8f7eea8981a25dd85b6a076d7 Mon Sep 17 00:00:00 2001 From: saewoo1 Date: Tue, 29 Oct 2024 22:41:27 +0900 Subject: [PATCH] =?UTF-8?q?FIX:=20=EB=8D=94=EB=AF=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=8C=90=EB=B3=84=20=EC=8B=9C=20status,=20category?= =?UTF-8?q?=EA=B0=80=20=EC=95=84=EB=8B=8C=20user=EB=A1=9C=20=ED=8C=90?= =?UTF-8?q?=EB=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/repository/PresentationRepository.java | 9 +++++++++ .../presentation/service/PresentationQueryService.java | 4 +--- .../presentation/service/PresentationService.java | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/org/ftclub/cabinet/presentation/repository/PresentationRepository.java b/backend/src/main/java/org/ftclub/cabinet/presentation/repository/PresentationRepository.java index 7551d72e1..bc3e87430 100644 --- a/backend/src/main/java/org/ftclub/cabinet/presentation/repository/PresentationRepository.java +++ b/backend/src/main/java/org/ftclub/cabinet/presentation/repository/PresentationRepository.java @@ -34,4 +34,13 @@ List 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 findDummiesWithinPeriod( + @Param("start") LocalDateTime start, + @Param("end") LocalDateTime end, + Pageable pageable); } diff --git a/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationQueryService.java b/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationQueryService.java index 1a59ac7ed..c74d83cae 100644 --- a/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationQueryService.java +++ b/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationQueryService.java @@ -72,10 +72,8 @@ public List getDummyDateBetweenMonth( } public List findPresentationsWithStatusWithinPeriod( - PresentationStatus status, LocalDateTime start, LocalDateTime end, PageRequest pageRequest) { - return presentationRepository.findPresentationsWithinPeriod(status, - start, end, pageRequest); + return presentationRepository.findDummiesWithinPeriod(start, end, pageRequest); } } diff --git a/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationService.java b/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationService.java index aec5da723..675f3c5e1 100644 --- a/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationService.java +++ b/backend/src/main/java/org/ftclub/cabinet/presentation/service/PresentationService.java @@ -105,8 +105,8 @@ public List 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); } /** @@ -122,8 +122,8 @@ public List 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); } /**