| | |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * API 문서 제작 패키지 Swagger 설정 클래스 |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | public class SwaggerConfig { |
| | |
| | | private static final String API_VERSION = "1.0.0"; |
| | | private static final String API_DESCRIPTION = "OWL API 명세서"; |
| | | |
| | | |
| | | /** |
| | | * API 설정 |
| | | * @return docket class |
| | | */ |
| | | @Bean |
| | | public Docket api() { |
| | | // Parameter parameterBuilder = new ParameterBuilder() |
| | |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * API 문서 타이틀/버전/설명 설정 |
| | | * @return ApiInfo 클래스 |
| | | */ |
| | | public ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title(API_NAME) |
| | |
| | | .build(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * API 문서 테스트 Request Content-Type 설정 추가 |
| | | * @return consumes content-type 목록 |
| | | */ |
| | | private Set<String> getConsumeContentTypes() { |
| | | Set<String> consumes = new HashSet<>(); |
| | | consumes.add("application/json;charset=UTF-8"); |
| | |
| | | return consumes; |
| | | } |
| | | |
| | | /** |
| | | * API 문서 테스트 Response content-type 설정 추가 |
| | | * @return produce content-type 목록 |
| | | */ |
| | | private Set<String> getProduceContentTypes() { |
| | | Set<String> produces = new HashSet<>(); |
| | | produces.add("application/json;charset=UTF-8"); |