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