refactor(project):重构项目结构并迁移至snails-chat模块- 将项目主模块更名为snails-chat,调整包结构

- 移除JPA相关依赖,替换为MyBatis-Plus- 数据库从MySQL迁移至PostgreSQL- 移除QueryTool工具类及相关依赖- 更新Redis配置,使用JSON序列化- 移除DashScopeController及AIResponse类
- 添加User实体类及Mapper接口
- 调整ChatClientConfiguration配置类- 更新pom.xml依赖管理及模块配置
This commit is contained in:
2025-10-25 10:06:37 +08:00
parent 40c05838f7
commit 177dfff3c7
25 changed files with 203 additions and 338 deletions

View File

@@ -0,0 +1,66 @@
#file: noinspection SpringBootConfigYamlInspection
server:
servlet:
encoding:
charset: utf-8
force: true
spring:
application:
name: snails-ai
banner:
location: config/banner.txt
data:
redis:
host: localhost
port: 6379
password: redis
database: 4
lettuce:
pool:
enabled: true
max-active: 20
max-idle: 10
max-wait: 10000
min-idle: 10
time-between-eviction-runs: 10000
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/postgres
username: postgres
password: postgressql
# HikariCP 连接池配置
hikari:
maximum-pool-size: 20 # 最大连接数设置为 20
minimum-idle: 20 # 保持 20 个空闲连接(与最大连接数一致)
connection-timeout: 5000 # 获取连接超时 5 秒
max-lifetime: 28800000 # 8 小时(确保在数据库连接超时前被回收)
ai:
memory:
redis:
host: localhost
port: 6379
timeout: 5000
password: redis
dashscope:
api-key: ENC(cMgcKZkFllyE88DIbGwLKot9Vg02co+gsmY8L8o4/o3UjhcmqO4lJzFU35Sx0n+qFG8pDL0wBjoWrT8X6BuRw9vNlQhY1LgRWHaF9S1zzyM=)
chat:
options:
model: qwen-plus
temperature: 0.5
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
logging:
level:
# 隐藏掉 Hibernate 冗长的连接池 INFO 信息
org.hibernate.orm.connections.pooling: WARN
org.springframework.ai.chat.client.advisor: DEBUG
jasypt:
encryptor:
password: ${jasypt.encryptor.password}
algorithm: PBEWithHMACSHA512AndAES_256
iv-generator-classname: org.jasypt.iv.RandomIvGenerator