Commit a1a01cd1175370e09791231c963fa2ede4747d62
1 parent
47753467
fix swagger 的基础扫描路径不正确
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java
| ... | ... | @@ -22,6 +22,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| 22 | 22 | import java.util.Collections; |
| 23 | 23 | import java.util.List; |
| 24 | 24 | |
| 25 | +import static springfox.documentation.builders.RequestHandlerSelectors.basePackage; | |
| 26 | + | |
| 25 | 27 | /** |
| 26 | 28 | * Swagger2 自动配置类 |
| 27 | 29 | * |
| ... | ... | @@ -56,7 +58,7 @@ public class YudaoSwaggerAutoConfiguration { |
| 56 | 58 | .apiInfo(apiInfo(properties)) |
| 57 | 59 | // 设置扫描指定 package 包下的 |
| 58 | 60 | .select() |
| 59 | -// .apis(basePackage(properties.getBasePackage())) | |
| 61 | + .apis(basePackage(properties.getBasePackage())) | |
| 60 | 62 | // .apis(basePackage("cn.iocoder.yudao.module.system")) // 可用于 swagger 无法展示时使用 |
| 61 | 63 | .paths(PathSelectors.any()) |
| 62 | 64 | .build() | ... | ... |