初始化

This commit is contained in:
lijiaqi 2023-02-01 10:51:52 +08:00
parent 260ac66935
commit 80d41bbc26
1 changed files with 19 additions and 3 deletions

View File

@ -27,9 +27,9 @@ public class SwaggerConfig {
this.openApiExtensionResolver = openApiExtensionResolver; this.openApiExtensionResolver = openApiExtensionResolver;
} }
@Bean(value = "defaultApi2") @Bean(value = "defaultApi1")
public Docket defaultApi2() { public Docket defaultApi1() {
String groupName="2.X版本"; String groupName="系统管理";
Docket docket=new Docket(DocumentationType.SWAGGER_2) Docket docket=new Docket(DocumentationType.SWAGGER_2)
.host("http://www.ydool.com/") .host("http://www.ydool.com/")
.apiInfo(apiInfo()) .apiInfo(apiInfo())
@ -43,6 +43,22 @@ public class SwaggerConfig {
return docket; return docket;
} }
@Bean(value = "defaultApi2")
public Docket defaultApi2() {
String groupName="人事管理";
Docket docket=new Docket(DocumentationType.SWAGGER_2)
.host("http://www.ydool.com/")
.apiInfo(apiInfo())
.groupName(groupName)
.select()
.apis(RequestHandlerSelectors.basePackage("com.ydool.staff.controller"))
.paths(PathSelectors.any())
.build()
//赋予插件体系
.extensions(openApiExtensionResolver.buildExtensions(groupName));
return docket;
}
private ApiInfo apiInfo() { private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("接口文档系统") return new ApiInfoBuilder().title("接口文档系统")
.description("接口文档系统") .description("接口文档系统")