diff --git a/.gitignore b/.gitignore
index 0f2da04..8b40d82 100755
--- a/.gitignore
+++ b/.gitignore
@@ -48,3 +48,4 @@ build/
/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
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index dbc0060..d4b0457 100755
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -17,6 +17,12 @@
+
+
+
+
+
+
diff --git a/han-note-auth/src/main/java/com/hanserwei/hannote/auth/HanNoteAuthApplication.java b/han-note-auth/src/main/java/com/hanserwei/hannote/auth/HannoteAuthApplication.java
similarity index 78%
rename from han-note-auth/src/main/java/com/hanserwei/hannote/auth/HanNoteAuthApplication.java
rename to han-note-auth/src/main/java/com/hanserwei/hannote/auth/HannoteAuthApplication.java
index 65c7b9a..d7400f5 100755
--- a/han-note-auth/src/main/java/com/hanserwei/hannote/auth/HanNoteAuthApplication.java
+++ b/han-note-auth/src/main/java/com/hanserwei/hannote/auth/HannoteAuthApplication.java
@@ -6,10 +6,10 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication
@EnableFeignClients(basePackages = "com.hanserwei.hannote")
-public class HanNoteAuthApplication {
+public class HannoteAuthApplication {
public static void main(String[] args) {
- SpringApplication.run(HanNoteAuthApplication.class, args);
+ SpringApplication.run(HannoteAuthApplication.class, args);
}
}
diff --git a/han-note-auth/src/main/resources/application.yml b/han-note-auth/src/main/resources/application.yml
index 6ea4bd3..b848c13 100755
--- a/han-note-auth/src/main/resources/application.yml
+++ b/han-note-auth/src/main/resources/application.yml
@@ -3,12 +3,6 @@ spring:
name: han-note-auth
profiles:
active: dev # 默认激活 dev 本地开发环境
- datasource:
- driver-class-name: com.mysql.cj.jdbc.Driver # 指定数据库驱动类
- # 数据库连接信息
- url: ${spring.datasource.url}
- username: ${spring.datasource.username} # 数据库用户名
- password: ${spring.datasource.password} # 数据库密码
data:
redis:
database: 5 # Redis 数据库索引(默认为 0)
diff --git a/han-note-note/han-note-note-api/pom.xml b/han-note-note/han-note-note-api/pom.xml
new file mode 100644
index 0000000..19bad48
--- /dev/null
+++ b/han-note-note/han-note-note-api/pom.xml
@@ -0,0 +1,24 @@
+
+ 4.0.0
+
+
+ com.hanserwei
+ han-note-note
+ ${revision}
+
+
+
+ jar
+
+ han-note-api
+ ${project.artifactId}
+ RPC层, 供其他服务调用
+
+
+
+ com.hanserwei
+ hanserwei-common
+
+
+
diff --git a/han-note-note/han-note-note-biz/pom.xml b/han-note-note/han-note-note-biz/pom.xml
new file mode 100644
index 0000000..1b8aa87
--- /dev/null
+++ b/han-note-note/han-note-note-biz/pom.xml
@@ -0,0 +1,105 @@
+
+ 4.0.0
+
+
+ com.hanserwei
+ han-note-note
+ ${revision}
+
+
+
+ jar
+
+ han-note-note-biz
+ ${project.artifactId}
+ 笔记服务业务层
+
+
+
+ com.hanserwei
+ hanserwei-common
+
+
+
+
+ com.hanserwei
+ hanserwei-spring-boot-starter-biz-operationlog
+
+
+
+
+ com.hanserwei
+ hanserwei-spring-boot-starter-biz-context
+
+
+
+
+ com.hanserwei
+ hanserwei-spring-boot-starter-jackson
+
+
+
+ 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.cloud
+ spring-cloud-starter-bootstrap
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-data-redis
+
+
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/HannoteNoteBizApplication.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/HannoteNoteBizApplication.java
new file mode 100644
index 0000000..6087c23
--- /dev/null
+++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/HannoteNoteBizApplication.java
@@ -0,0 +1,11 @@
+package com.hanserwei.hannote.note.biz;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class HannoteNoteBizApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(HannoteNoteBizApplication.class, args);
+ }
+}
diff --git a/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/config/RedisTemplateConfig.java b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/config/RedisTemplateConfig.java
new file mode 100644
index 0000000..001d97c
--- /dev/null
+++ b/han-note-note/han-note-note-biz/src/main/java/com/hanserwei/hannote/note/biz/config/RedisTemplateConfig.java
@@ -0,0 +1,31 @@
+package com.hanserwei.hannote.note.biz.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
+import org.springframework.data.redis.serializer.StringRedisSerializer;
+
+@Configuration
+public class RedisTemplateConfig {
+
+ @Bean
+ public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory) {
+ RedisTemplate redisTemplate = new RedisTemplate<>();
+ // 设置 RedisTemplate 的连接工厂
+ redisTemplate.setConnectionFactory(connectionFactory);
+
+ // 使用 StringRedisSerializer 来序列化和反序列化 redis 的 key 值,确保 key 是可读的字符串
+ redisTemplate.setKeySerializer(new StringRedisSerializer());
+ redisTemplate.setHashKeySerializer(new StringRedisSerializer());
+
+ // 使用 Jackson2JsonRedisSerializer 来序列化和反序列化 redis 的 value 值, 确保存储的是 JSON 格式
+ Jackson2JsonRedisSerializer