feat(user): 引入本地缓存优化用户信息查询性能

- 添加 Caffeine 依赖并配置本地缓存
- 实现用户信息多级缓存:本地缓存 -> Redis -> 数据库
- 新增用户信息缓存KEY常量及构建方法
- 配置自定义线程池用于异步缓存操作
- 实现缓存空对象防止击穿与过期时间随机化
- 添加 JsonUtils 工具类解析 JSON 字符串为对象的方法
This commit is contained in:
Hanserwei
2025-10-08 20:29:54 +08:00
parent fcdbda4c56
commit ae9720b7cb
6 changed files with 136 additions and 1 deletions

View File

@@ -88,6 +88,11 @@
<groupId>com.hanserwei</groupId>
<artifactId>han-note-distributed-id-generator-api</artifactId>
</dependency>
<!-- Caffeine 本地缓存 -->
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
</dependencies>