| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Import; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | |
| | | |
| | | ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost()) |
| | | .apiInfo(apiInfo(swaggerProperties)).select() |
| | | //.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())) |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)); |
| | | //.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())); |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)); |
| | | //.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)); |
| | | |
| | | swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p))); |
| | | swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate())); |