From 174a12a24261c25e1f901cf80309ad8db51e815e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=B4=BA=E8=B4=BA?= <1510379943@qq.com> Date: Tue, 19 Nov 2024 00:35:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=20=E6=B7=BB=E5=8A=A0=20OpenAPI=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 OpenApiConfig 类,配置 Swagger 文档信息 - 定义 API 文档的标题、描述和版本号 --- .../config/OpenApiConfig.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 trading_platform/src/main/java/com/trading_platform/config/OpenApiConfig.java diff --git a/trading_platform/src/main/java/com/trading_platform/config/OpenApiConfig.java b/trading_platform/src/main/java/com/trading_platform/config/OpenApiConfig.java new file mode 100644 index 0000000..836aaed --- /dev/null +++ b/trading_platform/src/main/java/com/trading_platform/config/OpenApiConfig.java @@ -0,0 +1,19 @@ +package com.trading_platform.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; + +@Configuration +public class OpenApiConfig { + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI() + .info(new Info() + .title("Trading Platform API 文档") + .description("swagger 文档 by 13") + .version("1.0.")); + } +}