swagger配置

发布时间 2024-01-11 01:53:44作者: 泳之

 配置swagger可以限定范围

 @Bean
public Docket controllerApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(new ApiInfoBuilder().title("申报查询接口").version("版本号:1.0").build())
.select()
.apis(RequestHandlerSelectors.basePackage("com.pangu.crawler"))
.paths(PathSelectors.any())
.build();
2.使用knife4j

第一种方式

 第二种方式