commit d689a39a98fa854dcff83d71d9c36f216d558733
Author: Hanserwei <2628273921@qq.com>
Date: Wed Nov 26 19:29:21 2025 +0800
feat(project): initialize Spring Boot weblog project with Gradle modules
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..8af972c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+/gradlew text eol=lf
+*.bat text eol=crlf
+*.jar binary
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..982e56b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,68 @@
+# --------------------------------------------------------------------------
+# Gradle 构建相关 (必须忽略)
+# --------------------------------------------------------------------------
+.gradle/
+build/
+!gradle/wrapper/gradle-wrapper.jar
+!gradle/wrapper/gradle-wrapper.properties
+
+# Gradle 缓存与日志
+gradle-app.setting
+.gradle-test-kit/
+
+# --------------------------------------------------------------------------
+# IntelliJ IDEA 相关 (IDE 配置文件)
+# --------------------------------------------------------------------------
+# 忽略旧版 IntelliJ 的输出目录
+out/
+# 忽略项目生成的模块文件
+*.iml
+*.ipr
+*.iws
+
+# .idea 文件夹处理原则:通常保留大部分配置以便团队共享,但要忽略用户个人的 workspace 设置
+# 忽略个人工作区配置
+.idea/workspace.xml
+.idea/usage.statistics.xml
+.idea/dictionaries
+.idea/shelf
+.idea/httpRequests
+
+# 下面这些文件通常建议提交,方便团队统一配置,或者你换电脑后能保留配置
+# .idea/encodings.xml
+# .idea/compiler.xml
+# .idea/misc.xml
+# .idea/vcs.xml
+
+# --------------------------------------------------------------------------
+# Java & Spring Boot 通用
+# --------------------------------------------------------------------------
+*.class
+*.log
+*.ctxt
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# 崩溃日志
+hs_err_pid*
+replay_pid*
+
+# --------------------------------------------------------------------------
+# 操作系统生成的文件
+# --------------------------------------------------------------------------
+.DS_Store
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+
+# --------------------------------------------------------------------------
+# 敏感信息 (根据需要开启,防止密钥泄露)
+# --------------------------------------------------------------------------
+application-prod.yml
+application-dev.yml
+.env
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..35410ca
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# 默认忽略的文件
+/shelf/
+/workspace.xml
+# 基于编辑器的 HTTP 客户端请求
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/ApifoxUploaderProjectSetting.xml b/.idea/ApifoxUploaderProjectSetting.xml
new file mode 100644
index 0000000..cbbc398
--- /dev/null
+++ b/.idea/ApifoxUploaderProjectSetting.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..9cdbbc2
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..5fe35d7
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..f281ec3
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..2758df8
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..850799d
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..9a39965
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,49 @@
+plugins {
+ java
+ id("org.springframework.boot") version "3.5.8" apply false
+ id("io.spring.dependency-management") version "1.1.7" apply false
+}
+
+group = "com.hanserwei"
+version = "0.0.1-SNAPSHOT"
+description = "weblog-springboot"
+
+java {
+ toolchain {
+ languageVersion = JavaLanguageVersion.of(21)
+ }
+}
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+}
+
+allprojects {
+ group = "com.hanserwei"
+ version = "0.0.1-SNAPSHOT"
+
+ repositories {
+ mavenCentral()
+ }
+}
+
+subprojects {
+ apply(plugin = "java")
+ apply(plugin = "io.spring.dependency-management")
+
+ java.sourceCompatibility = JavaVersion.VERSION_21
+ java.targetCompatibility = JavaVersion.VERSION_21
+
+ dependencies {
+ compileOnly("org.projectlombok:lombok")
+ annotationProcessor("org.projectlombok:lombok")
+ testCompileOnly("org.projectlombok:lombok")
+ testAnnotationProcessor("org.projectlombok:lombok")
+ }
+
+ tasks.withType {
+ useJUnitPlatform()
+ }
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..1b33c55
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..d4081da
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..7871e04
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,5 @@
+rootProject.name = "weblog-springboot"
+
+include("weblog-web")
+include("weblog-module-admin")
+include("weblog-module-common")
\ No newline at end of file
diff --git a/weblog-module-admin/build.gradle.kts b/weblog-module-admin/build.gradle.kts
new file mode 100644
index 0000000..7517d54
--- /dev/null
+++ b/weblog-module-admin/build.gradle.kts
@@ -0,0 +1,10 @@
+plugins {
+ java
+}
+
+dependencies {
+ // Test
+ testImplementation("org.springframework.boot:spring-boot-starter-test")
+
+ implementation(project(":weblog-module-common"))
+}
\ No newline at end of file
diff --git a/weblog-module-common/build.gradle.kts b/weblog-module-common/build.gradle.kts
new file mode 100644
index 0000000..14e8e4a
--- /dev/null
+++ b/weblog-module-common/build.gradle.kts
@@ -0,0 +1,14 @@
+plugins {
+ java
+}
+
+dependencies {
+
+ // guava
+ implementation("com.google.guava:guava:33.5.0-jre")
+ // commons-lang3
+ implementation("org.apache.commons:commons-lang3:3.20.0")
+
+ // test
+ testImplementation("org.springframework.boot:spring-boot-starter-test")
+}
diff --git a/weblog-web/build.gradle.kts b/weblog-web/build.gradle.kts
new file mode 100644
index 0000000..90c9014
--- /dev/null
+++ b/weblog-web/build.gradle.kts
@@ -0,0 +1,19 @@
+plugins {
+ id("org.springframework.boot")
+ id("io.spring.dependency-management")
+ java
+}
+
+dependencies {
+
+ // Spring Boot Web(示例)
+ implementation("org.springframework.boot:spring-boot-starter-web")
+
+
+ // Test
+ testImplementation("org.springframework.boot:spring-boot-starter-test")
+
+ // 其他依赖…
+ implementation(project(":weblog-module-common"))
+ implementation(project(":weblog-module-admin"))
+}
diff --git a/weblog-web/src/main/java/com/hanserwei/web/WeblogWebApplication.java b/weblog-web/src/main/java/com/hanserwei/web/WeblogWebApplication.java
new file mode 100644
index 0000000..2a93678
--- /dev/null
+++ b/weblog-web/src/main/java/com/hanserwei/web/WeblogWebApplication.java
@@ -0,0 +1,11 @@
+package com.hanserwei.web;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class WeblogWebApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(WeblogWebApplication.class, args);
+ }
+}
diff --git a/weblog-web/src/main/resources/config/application.yml b/weblog-web/src/main/resources/config/application.yml
new file mode 100644
index 0000000..f0c5452
--- /dev/null
+++ b/weblog-web/src/main/resources/config/application.yml
@@ -0,0 +1,5 @@
+spring:
+ application:
+ name: han-blog
+ profiles:
+ active: dev
\ No newline at end of file
diff --git a/weblog-web/src/main/resources/logback-weblog.xml b/weblog-web/src/main/resources/logback-weblog.xml
new file mode 100644
index 0000000..b17ce1c
--- /dev/null
+++ b/weblog-web/src/main/resources/logback-weblog.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${LOG_FILE}-%i.log
+
+ 30
+
+
+ 10MB
+
+
+
+
+ ${FILE_LOG_PATTERN}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/weblog-web/src/test/java/com/hanserwei/web/WeblogWebApplicationTests.java b/weblog-web/src/test/java/com/hanserwei/web/WeblogWebApplicationTests.java
new file mode 100644
index 0000000..8f75af4
--- /dev/null
+++ b/weblog-web/src/test/java/com/hanserwei/web/WeblogWebApplicationTests.java
@@ -0,0 +1,26 @@
+package com.hanserwei.web;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+import lombok.extern.slf4j.Slf4j;
+
+@SpringBootTest
+@Slf4j
+class WeblogWebApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+ @Test
+ void testLog() {
+ log.info("这是一行 Info 级别日志");
+ log.warn("这是一行 Warn 级别日志");
+ log.error("这是一行 Error 级别日志");
+
+ // 占位符
+ String author = "Hanserwei";
+ log.info("这是一行带有占位符日志,作者:{}", author);
+ }
+
+}
\ No newline at end of file