-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BE] 방 생성 검증 로직 부활(#753) #762
Conversation
Test Results 65 files 65 suites 7s ⏱️ Results for commit edec3b4. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안녕하세요 뽀로로~~
크게 바뀐 부분은 없는 것 같아 질문 한 가지만 남겨뒀어용!
정책 관련 부분일 것 같아서 체크하고 넘어가면 좋겠네용
고생하셨어요!
if (recruitmentDeadline.isBefore(currentDateTime)) { | ||
throw new CoreaException(ExceptionType.INVALID_RECRUITMENT_DEADLINE); | ||
} | ||
|
||
if (reviewDeadline.isBefore(recruitmentDeadline)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문: 이거 둘 다 isBefore
로 처리해도 괜찮은가요?
"현재 시간과 동일하게 / 모집 마감 시간과 동일하게" 방 생성하는 경우는 막지 않아도 괜찮은 건지 궁금합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
막아야겠네요! 감사합니다~ 수정할게요! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빠르게 구현하셨네요! 고생하셨어요!!
궁금한 점 달아두었습니다~
private LocalDateTime recruitmentDeadline; | ||
|
||
private LocalDateTime reviewDeadline; | ||
@Embedded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존 프로덕션, 데브의 스키마가 바뀔 필요가 없겠네용 👍
@@ -12,9 +12,9 @@ | |||
|
|||
public interface RoomRepository extends JpaRepository<Room, Long>, JpaSpecificationExecutor<Room> { | |||
|
|||
Page<Room> findAllByStatusOrderByRecruitmentDeadline(RoomStatus status, Pageable pageable); | |||
Page<Room> findAllByStatusOrderByRoomDeadline_RecruitmentDeadline(RoomStatus status, Pageable pageable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 본문이 이걸 말한거였군요
if (recruitmentDeadline.isBefore(currentDateTime)) { | ||
throw new CoreaException(ExceptionType.INVALID_RECRUITMENT_DEADLINE); | ||
} | ||
|
||
if (reviewDeadline.isBefore(recruitmentDeadline)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
모집 마감은 지금 이후로, 리뷰 마감은 모집 마감 이후로 설정되어 있는데,
프론트에서도 백과 같은 범주로 검사하는지 궁금해요!
이전엔 1시간, 하루의 텀을 두었던 거로 기억하는데, 이는 살리지 않는거죠?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
프론트에서도 백과 같은 범주로 검사하는지 궁금해요!
넵 프론트와 동일하게 검증하고 있습니다.
이전엔 1시간, 하루의 텀을 두었던 거로 기억하는데, 이는 살리지 않는거죠?
넵 단순히 모집 마감은 현재 시간 이후로, 리뷰 마감은 모집 마감 이후로 검증하도록 통일했어요~
(텐텐 의견 99.9999% 반영)
📌 관련 이슈
✨ PR 세부 내용
방 생성 시 기간 검증 로직을 RoomDeadline 클래스를 통해 관리하도록 추가했습니다.
RoomDeadline 클래스는
@Embeddable
로 정의되었고, recruitmentDeadline과 reviewDeadline 필드를 포함하고 있습니다.이와 관련하여 발생한 문제는 RoomRepository에서 recruitmentDeadline과 reviewDeadline을 인식하지 못한 점입니다.
@Embedded
타입의 필드는 리포지토리에서 접근 시@Embeddable클래스명_변수명
형식을 사용해야 한다는 점을 확인했습니다.