方式一
private static final String SPLITOR = ",";
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
// 詳細定製 .apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.apis(basePackage("com.ruoyi.app.api" + SPLITOR + "com.ruoyi.payment.controller"))
.paths(PathSelectors.any()).build();
}
方式二
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
// 詳細定製
.apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
.paths(PathSelectors.any()).build();
}