refactor(webmvc): Refactored the WebMvc version module

- Migrating Java code to Kotlin - Updating project structure and naming
- Add Git-related files
- Adjust the build configuration
This commit is contained in:
gewuyou 2025-05-28 23:49:28 +08:00
parent d8fe54db38
commit 6ea0bab287
8 changed files with 55 additions and 25 deletions

View File

@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary

40
forgeboot-webmvc/version/.gitignore vendored Normal file
View File

@ -0,0 +1,40 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/
### Kotlin ###
.kotlin

View File

@ -1,5 +1,5 @@
dependencies { dependencies {
implementation(project(Modules.Core.EXTENSION)) implementation(project(Modules.Core.EXTENSION))
kapt(libs.springBoot.configuration.processor)
compileOnly(libs.springBootStarter.web) compileOnly(libs.springBootStarter.web)
} }

View File

@ -1,10 +1,11 @@
package com.gewuyou.forgeboot.webmvc.version.config.entities; package com.gewuyou.forgeboot.webmvc.version.config.entities
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties
/** /**
* 版本属性 * 版本属性
* <p> *
*
* 该类用于配置和管理版本相关的属性通过@ConfigurationProperties注解 * 该类用于配置和管理版本相关的属性通过@ConfigurationProperties注解
* 将其与配置文件中以 version 为前缀的属性自动绑定 * 将其与配置文件中以 version 为前缀的属性自动绑定
* *
@ -12,34 +13,20 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @since 2025-05-02 11:52:24 * @since 2025-05-02 11:52:24
*/ */
@ConfigurationProperties(prefix = "forgeboot.webmvc.version") @ConfigurationProperties(prefix = "forgeboot.webmvc.version")
public class WebMvcVersionProperties { class WebMvcVersionProperties {
/** /**
* API前缀 * API前缀
* <p> *
*
* 定义了API的路由前缀用于在URL中区分不同的API版本 * 定义了API的路由前缀用于在URL中区分不同的API版本
*/ */
private String apiPrefix = "/api"; var apiPrefix: String = "/api"
/** /**
* API后缀 * API后缀
* <p> *
*
* 定义了API的路由后缀用于在URL中区分不同的API版本 * 定义了API的路由后缀用于在URL中区分不同的API版本
*/ */
private String apiSuffix = ""; var apiSuffix: String = ""
public String getApiPrefix() {
return apiPrefix;
}
public void setApiPrefix(String apiPrefix) {
this.apiPrefix = apiPrefix;
}
public String getApiSuffix() {
return apiSuffix;
}
public void setApiSuffix(String apiSuffix) {
this.apiSuffix = apiSuffix;
}
} }