From 0cb8cda60bbbce65901a874bff28261455cf6a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=8B=A0=EA=B4=80=EA=B7=9C?= Date: Wed, 18 Dec 2024 14:13:34 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/config/swagger/ApiPackage.java | 50 ---------------- .../config/swagger/SwaggerGroupConfig.java | 59 ++++++++++++++++--- 2 files changed, 50 insertions(+), 59 deletions(-) delete mode 100644 src/main/java/in/koreatech/koin/global/config/swagger/ApiPackage.java diff --git a/src/main/java/in/koreatech/koin/global/config/swagger/ApiPackage.java b/src/main/java/in/koreatech/koin/global/config/swagger/ApiPackage.java deleted file mode 100644 index f2ac0415e..000000000 --- a/src/main/java/in/koreatech/koin/global/config/swagger/ApiPackage.java +++ /dev/null @@ -1,50 +0,0 @@ -package in.koreatech.koin.global.config.swagger; - -import lombok.Getter; - -@Getter -public enum ApiPackage { - LOGIN_API(new String[] { - "/**/login" - }), - ADMIN_API(new String[] { - "in.koreatech.koin.admin" - }), - BUSINESS_API(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" - }), - CAMPUS_API(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" - }), - USER_API(new String[] { - "in.koreatech.koin.domain.user", - "in.koreatech.koin.domain.student", - "in.koreatech.koin.domain.timetable", - "in.koreatech.koin.domain.timetableV2" - }), - ABTEST_API(new String[] { - "in.koreatech.koin.admin.abtest" - }), - BCSD_API(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" - }); - - private final String[] paths; - - ApiPackage(String[] paths) { - this.paths = paths; - } -} - diff --git a/src/main/java/in/koreatech/koin/global/config/swagger/SwaggerGroupConfig.java b/src/main/java/in/koreatech/koin/global/config/swagger/SwaggerGroupConfig.java index 12c21b9bf..de048156e 100644 --- a/src/main/java/in/koreatech/koin/global/config/swagger/SwaggerGroupConfig.java +++ b/src/main/java/in/koreatech/koin/global/config/swagger/SwaggerGroupConfig.java @@ -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; @@ -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) {