Refactor/#204 멘토 담당 프로젝트 조회 API를 담당 대회/담당 팀 조회로 분리#205
Merged
Hidden character warning
The head ref may contain hidden characters: "Refactor/#204_\uba58\ud1a0-\ub2f4\ub2f9-\ud504\ub85c\uc81d\ud2b8-\uc870\ud68c-API-\ub300\ud68c-\ud300-\ubd84\ub9ac"
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
멘토(외부멘토) 담당 프로젝트 통합 조회 API를 “담당 대회 목록 조회”와 “선택 대회의 담당 팀 목록 조회”로 분리하고, 관련 컨트롤러/서비스/DTO/문서를 재정비한 변경입니다. 이로써 프론트 UX(대회 선택 후 팀 조회) 흐름에 맞는 조회 단위를 제공하고, 멘토 API 권한을 ROLE_외부멘토로 정리합니다.
Changes:
- 기존
GET /contests/mentors/me/projects를 2개 API(GET /mentors/me/contests,GET /mentors/me/contests/{contestId}/teams)로 분리 - 멘토 도메인 컨트롤러를
MentorController(/mentors)로 통합하고, 팀 제출물 조회 URL을/mentors/me/.../submissions로 이동 - 응답 DTO를
MentorProjectsResponse삭제 +MentorContestResponse신규 도입, 레포지토리 직접 사용을 Convenience 메서드로 캡슐화
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/opus/opus/restdocs/RestDocsTest.java | RestDocs 대상 컨트롤러/모킹 서비스 구성을 MentorController/MentorQueryService로 전환 |
| src/test/java/com/opus/opus/restdocs/docs/MentorApiDocsTest.java | 신규 2개 API 및 변경된 submissions URL에 맞춰 RestDocs 시나리오/스니펫 업데이트 |
| src/test/java/com/opus/opus/contest/application/MentorQueryServiceTest.java | 분리된 API 동작(대회 목록 집계/대회별 팀 목록/예외 케이스)으로 통합 테스트 재구성 |
| src/main/java/com/opus/opus/modules/contest/application/MentorQueryService.java | 기존 프로젝트 통합 조회를 대회 집계/대회별 팀 조회로 분리하고 집계 로직 추가 |
| src/main/java/com/opus/opus/modules/contest/application/dto/response/MentorProjectsResponse.java | 기존 통합 응답 DTO 제거 |
| src/main/java/com/opus/opus/modules/contest/application/dto/response/MentorContestResponse.java | 대회 단위 집계 응답 DTO 신규 추가 |
| src/main/java/com/opus/opus/modules/contest/application/convenience/ContestMemberConvenience.java | ContestMemberRepository 직접 사용을 메서드로 캡슐화(목록/단건 검증 조회) |
| src/main/java/com/opus/opus/modules/contest/api/MentorController.java | /mentors 하위로 멘토 전용 API(대회 목록/팀 목록/제출물 조회) 통합 |
| src/main/java/com/opus/opus/modules/contest/api/ContestMentorController.java | 기존 /contests 하위 멘토 컨트롤러 제거 |
| src/main/java/com/opus/opus/docs/asciidoc/mentor.adoc | 문서에서 담당 대회/담당 팀 API 분리 및 스니펫 경로 갱신 |
Comments suppressed due to low confidence (2)
src/main/java/com/opus/opus/modules/contest/application/MentorQueryService.java:53
getMentorContests()가 ContestMember 1건당 카테고리 조회(1) + 트랙 조회(1) + 팀 조회(1) + pending count group-by(1) 등 여러 DB 쿼리를 실행해, 멘토의 담당 대회 수가 늘면 N+1 형태로 응답 지연/DB 부하가 커질 수 있습니다. 대회/카테고리/트랙/대기건수/팀을 contestId 기준으로 한 번에 모아서(예: contestId IN 배치 조회, group-by 1회) 조립하는 방식이나 캐시(카테고리/트랙) 적용을 검토해 주세요.
src/main/java/com/opus/opus/modules/contest/application/MentorQueryService.java:61getMentorContestTeams()에서 먼저 대회 존재 여부를 검증한 뒤, 배정되지 않은 경우NOT_FOUND_CONTEST_MEMBER(404)를 던지고 있습니다. 이미 대회 존재를 확인한 상태라면 ‘리소스 없음’(404)보다 ‘권한 없음’(403)에 가까워 보이고, 동일 도메인 내NOT_ASSIGNED_TEAM이 403을 사용하는 것과도 불일치합니다. 정책상 404로 숨기려는 의도라면 대회 존재 검증 순서/메시지도 함께 일관되게 맞추는 것이 좋습니다.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
🔥 연관된 이슈
close: #204
📜 작업 내용
GET /contests/mentors/me/projects)를 2개의 API로 분리했습니다.GET /mentors/me/contests— 멘토 담당 대회 목록 조회 (대회별 담당 분과명 목록·검토 대기 건수 합계·담당 팀 수 집계)GET /mentors/me/contests/{contestId}/teams— 선택 대회의 담당 팀(프로젝트) 목록 조회 (팀별 피드백 대기 건수 포함)MentorController(/mentors)로 통합했습니다.ContestMentorController의 팀 제출물 조회도 이동:GET /contests/{contestId}/teams/{teamId}/submissions→GET /mentors/me/contests/{contestId}/teams/{teamId}/submissions(프론트 URL 변경 필요)ContestMentorQueryService→MentorQueryService로 리네임ROLE_외부멘토전용으로 정리했습니다. (ROLE_교수제거)ContestMemberRepository직접 사용을ContestMemberConvenience신규 메서드(getAssignedContestMembers,getValidateExistContestMember)로 캡슐화했습니다.MentorProjectsResponse는 삭제하고, 대회 집계용MentorContestResponse를 추가했습니다. 두 API 모두 목록 조회 컨벤션에 맞춰 배열로 반환합니다.💬 리뷰 요구사항
X
✨ 기타