Open
Conversation
brainbackdoor
requested changes
Apr 24, 2025
brainbackdoor
left a comment
There was a problem hiding this comment.
미션 진행하느라 고생하셨어요! 👍🏻
몇몇 기능 요구사항에 대해 오해하신 듯 해요. 그리고 도메인 모델이 인프라 레이어와 결합이 발생했네요. 한번 리팩토링해보시겠어요?
| } | ||
|
|
||
| public void approve() { | ||
| if (this.status == EnrollmentStatus.APPROVED) { |
There was a problem hiding this comment.
- this.status.isApproved() 로 메시지를 보내보는건 어떨까요? 그리고 이미 작성한 isApproved() 메서드를 활용해보는건 어떨까요?
|
|
||
| public boolean isEnrolledBy(Member student) { | ||
| return values.stream() | ||
| .anyMatch(e -> e.getStudent().equals(student)); |
There was a problem hiding this comment.
- 값을 꺼내서 비교한다면, 늘 리팩토링 여지가 있지는 않은지 고민해보세요. 여기도 메시지를 보내볼 수 있겠죠??
| } | ||
|
|
||
| @Test | ||
| @DisplayName("강의 상태가 PREPARING이면 모집중이어도 수강 신청 불가") |
There was a problem hiding this comment.
- 강의 수강신청은 강의 상태가 모집중일 때만 가능하다. -> 강의가 진행 중인 상태에서도 수강신청이 가능해야 한다. 입니다.
Comment on lines
+121
to
+133
| Session session = new Session( | ||
| "강의 준비 중", | ||
| 1, | ||
| LocalDateTime.now(), | ||
| LocalDateTime.now().plusDays(7), | ||
| 0L, | ||
| 0, | ||
| 0, | ||
| validImages, | ||
| SessionStatus.PREPARING, | ||
| RecruitmentStatus.RECRUITING, | ||
| new FreeJoinStrategy() | ||
| ); |
There was a problem hiding this comment.
- 인자가 너무 늘어났는데요. 규칙 7: 3개 이상의 인스턴스 변수를 가진 클래스를 쓰지 않는다. 를 위반하네요.
Comment on lines
+3
to
+5
| public enum EnrollmentStatus { | ||
| PENDING, APPROVED, REJECTED; | ||
| } |
There was a problem hiding this comment.
- 강의 진행 상태(준비중, 진행중, 종료)와 모집 상태(비모집중, 모집중)로 상태 값을 분리 입니다.
Comment on lines
+6
to
+16
| public class Images { | ||
| private List<Image> images; | ||
|
|
||
| public Images(List<Image> images) { | ||
| this.images = List.copyOf(images); | ||
| } | ||
|
|
||
| public List<Image> getImages() { | ||
| return Collections.unmodifiableList(images); | ||
| } | ||
| } |
Comment on lines
+51
to
+55
| if (status == EnrollmentStatus.APPROVED) { | ||
| enrollment.approve(); | ||
| } else if (status == EnrollmentStatus.REJECTED) { | ||
| enrollment.reject(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
리뷰 잘 부탁드립니다 :)
평소에 자바를 써본적이 없다보니 jdbc 등등의 개념이 어렵네요.. ㅎㅎ