diff --git a/buildSrc/src/main/kotlin/Modules.kt b/buildSrc/src/main/kotlin/Modules.kt index 1b5edc3..7ca2389 100644 --- a/buildSrc/src/main/kotlin/Modules.kt +++ b/buildSrc/src/main/kotlin/Modules.kt @@ -8,8 +8,12 @@ object Modules { object Webmvc { - const val STARTER = ":forgeboot-webmvc" - const val VERSION_STARTER = ":forgeboot-webmvc:forgeboot-webmvc-version-starter" - const val LOGGER_STARTER = ":forgeboot-webmvc:forgeboot-webmvc-logger-starter" + const val STARTER = ":forgeboot-webmvc-spring-boot-starter" + const val VERSION_STARTER = ":forgeboot-webmvc-spring-boot-starter:forgeboot-webmvc-version-spring-boot-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" } } \ No newline at end of file diff --git a/forgeboot-core/.gitattributes b/forgeboot-core/.gitattributes new file mode 100644 index 0000000..8af972c --- /dev/null +++ b/forgeboot-core/.gitattributes @@ -0,0 +1,3 @@ +/gradlew text eol=lf +*.bat text eol=crlf +*.jar binary diff --git a/forgeboot-core/.gitignore b/forgeboot-core/.gitignore new file mode 100644 index 0000000..5a979af --- /dev/null +++ b/forgeboot-core/.gitignore @@ -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 diff --git a/forgeboot-core/build.gradle.kts b/forgeboot-core/build.gradle.kts new file mode 100644 index 0000000..2e3ca6a --- /dev/null +++ b/forgeboot-core/build.gradle.kts @@ -0,0 +1,3 @@ +dependencies { + +} diff --git a/forgeboot-core/forgeboot-core-extension/.gitattributes b/forgeboot-core/forgeboot-core-extension/.gitattributes new file mode 100644 index 0000000..8af972c --- /dev/null +++ b/forgeboot-core/forgeboot-core-extension/.gitattributes @@ -0,0 +1,3 @@ +/gradlew text eol=lf +*.bat text eol=crlf +*.jar binary diff --git a/forgeboot-core/forgeboot-core-extension/.gitignore b/forgeboot-core/forgeboot-core-extension/.gitignore new file mode 100644 index 0000000..5a979af --- /dev/null +++ b/forgeboot-core/forgeboot-core-extension/.gitignore @@ -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 diff --git a/forgeboot-core/forgeboot-core-extension/build.gradle.kts b/forgeboot-core/forgeboot-core-extension/build.gradle.kts new file mode 100644 index 0000000..1d47d6f --- /dev/null +++ b/forgeboot-core/forgeboot-core-extension/build.gradle.kts @@ -0,0 +1,4 @@ +dependencies { + val libs = rootProject.libs + implementation(libs.slf4j.api) +} \ No newline at end of file diff --git a/forgeboot-core/forgeboot-core-extension/src/main/kotlin/com/gewuyou/forgeboot/core/extension/Logger.kt b/forgeboot-core/forgeboot-core-extension/src/main/kotlin/com/gewuyou/forgeboot/core/extension/Logger.kt new file mode 100644 index 0000000..46fb0c0 --- /dev/null +++ b/forgeboot-core/forgeboot-core-extension/src/main/kotlin/com/gewuyou/forgeboot/core/extension/Logger.kt @@ -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.log: Logger + get() = LoggerFactory.getLogger(this::class.java) diff --git a/forgeboot-webmvc/build.gradle.kts b/forgeboot-webmvc/build.gradle.kts index a51e0e0..401b542 100644 --- a/forgeboot-webmvc/build.gradle.kts +++ b/forgeboot-webmvc/build.gradle.kts @@ -4,5 +4,6 @@ extra { } dependencies { - + api(project(Modules.Webmvc.VERSION_STARTER)) + api(project(Modules.Webmvc.LOGGER_STARTER)) } diff --git a/forgeboot-webmvc/forgeboot-webmvc-version-starter/build.gradle.kts b/forgeboot-webmvc/forgeboot-webmvc-version-starter/build.gradle.kts index db66158..3864ecf 100644 --- a/forgeboot-webmvc/forgeboot-webmvc-version-starter/build.gradle.kts +++ b/forgeboot-webmvc/forgeboot-webmvc-version-starter/build.gradle.kts @@ -4,5 +4,5 @@ extra { setProperty(ProjectFlags.USE_SPRING_BOOT_WEB, true) } dependencies { - + implementation(project(Modules.Core.EXTENSION)) } diff --git a/forgeboot-webmvc/forgeboot-webmvc-version-starter/src/main/kotlin/com/gewuyou/forgeboot/webmvc/version/config/VersionAutoConfiguration.kt b/forgeboot-webmvc/forgeboot-webmvc-version-starter/src/main/kotlin/com/gewuyou/forgeboot/webmvc/version/config/VersionAutoConfiguration.kt index 3ccf12b..55246f3 100644 --- a/forgeboot-webmvc/forgeboot-webmvc-version-starter/src/main/kotlin/com/gewuyou/forgeboot/webmvc/version/config/VersionAutoConfiguration.kt +++ b/forgeboot-webmvc/forgeboot-webmvc-version-starter/src/main/kotlin/com/gewuyou/forgeboot/webmvc/version/config/VersionAutoConfiguration.kt @@ -1,5 +1,6 @@ package com.gewuyou.forgeboot.webmvc.version.config +import com.gewuyou.forgeboot.core.extension.log import com.gewuyou.forgeboot.webmvc.version.mapping.ApiVersionRequestMappingHandlerMapping import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration @@ -23,6 +24,7 @@ open class VersionAutoConfiguration { */ @Bean open fun apiVersionRequestMappingHandlerMapping(): ApiVersionRequestMappingHandlerMapping { + log.info("创建 API 版本请求映射处理程序映射") return ApiVersionRequestMappingHandlerMapping() } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2347aba..419c8f9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,12 +9,16 @@ kotlinxSerializationJSON-version = "1.7.3" kotlinxCoroutines-version = "1.9.0" axion-release-version = "1.18.7" spring-boot-version = "3.4.4" + +slf4j-version = "2.0.17" [libraries] kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-version" } kotlinxDatetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinxDatetime-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" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j-version" } + 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" } diff --git a/settings.gradle.kts b/settings.gradle.kts index a135d3b..87e4697 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,8 @@ plugins { rootProject.name = "forgeboot" + +//region module webmvc include( "forgeboot-webmvc", ":forgeboot-webmvc:forgeboot-webmvc-version-starter", @@ -29,4 +31,14 @@ include( ) 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-logger-starter").name = "forgeboot-webmvc-logger-spring-boot-starter" \ No newline at end of file +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 \ No newline at end of file