From 162413c9faf69d91b828081acc012acb21abac97 Mon Sep 17 00:00:00 2001 From: HyoBN Date: Thu, 25 Apr 2024 16:33:04 +0900 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Feat:=20=EC=8A=A4=EC=9B=A8?= =?UTF-8?q?=EA=B1=B0=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 5 +++++ .../server/global/config/SwaggerConfig.java | 22 +++++++++++++++++++ src/main/resources/application.yml | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 src/main/java/treehouse/server/global/config/SwaggerConfig.java diff --git a/build.gradle b/build.gradle index f0d1948..e6bb5de 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,11 @@ dependencies { // mysql runtimeOnly 'com.mysql:mysql-connector-j' + // swagger + implementation 'io.springfox:springfox-swagger2:2.9.2' + implementation 'io.springfox:springfox-swagger-ui:2.9.2' + implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' + testImplementation 'org.springframework.boot:spring-boot-starter-test' } diff --git a/src/main/java/treehouse/server/global/config/SwaggerConfig.java b/src/main/java/treehouse/server/global/config/SwaggerConfig.java new file mode 100644 index 0000000..c8d9e93 --- /dev/null +++ b/src/main/java/treehouse/server/global/config/SwaggerConfig.java @@ -0,0 +1,22 @@ +package treehouse.server.global.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.servers.Server; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SwaggerConfig { + @Bean + public OpenAPI SpringCodeBaseAPI() { + Info info = new Info() + .title("PeerNa API") + .description("PeerNa API 명세서") + .version("1.0.0"); + + return new OpenAPI() + .addServersItem(new Server().url("/")) + .info(info); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8ad984a..d6fb358 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -52,7 +52,7 @@ spring: format_sql: true use_sql_comments: true hbm2ddl: - auto: update + auto: create default_batch_fetch_size: 1000 data: redis: @@ -117,7 +117,7 @@ spring: format_sql: true use_sql_comments: true hbm2ddl: - auto: update + auto: create default_batch_fetch_size: 1000 jwt: header: Authorization