feat: 添加 Swagger 配置
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
package icu.sunway.ai_spring_example.Config;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.info.Info;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OpenAPI配置类
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class OpenApiConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public OpenAPI customOpenAPI() {
|
||||||
|
return new OpenAPI()
|
||||||
|
.info(new Info()
|
||||||
|
.title("Swagger API文档")
|
||||||
|
.version("1.0.0")
|
||||||
|
.description("查询 API 文档"));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user