-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: swagger 패키지 생성 및 클래스 이동 * feat: 비즈니스팀 API 그룹화 * chore: 비즈니스 API 추가 * feat: 캠퍼스팀 API 그룹화 * feat: 유저팀 API 그룹화 * feat: ABTEST API 그룹화 * feat: BCSD API 그룹화 * chore: 비즈니스팀 API 추가 * feat: 어드민 API 그룹화 * chore: 유저팀 API 추가 * feat: 로그인 API 그룹화 및 그룹 이름 변경 * refactor: 패키지 경로 enum화 * refactor: 중복 코드 메소드화 * refactor: 그룹 스웨거 파일 분할 * chore: 미사용 import 삭제 * chore: 메소드 명 변경 * chore: 리뷰 반영
- Loading branch information
1 parent
0025f00
commit 1026bd4
Showing
2 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
97 changes: 97 additions & 0 deletions
97
src/main/java/in/koreatech/koin/global/config/swagger/SwaggerGroupConfig.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package in.koreatech.koin.global.config.swagger; | ||
|
||
import org.springdoc.core.models.GroupedOpenApi; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class SwaggerGroupConfig { | ||
|
||
@Bean | ||
public GroupedOpenApi loginApi() { | ||
String[] apiPath = new String[] { | ||
"/**/login" | ||
}; | ||
|
||
return GroupedOpenApi.builder() | ||
.group("0. Login API") | ||
.pathsToMatch(apiPath) | ||
.build(); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi adminApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.admin" | ||
}; | ||
|
||
return createGroupedOpenApi("1. Admin API", packagesPath); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi businessApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.domain.owner", | ||
"in.koreatech.koin.domain.benefit", | ||
"in.koreatech.koin.domain.ownershop", | ||
"in.koreatech.koin.domain.shop", | ||
"in.koreatech.koin.domain.land" | ||
}; | ||
|
||
return createGroupedOpenApi("2. Business API", packagesPath); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi campusApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.domain.bus", | ||
"in.koreatech.koin.domain.community", | ||
"in.koreatech.koin.domain.coop", | ||
"in.koreatech.koin.domain.coopshop", | ||
"in.koreatech.koin.domain.dining" | ||
}; | ||
|
||
return createGroupedOpenApi("3. Campus API", packagesPath); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi userApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.domain.user", | ||
"in.koreatech.koin.domain.student", | ||
"in.koreatech.koin.domain.timetable", | ||
"in.koreatech.koin.domain.timetableV2" | ||
}; | ||
|
||
return createGroupedOpenApi("4. User API", packagesPath); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi abtestApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.admin.abtest" | ||
}; | ||
|
||
return createGroupedOpenApi("5. abTest API", packagesPath); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi bcsdApi() { | ||
String[] packagesPath = new String[] { | ||
"in.koreatech.koin.domain.activity", | ||
"in.koreatech.koin.domain.dept", | ||
"in.koreatech.koin.domain.kakao", | ||
"in.koreatech.koin.domain.member", | ||
"in.koreatech.koin.domain.version" | ||
}; | ||
|
||
return createGroupedOpenApi("6. bcsd API", packagesPath); | ||
} | ||
|
||
private GroupedOpenApi createGroupedOpenApi(String groupName, String[] packagesPath) { | ||
return GroupedOpenApi.builder() | ||
.group(groupName) | ||
.packagesToScan(packagesPath) | ||
.build(); | ||
} | ||
} |