|
@@ -24,7 +24,7 @@ public class SwaggerConfiguration {
|
|
|
|
|
|
@Bean
|
|
|
public OpenAPI baseApi(@Value("${springdoc.version}") String appVersion){
|
|
|
- OpenAPI openAPI = new OpenAPI();
|
|
|
+ OpenAPI openApi = new OpenAPI();
|
|
|
//基本信息
|
|
|
Info info = new Info().title("爱扣钉教务接口")
|
|
|
.description("爱扣钉教务接口API文档,openapi3.0 接口,用于前端对接")
|
|
@@ -32,7 +32,7 @@ public class SwaggerConfiguration {
|
|
|
.contact(new Contact().name("王雁"))
|
|
|
.license(new License().name("使用请遵守 Apache 2.0 授权协议")
|
|
|
.url("http://edu.koobietech.com"));
|
|
|
- openAPI.info(info);
|
|
|
+ openApi.info(info);
|
|
|
//授权信息
|
|
|
SecurityScheme securityToken = new SecurityScheme()
|
|
|
.type(SecurityScheme.Type.HTTP)
|
|
@@ -40,11 +40,11 @@ public class SwaggerConfiguration {
|
|
|
.bearerFormat("JWT")
|
|
|
.in(SecurityScheme.In.HEADER)
|
|
|
.name("Authorization");
|
|
|
- openAPI.components(new Components().securitySchemes(new HashMap<>(){{
|
|
|
- put("Authorization", securityToken);
|
|
|
- }}));
|
|
|
- openAPI.addSecurityItem(new SecurityRequirement().addList("Authorization"));
|
|
|
- return openAPI;
|
|
|
+ HashMap<String, SecurityScheme> authToken = new HashMap<>();
|
|
|
+ authToken.put("Authorization", securityToken);
|
|
|
+ openApi.components(new Components().securitySchemes(authToken));
|
|
|
+ openApi.addSecurityItem(new SecurityRequirement().addList("Authorization"));
|
|
|
+ return openApi;
|
|
|
}
|
|
|
|
|
|
@Bean
|