From 023d0c0926265f62375f45002165bffee82cc67a Mon Sep 17 00:00:00 2001
From: Hanserwei <2628273921@qq.com>
Date: Sun, 19 Oct 2025 20:01:31 +0800
Subject: [PATCH] =?UTF-8?q?feat(data-align):=20=E5=88=9D=E5=A7=8B=E5=8C=96?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E9=BD=90=E6=A8=A1=E5=9D=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加 han-note-data-align 模块基础结构
- 配置 application.yml 和 bootstrap.yml 文件
- 设置 MyBatis Plus 和 Redis 配置
- 集成 Nacos 服务发现与配置中心
- 添加日志配置文件 logback-spring.xml
- 创建数据源和 MyBatis 相关 IDEA 配置文件- 更新 .gitignore 排除特定开发环境配置和日志文件
- 配置 IntelliJ IDEA 编译器和编码设置
---
.gitignore | 82 ++--
.idea/MyBatisCodeHelperDatasource.xml | 380 ++++++++++++++++++
.idea/compiler.xml | 50 +++
.idea/dataSources.xml | 57 +++
.idea/data_source_mapping.xml | 10 +
.idea/dictionaries/project.xml | 15 +
.idea/encodings.xml | 2 +
.idea/jarRepositories.xml | 20 +
.idea/sqldialects.xml | 9 +
.idea/swagger-settings.xml | 6 +
han-note-data-align/pom.xml | 91 +++++
.../align/HannoteDataAlignApplication.java | 13 +
.../src/main/resources/application.yml | 31 ++
.../src/main/resources/bootstrap.yml | 19 +
.../src/main/resources/logback-spring.xml | 58 +++
pom.xml | 8 +
16 files changed, 819 insertions(+), 32 deletions(-)
create mode 100644 .idea/MyBatisCodeHelperDatasource.xml
create mode 100644 .idea/compiler.xml
create mode 100644 .idea/dataSources.xml
create mode 100644 .idea/data_source_mapping.xml
create mode 100644 .idea/dictionaries/project.xml
create mode 100644 .idea/jarRepositories.xml
create mode 100644 .idea/sqldialects.xml
create mode 100644 .idea/swagger-settings.xml
create mode 100644 han-note-data-align/pom.xml
create mode 100644 han-note-data-align/src/main/java/com/hanserwei/hannote/data/align/HannoteDataAlignApplication.java
create mode 100644 han-note-data-align/src/main/resources/application.yml
create mode 100644 han-note-data-align/src/main/resources/bootstrap.yml
create mode 100644 han-note-data-align/src/main/resources/logback-spring.xml
diff --git a/.gitignore b/.gitignore
index d6a7748..ac33853 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,31 @@
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
-.kotlin
+# -----------------------------------------------------------------------------
+# 构建产物和依赖
+# -----------------------------------------------------------------------------
+target/ # Maven 默认的编译输出目录
+**/target/
+!.mvn/wrapper/maven-wrapper.jar # 保留 Maven Wrapper jar 包
+!**/src/main/**/target/ # 排除 src/main 下的 target 目录,但如果上面的 target/ 已经生效,这行可能冗余,但安全起见保留
+!**/src/test/**/target/ # 排除 src/test 下的 target 目录
+
+/build/ # Gradle 默认的编译输出目录
+!**/src/main/**/build/ # 排除 src/main 下的 build 目录
+!**/src/test/**/build/ # 排除 src/test 下的 build 目录
+/dist/ # NetBeans / 通用分发目录
+/nbbuild/
+/nbdist/
+/.nb-gradle/
+
+# -----------------------------------------------------------------------------
+# IDE 配置文件
+# -----------------------------------------------------------------------------
### IntelliJ IDEA ###
-.idea/modules.xml
-.idea/jarRepositories.xml
-.idea/compiler.xml
+.idea/ # IntelliJ IDEA 配置目录
+# 保留某些重要的 IDEA 文件 (如果需要,但通常 .idea/ 排除足够)
+!.idea/modules.xml
+!.idea/jarRepositories.xml
+!.idea/compiler.xml
+# 排除掉不需要的版本控制的文件
.idea/libraries/
*.iws
*.iml
@@ -24,31 +42,31 @@ target/
### NetBeans ###
/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
### VS Code ###
.vscode/
-### Mac OS ###
-.DS_Store
-/.idea/
-/han-note-auth/src/main/resources/application-dev.yml
-/han-note-auth/src/main/resources/application-prod.yml
-/han-note-auth/logs/
-/logs/
-/han-note-oss/han-note-oss-biz/src/main/resources/application-dev.yml
-/han-note-user/han-note-user-biz/src/main/resources/application-dev.yml
-/han-note-user/han-note-user-biz/logs/
-/han-note-kv/han-note-kv-biz/src/main/resources/application-dev.yml
-/han-note-kv/han-note-kv-biz/src/main/resources/application-prod.yml
-/han-note-kv/han-note-kv-biz/logs/
-/han-note-note/han-note-note-biz/src/main/resources/application-dev.yml
-/han-note-user-relation/han-note-user-relation-biz/src/main/resources/application-dev.yml
-/han-note-user-relation/han-note-user-relation-biz/logs/
-/han-note-count/han-note-count-biz/src/main/resources/application-dev.yml
+# -----------------------------------------------------------------------------
+# OS/平台文件
+# -----------------------------------------------------------------------------
+.DS_Store # Mac OS X
+# .idea/ (已在 IDEA 部分排除,但 Mac 用户有时会在项目根目录生成一个隐藏的 .idea 文件夹)
+
+# -----------------------------------------------------------------------------
+# 语言特定文件
+# -----------------------------------------------------------------------------
+.kotlin # Kotlin 缓存文件
+
+# -----------------------------------------------------------------------------
+# 自定义应用配置文件和日志 (重点优化部分)
+# -----------------------------------------------------------------------------
+
+# 排除所有模块的 logs/ 目录
+*/logs/
+# 统一排除所有模块的日志目录(如果上面的 *\/logs/ 不够全面)
+logs/
+
+# 排除所有 application-dev.yml 和 application-prod.yml
+# 这种方式更简洁,排除所有环境的本地配置,统一管理
+application-dev.yml
+application-prod.yml
diff --git a/.idea/MyBatisCodeHelperDatasource.xml b/.idea/MyBatisCodeHelperDatasource.xml
new file mode 100644
index 0000000..c889800
--- /dev/null
+++ b/.idea/MyBatisCodeHelperDatasource.xml
@@ -0,0 +1,380 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..0d5519e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 0000000..9cf016d
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,57 @@
+
+
+
+
+ mysql.8
+ true
+ true
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://127.0.0.1:3306/han_note?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
+
+
+
+
+
+ $ProjectFileDir$
+
+
+ redis
+ true
+ true
+ jdbc.RedisDriver
+ jdbc:redis://127.0.0.1:6379/5
+
+
+
+
+
+ $ProjectFileDir$
+
+
+ cassandra
+ true
+ true
+ com.ing.data.cassandra.jdbc.CassandraDriver
+ jdbc:cassandra://127.0.0.1:9042/hannote
+
+
+
+
+
+ $ProjectFileDir$
+
+
+ mysql.8
+ true
+ true
+ com.mysql.cj.jdbc.Driver
+ jdbc:mysql://127.0.0.1:3306/leaf?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai
+
+
+
+
+
+ $ProjectFileDir$
+
+
+
\ No newline at end of file
diff --git a/.idea/data_source_mapping.xml b/.idea/data_source_mapping.xml
new file mode 100644
index 0000000..a734c44
--- /dev/null
+++ b/.idea/data_source_mapping.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml
new file mode 100644
index 0000000..a32c9e6
--- /dev/null
+++ b/.idea/dictionaries/project.xml
@@ -0,0 +1,15 @@
+
+
+
+ asyn
+ hannote
+ hanserwei
+ nacos
+ operationlog
+ rustfs
+ zadd
+ zrevrangebyscore
+ zset
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 530d611..b80d928 100755
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -9,6 +9,8 @@
+
+
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..712ab9d
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml
new file mode 100644
index 0000000..a0fb8bf
--- /dev/null
+++ b/.idea/sqldialects.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/swagger-settings.xml b/.idea/swagger-settings.xml
new file mode 100644
index 0000000..2d089b8
--- /dev/null
+++ b/.idea/swagger-settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/han-note-data-align/pom.xml b/han-note-data-align/pom.xml
new file mode 100644
index 0000000..9431ba1
--- /dev/null
+++ b/han-note-data-align/pom.xml
@@ -0,0 +1,91 @@
+
+ 4.0.0
+
+
+ com.hanserwei
+ han-note
+ ${revision}
+
+
+
+ jar
+ han-note-data-align
+ ${project.artifactId}
+ 数据对齐服务
+
+
+
+ com.hanserwei
+ hanserwei-common
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+ com.baomidou
+ mybatis-plus-spring-boot3-starter
+
+
+
+
+ com.mysql
+ mysql-connector-j
+
+
+
+
+ com.alibaba
+ druid-spring-boot-3-starter
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-bootstrap
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
diff --git a/han-note-data-align/src/main/java/com/hanserwei/hannote/data/align/HannoteDataAlignApplication.java b/han-note-data-align/src/main/java/com/hanserwei/hannote/data/align/HannoteDataAlignApplication.java
new file mode 100644
index 0000000..95fc4cb
--- /dev/null
+++ b/han-note-data-align/src/main/java/com/hanserwei/hannote/data/align/HannoteDataAlignApplication.java
@@ -0,0 +1,13 @@
+package com.hanserwei.hannote.data.align;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@MapperScan("com.hanserwei.hannote.data.align.domain.mapper")
+public class HannoteDataAlignApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(HannoteDataAlignApplication.class, args);
+ }
+}
diff --git a/han-note-data-align/src/main/resources/application.yml b/han-note-data-align/src/main/resources/application.yml
new file mode 100644
index 0000000..6eef217
--- /dev/null
+++ b/han-note-data-align/src/main/resources/application.yml
@@ -0,0 +1,31 @@
+server:
+ port: 8091 # 项目启动的端口
+
+spring:
+ profiles:
+ active: dev # 默认激活 dev 本地开发环境
+ servlet:
+ multipart:
+ max-file-size: 20MB # 单个文件最大大小
+ max-request-size: 100MB # 单次请求最大大小(包含多个文件)
+ data:
+ redis:
+ database: 5 # Redis 数据库索引(默认为 0)
+ host: 127.0.0.1 # Redis 服务器地址
+ port: 6379 # Redis 服务器连接端口
+ password: redis # Redis 服务器连接密码(默认为空)
+ timeout: 5s # 读超时时间
+ connect-timeout: 5s # 链接超时时间
+ lettuce:
+ pool:
+ max-active: 200 # 连接池最大连接数
+ max-wait: -1ms # 连接池最大阻塞等待时间(使用负值表示没有限制)
+ min-idle: 0 # 连接池中的最小空闲连接
+ max-idle: 10 # 连接池中的最大空闲连接
+mybatis-plus:
+ configuration:
+ map-underscore-to-camel-case: true
+ log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
+ global-config:
+ banner: false
+ mapper-locations: classpath*:/mapperxml/*.xml
\ No newline at end of file
diff --git a/han-note-data-align/src/main/resources/bootstrap.yml b/han-note-data-align/src/main/resources/bootstrap.yml
new file mode 100644
index 0000000..735da3b
--- /dev/null
+++ b/han-note-data-align/src/main/resources/bootstrap.yml
@@ -0,0 +1,19 @@
+spring:
+ application:
+ name: han-note-data-align # 应用名称
+ profiles:
+ active: dev # 默认激活 dev 本地开发环境
+ cloud:
+ nacos:
+ discovery:
+ enabled: true # 启用服务发现
+ group: DEFAULT_GROUP # 所属组
+ namespace: han-note # 命名空间
+ server-addr: 127.0.0.1:8848 # 指定 Nacos 配置中心的服务器地址
+ config:
+ server-addr: http://127.0.0.1:8848 # 指定 Nacos 配置中心的服务器地址
+ prefix: ${spring.application.name} # 配置 Data Id 前缀,这里使用应用名称作为前缀
+ group: DEFAULT_GROUP # 所属组
+ namespace: han-note # 命名空间
+ file-extension: yaml # 配置文件格式
+ refresh-enabled: true # 是否开启动态刷新
\ No newline at end of file
diff --git a/han-note-data-align/src/main/resources/logback-spring.xml b/han-note-data-align/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..60db215
--- /dev/null
+++ b/han-note-data-align/src/main/resources/logback-spring.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${LOG_FILE}-%i.log
+
+ 30
+
+ 10MB
+
+ 0
+
+ false
+
+
+ ${LOG_PATTERN}
+ UTF-8
+
+
+
+
+
+
+ 0
+
+ 256
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index 98df385..d01fbb7 100755
--- a/pom.xml
+++ b/pom.xml
@@ -22,6 +22,7 @@
han-note-note/han-note-note-biz
han-note-user-relation
han-note-count
+ han-note-data-align
@@ -65,6 +66,7 @@
2.3.4
5.3.2
0.2.21
+ 3.2.0
@@ -292,6 +294,12 @@
buffer-trigger
${buffertrigger.version}
+
+
+ com.xuxueli
+ xxl-job-core
+ ${xxl-job.version}
+