Skip to content

Commit

Permalink
chore: 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Soundbar91 committed Dec 18, 2024
1 parent 5a82f7b commit 0cb8cda
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 59 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package in.koreatech.koin.global.config.swagger;

import static in.koreatech.koin.global.config.swagger.ApiPackage.*;

import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -11,40 +9,83 @@ public class SwaggerGroupConfig {

@Bean
public GroupedOpenApi loginApi() {
String[] apiPath = new String[] {
"/**/login"
};

return GroupedOpenApi.builder()
.group("0. Login API")
.pathsToMatch(LOGIN_API.getPaths())
.pathsToMatch(apiPath)
.build();
}

@Bean
public GroupedOpenApi adminApi() {
return createGroupedOpenApi("1. Admin API", ADMIN_API.getPaths());
String[] packagesPath = new String[] {
"in.koreatech.koin.admin"
};

return createGroupedOpenApi("1. Admin API", packagesPath);
}

@Bean
public GroupedOpenApi businessApi() {
return createGroupedOpenApi("2. Business API", BUSINESS_API.getPaths());
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() {
return createGroupedOpenApi("3. Campus API", CAMPUS_API.getPaths());
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() {
return createGroupedOpenApi("4. User API", USER_API.getPaths());
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() {
return createGroupedOpenApi("5. abTest API", ABTEST_API.getPaths());
String[] packagesPath = new String[] {
"in.koreatech.koin.admin.abtest"
};

return createGroupedOpenApi("5. abTest API", packagesPath);
}

@Bean
public GroupedOpenApi bcsdApi() {
return createGroupedOpenApi("6. bcsd API", BCSD_API.getPaths());
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) {
Expand Down

0 comments on commit 0cb8cda

Please sign in to comment.