diff --git a/build.gradle b/build.gradle index cf77a62..18a0feb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'org.springframework.boot' version '2.6.1' + id 'org.springframework.boot' version '2.6.2' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' } @@ -34,6 +34,9 @@ dependencies { testImplementation 'org.springframework.boot:spring-boot-starter-test' implementation 'com.h2database:h2' implementation 'org.springframework.boot:spring-boot-starter-mail:2.5.6' + + implementation 'io.springfox:springfox-boot-starter:3.0.0' + implementation 'io.springfox:springfox-swagger-ui:3.0.0' } test { diff --git a/src/main/java/com/mangkyu/employment/interview/config/swagger/SwaggerConfig.java b/src/main/java/com/mangkyu/employment/interview/config/swagger/SwaggerConfig.java new file mode 100644 index 0000000..313187e --- /dev/null +++ b/src/main/java/com/mangkyu/employment/interview/config/swagger/SwaggerConfig.java @@ -0,0 +1,34 @@ +package com.mangkyu.employment.interview.config.swagger; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + +@Configuration +public class SwaggerConfig { + + @Bean + public Docket api() { + return new Docket(DocumentationType.OAS_30) + .useDefaultResponseMessages(false) + .select() + .apis(RequestHandlerSelectors.basePackage("com.mangkyu.employment.interview.app")) + .paths(PathSelectors.any()) + .build() + .apiInfo(apiInfo()); + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("Gsc Company") + .description("Gsc Company Quiz Server") + .version("1.0") + .build(); + } + +} \ No newline at end of file diff --git a/src/main/resources/application-alpha.properties b/src/main/resources/application-alpha.properties index 6ab27c9..921c96a 100644 --- a/src/main/resources/application-alpha.properties +++ b/src/main/resources/application-alpha.properties @@ -8,4 +8,6 @@ spring.datasource.password=2 spring.jpa.hibernate.ddl-auto=update spring.jpa.generate-ddl=true spring.jpa.open-in-view=false -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect + +spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER \ No newline at end of file diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 01667e5..77db6a3 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -8,4 +8,6 @@ spring.datasource.password=h2test spring.jpa.generate-ddl=true spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.open-in-view=false -spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect \ No newline at end of file +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect + +spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER \ No newline at end of file