接口扫描逻辑更改

通过包的方式不太灵活,通过包和注解的方式更有针对性

Signed-off-by: 刘继东 <wwwliujidong@163.com>
pull/366/head
刘继东 1 year ago committed by Gitee
parent cf03781bd7
commit 729f991a1a
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -61,7 +61,8 @@ public class SwaggerAutoConfiguration
ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost()) ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2).host(swaggerProperties.getHost())
.apiInfo(apiInfo(swaggerProperties)).select() .apiInfo(apiInfo(swaggerProperties)).select()
.apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())); .apis(RequestHandlerSelectors.basePackage(swaggerProperties.getBasePackage())
.and(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)));
swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p))); swaggerProperties.getBasePath().forEach(p -> builder.paths(PathSelectors.ant(p)));
swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate())); swaggerProperties.getExcludePath().forEach(p -> builder.paths(PathSelectors.ant(p).negate()));

Loading…
Cancel
Save