-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: ClubApi(Swagger) 분리 #148
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
이 PR은 ClubApi를 5개의 별도 인터페이스로 분리하여 API 구조를 개선하는 리팩토링 작업입니다.
Changes:
- 하나의 대형 ClubApi 인터페이스를 5개의 기능별 인터페이스로 분리 (기본 관리, 지원 및 신청, 모집 공고, 직책 관리, 회원 관리)
- SwaggerConfig에 태그 알파벳 정렬 기능 추가
- ClubController가 5개의 새로운 인터페이스를 모두 구현하도록 변경
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/gg/agit/konect/global/config/SwaggerConfig.java | Swagger 문서의 태그를 알파벳 순으로 정렬하는 커스터마이저 추가 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubApi.java | 기존 ClubApi 인터페이스 삭제 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubBasicApi.java | 동아리 기본 관리 API 인터페이스 생성 (조회, 생성, 수정 등) |
| src/main/java/gg/agit/konect/domain/club/controller/ClubApplicationApi.java | 동아리 지원 및 신청 관련 API 인터페이스 생성 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubRecruitmentApi.java | 동아리 모집 공고 관련 API 인터페이스 생성 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubPositionApi.java | 동아리 직책 관리 API 인터페이스 생성 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubMemberApi.java | 동아리 회원 관리 API 인터페이스 생성 |
| src/main/java/gg/agit/konect/domain/club/controller/ClubController.java | 5개의 새로운 인터페이스를 구현하도록 변경, 일부 메소드 삭제 |
| package-lock.json | npm 패키지 락 파일 추가 (Java 프로젝트에는 불필요) |
| @RequestMapping("/clubs") | ||
| public interface ClubBasicApi { | ||
|
|
||
| String TAG = "(Normal) Club - Basic: 기본 관리"; |
Copilot
AI
Jan 27, 2026
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.
Swagger 태그 정의 방식이 코드베이스의 다른 API들과 일관성이 없습니다. 다른 API 인터페이스들(BankApi, ChatApi, CouncilApi, NoticeApi 등)은 클래스 레벨에서 @tag 어노테이션을 사용하는 반면, 새로운 ClubApi 인터페이스들은 String 상수 TAG를 정의하고 각 @operation의 tags 파라미터에 사용하고 있습니다.
일관성을 위해 다른 API들과 동일한 패턴을 따르는 것을 권장합니다. 예를 들어:
@Tag(name = "(Normal) Club - Basic: 기본 관리")
@RequestMapping("/clubs")
public interface ClubBasicApi {
@Operation(summary = "...")
...
}
참고: src/main/java/gg/agit/konect/domain/bank/controller/BankApi.java:11, src/main/java/gg/agit/konect/domain/chat/controller/ChatApi.java:22
| @RequestMapping("/clubs") | ||
| public interface ClubApplicationApi { | ||
|
|
||
| String TAG = "(Normal) Club - Application: 지원 및 신청"; |
Copilot
AI
Jan 27, 2026
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.
Swagger 태그 정의 방식이 코드베이스의 다른 API들과 일관성이 없습니다. 다른 API 인터페이스들은 클래스 레벨에서 @tag 어노테이션을 사용하는 반면, 이 인터페이스는 String 상수 TAG를 정의하고 각 @operation의 tags 파라미터에 사용하고 있습니다. 일관성을 위해 @tag 어노테이션을 클래스 레벨에서 사용하는 것을 권장합니다.
참고: src/main/java/gg/agit/konect/domain/bank/controller/BankApi.java:11
| @RequestMapping("/clubs") | ||
| public interface ClubPositionApi { | ||
|
|
||
| String TAG = "(Normal) Club - Position: 직책 관리"; |
Copilot
AI
Jan 27, 2026
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.
Swagger 태그 정의 방식이 코드베이스의 다른 API들과 일관성이 없습니다. 다른 API 인터페이스들은 클래스 레벨에서 @tag 어노테이션을 사용하는 반면, 이 인터페이스는 String 상수 TAG를 정의하고 각 @operation의 tags 파라미터에 사용하고 있습니다. 일관성을 위해 @tag 어노테이션을 클래스 레벨에서 사용하는 것을 권장합니다.
참고: src/main/java/gg/agit/konect/domain/bank/controller/BankApi.java:11
| @RequestMapping("/clubs") | ||
| public interface ClubMemberApi { | ||
|
|
||
| String TAG = "(Normal) Club - Member: 회원 관리"; |
Copilot
AI
Jan 27, 2026
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.
Swagger 태그 정의 방식이 코드베이스의 다른 API들과 일관성이 없습니다. 다른 API 인터페이스들은 클래스 레벨에서 @tag 어노테이션을 사용하는 반면, 이 인터페이스는 String 상수 TAG를 정의하고 각 @operation의 tags 파라미터에 사용하고 있습니다. 일관성을 위해 @tag 어노테이션을 클래스 레벨에서 사용하는 것을 권장합니다.
참고: src/main/java/gg/agit/konect/domain/bank/controller/BankApi.java:11
| @RequestMapping("/clubs") | ||
| public interface ClubRecruitmentApi { | ||
|
|
||
| String TAG = "(Normal) Club - Recruitment: 모집 공고"; |
Copilot
AI
Jan 27, 2026
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.
Swagger 태그 정의 방식이 코드베이스의 다른 API들과 일관성이 없습니다. 다른 API 인터페이스들은 클래스 레벨에서 @tag 어노테이션을 사용하는 반면, 이 인터페이스는 String 상수 TAG를 정의하고 각 @operation의 tags 파라미터에 사용하고 있습니다. 일관성을 위해 @tag 어노테이션을 클래스 레벨에서 사용하는 것을 권장합니다.
참고: src/main/java/gg/agit/konect/domain/bank/controller/BankApi.java:11
| public class ClubController implements | ||
| ClubBasicApi, | ||
| ClubRecruitmentApi, | ||
| ClubApplicationApi, | ||
| ClubPositionApi, | ||
| ClubMemberApi { |
Copilot
AI
Jan 27, 2026
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.
삭제된 API 엔드포인트들이 새로운 인터페이스에 추가되지 않았습니다:
getManagedClubDetail-/managed/{clubId}GET 엔드포인트approveClubApplication-/{clubId}/applications/{applicationId}/approvePOST 엔드포인트rejectClubApplication-/{clubId}/applications/{applicationId}/rejectPOST 엔드포인트
이 메소드들은 기존 ClubApi에 존재했지만, 새로운 5개 인터페이스 중 어디에도 포함되지 않아 API가 더 이상 제공되지 않게 됩니다. 서비스 레이어의 구현은 여전히 존재하므로, 이들 메소드를 적절한 인터페이스에 추가해야 합니다:
getManagedClubDetail는 ClubBasicApi에 추가approveClubApplication과rejectClubApplication는 ClubApplicationApi에 추가
| import gg.agit.konect.domain.club.dto.ClubApplicationAnswersResponse; | ||
| import gg.agit.konect.domain.club.dto.ClubApplicationsResponse; | ||
| import gg.agit.konect.domain.club.dto.ClubAppliedClubsResponse; | ||
| import gg.agit.konect.domain.club.dto.ClubApplicationsResponse; |
Copilot
AI
Jan 27, 2026
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.
import 문의 순서가 일관성이 없습니다. line 12와 13에서 ClubAppliedClubsResponse와 ClubApplicationsResponse의 순서가 알파벳 순서와 다릅니다. 알파벳 순서로 정렬하면 ClubApplicationsResponse(line 13)가 ClubAppliedClubsResponse(line 12)보다 앞에 와야 합니다.
| import gg.agit.konect.domain.club.dto.ClubAppliedClubsResponse; | |
| import gg.agit.konect.domain.club.dto.ClubApplicationsResponse; | |
| import gg.agit.konect.domain.club.dto.ClubApplicationsResponse; | |
| import gg.agit.konect.domain.club.dto.ClubAppliedClubsResponse; |
|
Copilot 의 리뷰 내용에 따라 수정 완료했습니다! 태그 정의 방식은 그대로 하였음
|
|
인터페이스에서 태그를 분리해도 구현체가 하나라서 스웨거에는 통합되는 것으로 보여요. 그냥 컨트롤러도 분리하는건 어떻게 생각하시나요 |
|
그게 좋을 것 같습니다 |
ClubApi 분리 했습니다.
다음과 같이 5개로 분리했습니다.