mirror of
https://github.moeyy.xyz/https://github.com/GeWuYou/forgeboot
synced 2025-10-28 02:24:21 +08:00
feat(core): Added core modules and refactored WebMvc modules
- Added forgeboot-core module, including core extension functions -Refactor the forgeboot-webmvc module and change it to Spring Boot Starter structure - Update project configuration and dependencies - Add log extension function
This commit is contained in:
parent
c22389d584
commit
beacb9c856
@ -8,8 +8,12 @@
|
|||||||
object Modules {
|
object Modules {
|
||||||
|
|
||||||
object Webmvc {
|
object Webmvc {
|
||||||
const val STARTER = ":forgeboot-webmvc"
|
const val STARTER = ":forgeboot-webmvc-spring-boot-starter"
|
||||||
const val VERSION_STARTER = ":forgeboot-webmvc:forgeboot-webmvc-version-starter"
|
const val VERSION_STARTER = ":forgeboot-webmvc-spring-boot-starter:forgeboot-webmvc-version-spring-boot-starter"
|
||||||
const val LOGGER_STARTER = ":forgeboot-webmvc:forgeboot-webmvc-logger-starter"
|
const val LOGGER_STARTER = ":forgeboot-webmvc-spring-boot-starter:forgeboot-webmvc-logger-spring-boot-starter"
|
||||||
|
}
|
||||||
|
object Core{
|
||||||
|
const val ROOT = ":forgeboot-core"
|
||||||
|
const val EXTENSION = ":forgeboot-core:forgeboot-core-extension"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
3
forgeboot-core/.gitattributes
vendored
Normal file
3
forgeboot-core/.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/gradlew text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.jar binary
|
||||||
40
forgeboot-core/.gitignore
vendored
Normal file
40
forgeboot-core/.gitignore
vendored
Normal 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
|
||||||
3
forgeboot-core/build.gradle.kts
Normal file
3
forgeboot-core/build.gradle.kts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
dependencies {
|
||||||
|
|
||||||
|
}
|
||||||
3
forgeboot-core/forgeboot-core-extension/.gitattributes
vendored
Normal file
3
forgeboot-core/forgeboot-core-extension/.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/gradlew text eol=lf
|
||||||
|
*.bat text eol=crlf
|
||||||
|
*.jar binary
|
||||||
40
forgeboot-core/forgeboot-core-extension/.gitignore
vendored
Normal file
40
forgeboot-core/forgeboot-core-extension/.gitignore
vendored
Normal 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
|
||||||
4
forgeboot-core/forgeboot-core-extension/build.gradle.kts
Normal file
4
forgeboot-core/forgeboot-core-extension/build.gradle.kts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
dependencies {
|
||||||
|
val libs = rootProject.libs
|
||||||
|
implementation(libs.slf4j.api)
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.gewuyou.forgeboot.core.extension
|
||||||
|
|
||||||
|
import org.slf4j.Logger
|
||||||
|
import org.slf4j.LoggerFactory
|
||||||
|
/**
|
||||||
|
*日志扩展类
|
||||||
|
*
|
||||||
|
* @since 2025-01-02 12:49:13
|
||||||
|
* @author gewuyou
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志扩展
|
||||||
|
*/
|
||||||
|
val <T : Any> T.log: Logger
|
||||||
|
get() = LoggerFactory.getLogger(this::class.java)
|
||||||
@ -4,5 +4,6 @@ extra {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
api(project(Modules.Webmvc.VERSION_STARTER))
|
||||||
|
api(project(Modules.Webmvc.LOGGER_STARTER))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,5 +4,5 @@ extra {
|
|||||||
setProperty(ProjectFlags.USE_SPRING_BOOT_WEB, true)
|
setProperty(ProjectFlags.USE_SPRING_BOOT_WEB, true)
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation(project(Modules.Core.EXTENSION))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.gewuyou.forgeboot.webmvc.version.config
|
package com.gewuyou.forgeboot.webmvc.version.config
|
||||||
|
|
||||||
|
import com.gewuyou.forgeboot.core.extension.log
|
||||||
import com.gewuyou.forgeboot.webmvc.version.mapping.ApiVersionRequestMappingHandlerMapping
|
import com.gewuyou.forgeboot.webmvc.version.mapping.ApiVersionRequestMappingHandlerMapping
|
||||||
import org.springframework.context.annotation.Bean
|
import org.springframework.context.annotation.Bean
|
||||||
import org.springframework.context.annotation.Configuration
|
import org.springframework.context.annotation.Configuration
|
||||||
@ -23,6 +24,7 @@ open class VersionAutoConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
open fun apiVersionRequestMappingHandlerMapping(): ApiVersionRequestMappingHandlerMapping {
|
open fun apiVersionRequestMappingHandlerMapping(): ApiVersionRequestMappingHandlerMapping {
|
||||||
|
log.info("创建 API 版本请求映射处理程序映射")
|
||||||
return ApiVersionRequestMappingHandlerMapping()
|
return ApiVersionRequestMappingHandlerMapping()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,12 +9,16 @@ kotlinxSerializationJSON-version = "1.7.3"
|
|||||||
kotlinxCoroutines-version = "1.9.0"
|
kotlinxCoroutines-version = "1.9.0"
|
||||||
axion-release-version = "1.18.7"
|
axion-release-version = "1.18.7"
|
||||||
spring-boot-version = "3.4.4"
|
spring-boot-version = "3.4.4"
|
||||||
|
|
||||||
|
slf4j-version = "2.0.17"
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-version" }
|
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-version" }
|
||||||
kotlinxDatetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime-version" }
|
kotlinxDatetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime-version" }
|
||||||
kotlinxSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJSON-version" }
|
kotlinxSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJSON-version" }
|
||||||
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines-version" }
|
kotlinxCoroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutines-version" }
|
||||||
|
|
||||||
|
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-version" }
|
||||||
|
|
||||||
springBootStarter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }
|
springBootStarter-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }
|
||||||
springBootDependencies-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot-version" }
|
springBootDependencies-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "spring-boot-version" }
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,8 @@ plugins {
|
|||||||
|
|
||||||
|
|
||||||
rootProject.name = "forgeboot"
|
rootProject.name = "forgeboot"
|
||||||
|
|
||||||
|
//region module webmvc
|
||||||
include(
|
include(
|
||||||
"forgeboot-webmvc",
|
"forgeboot-webmvc",
|
||||||
":forgeboot-webmvc:forgeboot-webmvc-version-starter",
|
":forgeboot-webmvc:forgeboot-webmvc-version-starter",
|
||||||
@ -30,3 +32,13 @@ include(
|
|||||||
project(":forgeboot-webmvc").name = "forgeboot-webmvc-spring-boot-starter"
|
project(":forgeboot-webmvc").name = "forgeboot-webmvc-spring-boot-starter"
|
||||||
project(":forgeboot-webmvc:forgeboot-webmvc-version-starter").name = "forgeboot-webmvc-version-spring-boot-starter"
|
project(":forgeboot-webmvc:forgeboot-webmvc-version-starter").name = "forgeboot-webmvc-version-spring-boot-starter"
|
||||||
project(":forgeboot-webmvc:forgeboot-webmvc-logger-starter").name = "forgeboot-webmvc-logger-spring-boot-starter"
|
project(":forgeboot-webmvc:forgeboot-webmvc-logger-starter").name = "forgeboot-webmvc-logger-spring-boot-starter"
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
//region module core
|
||||||
|
include(
|
||||||
|
"forgeboot-core",
|
||||||
|
":forgeboot-core:forgeboot-core-extension"
|
||||||
|
)
|
||||||
|
project(":forgeboot-core").name = "forgeboot-core"
|
||||||
|
project(":forgeboot-core:forgeboot-core-extension").name = "forgeboot-core-extension"
|
||||||
|
//endregion
|
||||||
Loading…
x
Reference in New Issue
Block a user