| | |
| | | import org.springframework.context.annotation.Bean;
|
| | | import org.springframework.context.annotation.Configuration;
|
| | | import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
| | |
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | |
| | | @Configuration
|
| | | @EnableWebMvc
|
| | | @EnableSwagger2
|
| | | public class SwaggerConfig {
|
| | | public class SwaggerConfig extends WebMvcConfigurerAdapter{
|
| | | @Bean
|
| | | public Docket myDocket() {
|
| | | Docket docket = new Docket(DocumentationType.SWAGGER_2);
|
| | |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).build();
|
| | | return docket;
|
| | | }
|
| | | |
| | | @Override
|
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
| | | registry.addResourceHandler("swagger-ui.html")
|
| | | .addResourceLocations("classpath:/META-INF/resources/");
|
| | | registry.addResourceHandler("/webjars*")
|
| | | .addResourceLocations("classpath:/META-INF/resources/webjars/");
|
| | | }
|
| | | }
|