feat(cache): 添加 Caffeine缓存支持并优化日志处理

- 在应用配置中添加 Caffeine 缓存配置
- 新增 CaffeineConfig 类用于缓存管理
- 在 Log 实体中添加 userAgent 字段保存原始用户代理字符串
- 优化 LogAspect 中的用户代理解析逻辑,增加缓存支持
- 更新数据库表结构,在 log 表中添加 user_agent 列
This commit is contained in:
Theo
2025-02-10 10:21:39 +08:00
parent 8caf20a455
commit cb8a2c4f41
9 changed files with 97 additions and 6 deletions

View File

@@ -35,6 +35,8 @@ spring:
time-to-live: 3600000
# 缓存null值防止缓存穿透
cache-null-values: true
caffeine:
spec: initialCapacity=50,maximumSize=1000,expireAfterWrite=600s
# 邮件配置
mail:
host: smtp.youlai.tech