Conversation
pparkjs
left a comment
There was a problem hiding this comment.
구현하시느라 수고하셨습니다!! 다만 제가 수정 요청드린것만 한 번 검토해주시면 감사하겠습니다 ㅎㅎ
| @Schema(description = "크루 타이틀") | ||
| @Size(min = 1, max = 30) | ||
| String title, | ||
|
|
||
| @Schema(description = "크루 설명") | ||
| @Size(min = 1, max = 500) | ||
| String description | ||
| String description, |
There was a problem hiding this comment.
이 두개는 CrewTitle, CrewDescription VO에서 이미 유효성 검사하기에 Size는뺴도 될 거 같습니다. 만약 해당 크기에 대한 유효성 검사가 VO에없다면 추가 하시면 될 거 같아요!
There was a problem hiding this comment.
request랑 VO에서 이중으로 체크하는 게 안전할 듯 하긴 한데 한쪽에서 size 변경되면 다른 쪽도 변경되어야 하니까 관리하기 어려울 수도 있겠네요.
다른 분들도 의견 부탁드려요
There was a problem hiding this comment.
VO에서 체크되는 Validation과 Request에서 체크되는 Validation 목적성 및 에러 코드가 다르다고 생각이 됩니다.
5xx 에러와 4xx 에러가 발생될 거 같은데..
저는 둘 다 있어야 될 것 같다고 생각됩니다(DB에 직접적으로 데이터를 넣는것을 방지하기 위해서로도 VO에서는 반드시 있어야 될 거 같습니다.)
| @Schema(description = "크루 타이틀") | ||
| @Size(min = 1, max = 30) | ||
| String title, | ||
|
|
||
| @Schema(description = "크루 설명") | ||
| @Size(min = 1, max = 500) | ||
| String description, |
|
|
||
| public void start(int membersSize) { | ||
| if (isRecruitmentComplete(membersSize)) { | ||
| stop(); | ||
| throw new IllegalStateException("최대 인원을 모두 모집 완료하여 더 이상 멤버를 모집할 수 없습니다."); | ||
| } | ||
| this.status = RECRUITING; |
| UUID id, | ||
|
|
||
| @Schema(description = "모집 상태") | ||
| RecruitmentStatus status |
There was a problem hiding this comment.
해당 값 Enum 값 Swagger에 어떻게 표시되는지 확인 가능하실까요??
| } | ||
|
|
||
| public void startRecruitment() { | ||
| int membersSize = crewMembers.getValues().size(); |
There was a problem hiding this comment.
crewMembers 하위에 Size를 구해주는 메서드를 만드는 것은 어떤가요?
There was a problem hiding this comment.
네 별도의 메서드를 구현하는게 좋겠네요
| public CrewMember getLeader() { | ||
| return this.values.stream().filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER).findFirst().orElse(null); | ||
| return this.values.stream() | ||
| .filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER) |
There was a problem hiding this comment.
CrewMemberRole에 Code 값 비교하는 함수 없나요??
해당 함수가 있다면 그 함수를 사용하는게 좋을 것 같습니다.
There was a problem hiding this comment.
이번 이슈에서 개발한 부분이 아니라 별도의 이슈로 만들어 담당하신 분의 의견을 들어보는게 좋겠어요
| return this.values.stream() | ||
| .filter(it -> it.getCrewMemberRole() == CrewMemberRole.LEADER) | ||
| .findFirst() | ||
| .orElse(null); |
There was a problem hiding this comment.
Null을 반환하는것 보단 Enum 타입에 None과 같은 타입을 만들어서 반환하는게 좋을거 같아요
There was a problem hiding this comment.
이번 이슈에서 개발한 부분이 아니라 별도의 이슈로 만들어 담당하신 분의 의견을 들어보는게 좋겠어요
| public void start(int membersSize) { | ||
| if (isRecruitmentComplete(membersSize)) { | ||
| stop(); | ||
| throw new IllegalStateException("최대 인원을 모두 모집 완료하여 더 이상 멤버를 모집할 수 없습니다."); |
There was a problem hiding this comment.
ILLEGAL_STATE(BAD_REQUEST, "Common-005", "Illegal state")
기본적으로 가지고 있는 BAD_REQUEST를 사용하도록 했습니다.
- IllegalStateException 추가 - common exception 생성자 수정
28d3ce6 to
7d791cc
Compare
* feat: 크루 모집상태 변경시 최대 인원수 검증 추가 - IllegalStateException 추가 - common exception 생성자 수정 * refactor: CrewMembers size 조회 메서드 추가 * fix: conflict repair
* feat: PR 템플릿 and PR Discord 알림 연동 * feat: Crew 생성 (#20) * feat: Crew 생성 * feat: Code 리뷰 반영, Exception 추가 * feat: 주석 제거 및 코드 수정 --------- Co-authored-by: junhokim <junhokim@gmarket.com> * feat: 비즈니스 예외와 API 공통 응답 모듈 추가 (#23) * feat: 비즈니스 예외와 API 공통 응답 모듈 추가 - vo 검증에서 발생하는 비즈니스 예외 삭제 및 InvalidValueException 으로 변경 * feat: 스웨거 추가 작업 (#24) Co-authored-by: junhokim <junhokim@gmarket.com> * [feat] 크루 상세, 리스트 조회 API 기능 구현 (#25) * [feat] 크루 리스트 조회 API 기능 구현 및 테스트코드 리팩토링 (#4) * [feat] 크루 상세 조회 API 기능 구현 (#4) * feat: 스웨거 추가 작업 (#24) Co-authored-by: junhokim <junhokim@gmarket.com> * [fix] 크루 상세 조회 API 코드리뷰 반영 (#4) * [fix] 단위테스트 SpringBootTest -> DataJpaTest 사용하도록 수정 (#4) --------- Co-authored-by: Kimjunho <39546306+xjvmdutl@users.noreply.github.com> Co-authored-by: junhokim <junhokim@gmarket.com> * 크루 참여 요청 (#29) * feat: 크루 모집상태 변경시 최대 인원수 검증 추가 - IllegalStateException 추가 - common exception 생성자 수정 * refactor: CrewMembers size 조회 메서드 추가 * fix: conflict repair * feat:크루 참여 요청 질문 등록 * feat:크루 참여 요청 질문 등록 * [FEAT]-recruitment로 연관관계 변경 * 크루 참여 요청 질문 등록 수정 * 크루 참여 요청 질문 등록 수정 구현 --------- Co-authored-by: junhokim <junhokim@gmarket.com> Co-authored-by: Kimjunho <39546306+xjvmdutl@users.noreply.github.com> Co-authored-by: mandykr <94955454+mandykr@users.noreply.github.com> Co-authored-by: coPpark <qkrwjdtn963@gmail.com> Co-authored-by: MonChest <p_caso@atzsoft.kr>
🔍 PR 타입 선택
아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.
feat: 새로운 기능 추가📝 변경 사항 요약
변경 사항을 간단히 요약해 주세요.
🛠 관련 이슈
Resolves: #2