From 892a2048e4676f4d703ab15563f20d503e31540e Mon Sep 17 00:00:00 2001 From: chyo1 Date: Tue, 29 Oct 2024 16:08:13 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20FIX:=20=EC=B7=A8=EC=86=8C=EB=90=9C=20?= =?UTF-8?q?=EB=82=A0=EC=A7=9C=EC=97=90=20=EB=8B=A4=EC=8B=9C=20=EC=8B=A0?= =?UTF-8?q?=EC=B2=AD=20=EC=8B=9C=20500=20=EC=97=90=EB=9F=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit presentationForm 가져오는 부분 List 형식으로 변경 --- .../presentation/repository/PresentationRepository.java | 2 +- .../presentation/service/PresentationQueryService.java | 5 +++-- 2 files changed, 4 insertions(+), 3 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 bb05cae66..ef00a10e9 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 @@ -20,7 +20,7 @@ List findAllByDateTimeBetweenOrderByDateTime(LocalDateTime start, List findAllByDateTimeBetween(LocalDateTime start, LocalDateTime end); - Optional findPresentationByDateTimeBetween(LocalDateTime startOfDate, + List findPresentationByDateTimeBetween(LocalDateTime startOfDate, LocalDateTime endOfDate); @EntityGraph(attributePaths = "user") 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 9297769ee..c772ee960 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 @@ -52,8 +52,9 @@ public List getPresentationsByYearMonth(YearMonth yearMonth) { public Presentation getPresentationsByDate(LocalDateTime dateTime) { LocalDateTime startOfDate = dateTime.withHour(0).withMinute(0).withSecond(0); LocalDateTime endOfDate = dateTime.withHour(23).withMinute(59).withSecond(59); - return presentationRepository.findPresentationByDateTimeBetween(startOfDate, - endOfDate) + return presentationRepository.findPresentationByDateTimeBetween(startOfDate, endOfDate) + .stream().filter(p -> p.getPresentationStatus() != PresentationStatus.CANCEL) + .findFirst() .orElseThrow(ExceptionStatus.INVALID_PRESENTATION_DATE::asServiceException); }