Merge remote-tracking branch 'origin/master'

This commit is contained in:
many2many 2024-05-28 08:10:46 +08:00
commit 169e8604c7

View File

@ -0,0 +1,35 @@
package com.lk.paopao.conf;
import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI customize() {
Components components = new Components();
SecurityScheme scheme = new SecurityScheme()
.name("bearerAuth")
.type(SecurityScheme.Type.HTTP)
.scheme("bearer")
.bearerFormat("JWT");
components.addSecuritySchemes("bearerAuth", scheme);
return new OpenAPI().
components(components)
.addSecurityItem(new SecurityRequirement().addList("bearerAuth"))
.info(new Info()
.title("PaoPao API")
.description("PaoPao Restful API 接口测试")
.version("v1"));
}
}