From d304af7ed87d65245398fc06d476b993e0f64ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=95=9C=EB=B9=84?= <99820610+AlmondBreez3@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:58:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B3=BC=EC=A0=9C=20=EB=A7=88=EA=B0=90?= =?UTF-8?q?=EB=82=A0=EC=A7=9C=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EA=B2=80?= =?UTF-8?q?=EC=82=AC=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95=20=20(#759)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 기존 커리큘럼의 시작날짜로 검증하는 것으로 변경 * feat: 불필요한 수정 삭제 * feat: 검증 조건 추가 * feat: 코드 중복도 낮추기 --- .../gdsc/domain/study/domain/StudyDetailValidator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java b/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java index 91341292d..f6b75b698 100644 --- a/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java +++ b/src/main/java/com/gdschongik/gdsc/domain/study/domain/StudyDetailValidator.java @@ -19,7 +19,7 @@ public void validateCancelStudyAssignment(Member member, StudyDetail studyDetail public void validatePublishStudyAssignment( Member member, StudyDetail studyDetail, AssignmentCreateUpdateRequest request) { validateStudyMentorAuthorization(member, studyDetail); - validateDeadLine(request.deadLine()); + validateDeadLine(request.deadLine(), studyDetail.getPeriod().getStartDate()); } // 해당 스터디의 멘토가 아니라면 스터디에 대한 권한이 없다. @@ -29,8 +29,8 @@ private void validateStudyMentorAuthorization(Member member, StudyDetail studyDe } } - private void validateDeadLine(LocalDateTime deadline) { - if (deadline.isBefore(LocalDateTime.now())) { + private void validateDeadLine(LocalDateTime deadline, LocalDateTime studyStartDate) { + if (deadline.isBefore(LocalDateTime.now()) || deadline.isBefore(studyStartDate)) { throw new CustomException(ASSIGNMENT_DEADLINE_INVALID); } }