refactor: 移除 project.version 配置避免启动解析异常
- 删除 application.yml 的 project.version 段,banner 与 OpenApi 不再读取该属性 - 移除 banner.txt 的 YouLai Boot Version 行 - OpenApiConfig 不再显示接口文档版本号,删除无用的 Environment 依赖 - 为 config.import: classpath:codegen.yml 补充代码生成模块配置说明注释
This commit is contained in:
@@ -14,7 +14,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
import org.springdoc.core.customizers.GlobalOpenApiCustomizer;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.core.env.Environment;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.util.AntPathMatcher;
|
import org.springframework.util.AntPathMatcher;
|
||||||
|
|
||||||
@@ -32,8 +32,6 @@ import java.util.stream.Stream;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class OpenApiConfig {
|
public class OpenApiConfig {
|
||||||
|
|
||||||
private final Environment environment;
|
|
||||||
|
|
||||||
private final SecurityProperties securityProperties;
|
private final SecurityProperties securityProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,13 +40,10 @@ public class OpenApiConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public OpenAPI openApi() {
|
public OpenAPI openApi() {
|
||||||
|
|
||||||
String appVersion = environment.getProperty("project.version", "1.0.0");
|
|
||||||
|
|
||||||
return new OpenAPI()
|
return new OpenAPI()
|
||||||
.info(new Info()
|
.info(new Info()
|
||||||
.title("管理系统 API 文档")
|
.title("管理系统 API 文档")
|
||||||
.description("本文档涵盖管理系统的所有API接口,包括登录认证、用户管理、角色管理、部门管理等功能模块,提供详细的接口说明和使用指南。")
|
.description("本文档涵盖管理系统的所有API接口,包括登录认证、用户管理、角色管理、部门管理等功能模块,提供详细的接口说明和使用指南。")
|
||||||
.version(appVersion)
|
|
||||||
.license(new License()
|
.license(new License()
|
||||||
.name("Apache License 2.0")
|
.name("Apache License 2.0")
|
||||||
.url("http://www.apache.org/licenses/LICENSE-2.0")
|
.url("http://www.apache.org/licenses/LICENSE-2.0")
|
||||||
|
|||||||
@@ -4,12 +4,10 @@ spring:
|
|||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
config:
|
config:
|
||||||
|
# 引入代码生成模块的配置(数据源、表前缀等),由 codegen.yml 提供
|
||||||
import: classpath:codegen.yml
|
import: classpath:codegen.yml
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单文件大小上限,取自 file-storage.upload.max-file-size(单一来源)
|
# 单文件大小上限,取自 file-storage.upload.max-file-size(单一来源)
|
||||||
max-file-size: ${file-storage.upload.max-file-size:50MB}
|
max-file-size: ${file-storage.upload.max-file-size:50MB}
|
||||||
max-request-size: ${file-storage.upload.max-file-size:50MB}
|
max-request-size: ${file-storage.upload.max-file-size:50MB}
|
||||||
# 在 banner.txt 中显示项目版本,使用 @project.version@ 从 pom.xml 获取
|
|
||||||
project:
|
|
||||||
version: @project.version@
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ ${AnsiColor.BRIGHT_BLUE}
|
|||||||
|_|\___/ \__,_| |______\__,_|_|
|
|_|\___/ \__,_| |______\__,_|_|
|
||||||
|
|
||||||
${AnsiColor.BRIGHT_GREEN}
|
${AnsiColor.BRIGHT_GREEN}
|
||||||
YouLai Boot Version: ${project.version}
|
|
||||||
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
Spring Boot Version: ${spring-boot.version}${spring-boot.formatted-version}
|
||||||
有来官网: https://www.youlai.tech/
|
有来官网: https://www.youlai.tech/
|
||||||
版权所属: 有来开源组织
|
版权所属: 有来开源组织
|
||||||
|
|||||||
Reference in New Issue
Block a user