From 3456681fff8b712678b9f8c4c6ceebc5d000c6ca Mon Sep 17 00:00:00 2001 From: nahyeon99 Date: Wed, 14 Aug 2024 00:50:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=98=84=EC=9E=AC=20=EB=AA=A8=EC=9E=84?= =?UTF-8?q?=EC=A7=88=EB=AC=B8=20=EC=A1=B0=ED=9A=8C=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infrastructure/MeetingQuestionQueryRepository.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/depromeet/sambad/moring/meeting/question/infrastructure/MeetingQuestionQueryRepository.java b/src/main/java/org/depromeet/sambad/moring/meeting/question/infrastructure/MeetingQuestionQueryRepository.java index a9fc4f41..ceaf21c0 100644 --- a/src/main/java/org/depromeet/sambad/moring/meeting/question/infrastructure/MeetingQuestionQueryRepository.java +++ b/src/main/java/org/depromeet/sambad/moring/meeting/question/infrastructure/MeetingQuestionQueryRepository.java @@ -115,7 +115,8 @@ public Optional findMeetingQuestion(Long meetingId) { return Optional.ofNullable( queryFactory .selectFrom(meetingQuestion) - .where(meetingQuestion.meeting.id.eq(meetingId)) + .where(meetingQuestion.meeting.id.eq(meetingId), + registeredOrActiveCond()) .orderBy(meetingQuestion.startTime.asc()) .limit(1) .fetchOne() @@ -171,6 +172,12 @@ private Boolean isAnswered(Long meetingQuestionId, Long meetingMemberId) { return fetchOne != null; } + private BooleanExpression registeredOrActiveCond() { + LocalDateTime now = LocalDateTime.now(); + return meetingQuestion.startTime.loe(now) + .and(meetingQuestion.startTime.goe(now.minusHours(RESPONSE_TIME_LIMIT_HOURS))); + } + private BooleanExpression registeredCond() { LocalDateTime now = LocalDateTime.now(); return meetingQuestion.startTime.loe(now)