fix: 修改swagger配置增加了新的组
This commit is contained in:
parent
036cc1ac25
commit
d3322639de
@ -41,7 +41,7 @@ public class SwaggerConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public Docket restApi() {
|
public Docket restApi() {
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.groupName("标准接口")
|
.groupName("全部接口")
|
||||||
.apiInfo(apiInfo("Spring Boot中使用Swagger2构建RESTful APIs", "1.0"))
|
.apiInfo(apiInfo("Spring Boot中使用Swagger2构建RESTful APIs", "1.0"))
|
||||||
.useDefaultResponseMessages(true)
|
.useDefaultResponseMessages(true)
|
||||||
.forCodeGeneration(false)
|
.forCodeGeneration(false)
|
||||||
@ -54,6 +54,22 @@ public class SwaggerConfig {
|
|||||||
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
|
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket adminApi() {
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.groupName("admin模块接口")
|
||||||
|
.apiInfo(apiInfo("Spring Boot中使用Swagger2构建RESTful APIs", "1.0"))
|
||||||
|
.useDefaultResponseMessages(true)
|
||||||
|
.forCodeGeneration(false)
|
||||||
|
.select()
|
||||||
|
.apis(RequestHandlerSelectors.basePackage("com.cnbm.admin"))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build()
|
||||||
|
.securityContexts(Arrays.asList(securityContext()))
|
||||||
|
// ApiKey的name需与SecurityReference的reference保持一致
|
||||||
|
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
|
* 创建该API的基本信息(这些基本信息会展现在文档页面中)
|
||||||
* 访问地址:http://ip:port/swagger-ui.html
|
* 访问地址:http://ip:port/swagger-ui.html
|
||||||
|
Loading…
Reference in New Issue
Block a user