2025-11-18 16:20:08 +08:00
|
|
|
|
# 项目相关配置
|
2026-01-30 17:31:21 +08:00
|
|
|
|
xinli:
|
2025-11-18 16:20:08 +08:00
|
|
|
|
# 名称
|
2025-11-22 04:12:26 +08:00
|
|
|
|
name: AI心理健康测评系统
|
2025-11-18 16:20:08 +08:00
|
|
|
|
# 版本
|
|
|
|
|
|
version: 1.0.0
|
|
|
|
|
|
# 版权年份
|
|
|
|
|
|
copyrightYear: 2025
|
|
|
|
|
|
# 文件路径 示例( Windows配置D:/ddnai/uploadPath,Linux配置 /home/ddnai/uploadPath)
|
2025-11-19 01:21:15 +08:00
|
|
|
|
profile: D:\wwwroot\xinli_web\web\profile\uploadPath #/www/wwwroot/wm.ddn-ai.cloud/profile/uploadPath
|
2025-11-18 16:20:08 +08:00
|
|
|
|
# 获取ip地址开关
|
|
|
|
|
|
addressEnabled: false
|
|
|
|
|
|
# 验证码类型 math 数字计算 char 字符验证
|
|
|
|
|
|
captchaType: math
|
|
|
|
|
|
|
|
|
|
|
|
# 开发环境配置
|
|
|
|
|
|
server:
|
|
|
|
|
|
# 服务器的HTTP端口,默认为8080
|
|
|
|
|
|
port: 30081
|
|
|
|
|
|
servlet:
|
|
|
|
|
|
# 应用的访问路径
|
|
|
|
|
|
context-path: /
|
|
|
|
|
|
tomcat:
|
|
|
|
|
|
# tomcat的URI编码
|
|
|
|
|
|
uri-encoding: UTF-8
|
|
|
|
|
|
# 连接数满后的排队数,默认为100
|
|
|
|
|
|
accept-count: 1000
|
|
|
|
|
|
threads:
|
|
|
|
|
|
# tomcat最大线程数,默认为200
|
|
|
|
|
|
max: 800
|
|
|
|
|
|
# Tomcat启动初始化的线程数,默认值10
|
|
|
|
|
|
min-spare: 100
|
|
|
|
|
|
|
|
|
|
|
|
# 日志配置
|
|
|
|
|
|
logging:
|
|
|
|
|
|
level:
|
|
|
|
|
|
com.ddnai: debug
|
|
|
|
|
|
org.springframework: warn
|
|
|
|
|
|
|
|
|
|
|
|
# 用户配置
|
|
|
|
|
|
user:
|
|
|
|
|
|
password:
|
|
|
|
|
|
# 密码最大错误次数
|
|
|
|
|
|
maxRetryCount: 5
|
|
|
|
|
|
# 密码锁定时间(默认10分钟)
|
|
|
|
|
|
lockTime: 10
|
|
|
|
|
|
|
|
|
|
|
|
# Spring配置
|
|
|
|
|
|
spring:
|
|
|
|
|
|
# 资源信息
|
|
|
|
|
|
messages:
|
|
|
|
|
|
# 国际化资源文件路径
|
|
|
|
|
|
basename: i18n/messages
|
|
|
|
|
|
profiles:
|
|
|
|
|
|
active: druid
|
|
|
|
|
|
# 文件上传
|
|
|
|
|
|
servlet:
|
|
|
|
|
|
multipart:
|
|
|
|
|
|
# 单个文件大小
|
|
|
|
|
|
max-file-size: 10MB
|
|
|
|
|
|
# 设置总上传的文件大小
|
|
|
|
|
|
max-request-size: 20MB
|
2025-12-02 15:12:55 +08:00
|
|
|
|
# MVC配置
|
|
|
|
|
|
mvc:
|
|
|
|
|
|
async:
|
|
|
|
|
|
# 异步请求超时时间(毫秒),设置为10分钟,避免大文件导入超时
|
|
|
|
|
|
request-timeout: 600000
|
2025-11-18 16:20:08 +08:00
|
|
|
|
# 服务模块
|
|
|
|
|
|
devtools:
|
|
|
|
|
|
restart:
|
|
|
|
|
|
# 热部署开关
|
|
|
|
|
|
enabled: true
|
|
|
|
|
|
# redis 配置
|
|
|
|
|
|
redis:
|
|
|
|
|
|
# 地址
|
|
|
|
|
|
host: 127.0.0.1
|
|
|
|
|
|
# 端口,默认为6379
|
|
|
|
|
|
port: 6379
|
|
|
|
|
|
# 数据库索引
|
|
|
|
|
|
database: 0
|
|
|
|
|
|
# 密码(如果Redis服务器没有设置密码,请注释掉此行或留空)
|
|
|
|
|
|
# password: xbZttkmndxCkWsycjs2
|
|
|
|
|
|
# 连接超时时间
|
|
|
|
|
|
timeout: 10s
|
|
|
|
|
|
# 使用Jedis客户端替代Lettuce客户端
|
|
|
|
|
|
jedis:
|
|
|
|
|
|
pool:
|
|
|
|
|
|
# 连接池中的最小空闲连接
|
|
|
|
|
|
min-idle: 0
|
|
|
|
|
|
# 连接池中的最大空闲连接
|
|
|
|
|
|
max-idle: 8
|
|
|
|
|
|
# 连接池的最大数据库连接数
|
|
|
|
|
|
max-active: 8
|
|
|
|
|
|
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
|
|
|
|
|
max-wait: -1ms
|
|
|
|
|
|
|
|
|
|
|
|
# token配置
|
|
|
|
|
|
token:
|
|
|
|
|
|
# 令牌自定义标识
|
|
|
|
|
|
header: Authorization
|
|
|
|
|
|
# 令牌密钥(重要:生产环境必须修改为随机32位字符串)
|
|
|
|
|
|
secret: YWFhMzlhOGEtYTdjYi00NTUzLWFhMDct
|
|
|
|
|
|
# 令牌有效期(默认30分钟)
|
|
|
|
|
|
expireTime: 30
|
|
|
|
|
|
|
|
|
|
|
|
# MyBatis配置
|
|
|
|
|
|
mybatis:
|
|
|
|
|
|
# 搜索指定包别名
|
|
|
|
|
|
typeAliasesPackage: com.ddnai.**.domain
|
|
|
|
|
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
|
|
|
|
|
mapperLocations: classpath*:mapper/**/*Mapper.xml
|
|
|
|
|
|
# 加载全局的配置文件
|
|
|
|
|
|
configLocation: classpath:mybatis/mybatis-config.xml
|
|
|
|
|
|
|
|
|
|
|
|
# PageHelper分页插件
|
|
|
|
|
|
pagehelper:
|
|
|
|
|
|
helperDialect: mysql
|
|
|
|
|
|
supportMethodsArguments: true
|
|
|
|
|
|
params: count=countSql
|
|
|
|
|
|
|
|
|
|
|
|
# Swagger配置
|
|
|
|
|
|
swagger:
|
|
|
|
|
|
# 是否开启swagger(生产环境必须关闭!)
|
|
|
|
|
|
enabled: ${SWAGGER_ENABLED:true}
|
|
|
|
|
|
# 请求前缀
|
|
|
|
|
|
pathMapping: /dev-api
|
|
|
|
|
|
|
|
|
|
|
|
# 防盗链配置
|
|
|
|
|
|
referer:
|
|
|
|
|
|
# 防盗链开关
|
|
|
|
|
|
enabled: false
|
|
|
|
|
|
# 允许的域名列表
|
|
|
|
|
|
allowed-domains: localhost,127.0.0.1
|
|
|
|
|
|
|
|
|
|
|
|
# 防止XSS攻击
|
|
|
|
|
|
xss:
|
|
|
|
|
|
# 过滤开关
|
|
|
|
|
|
enabled: true
|
|
|
|
|
|
# 排除链接(多个用逗号分隔)
|
|
|
|
|
|
excludes: /system/notice
|
|
|
|
|
|
# 匹配链接
|
2025-12-19 14:03:43 +08:00
|
|
|
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
|
|
|
|
|
|
|
|
|
|
|
# RAG知识库配置
|
|
|
|
|
|
rag:
|
2025-12-20 12:08:33 +08:00
|
|
|
|
# Python RAG 服务配置(主要使用这个)
|
|
|
|
|
|
python:
|
|
|
|
|
|
url: http://localhost:5000
|
|
|
|
|
|
enabled: true
|
2025-12-19 14:03:43 +08:00
|
|
|
|
|
2025-12-20 12:08:33 +08:00
|
|
|
|
# 禁用 Java 端的 RAG 功能,全部由 Python 服务处理
|
|
|
|
|
|
# 使用模式: disabled(禁用Java端)、python(仅Python)
|
|
|
|
|
|
mode: disabled
|
|
|
|
|
|
|
2025-12-21 18:57:14 +08:00
|
|
|
|
# OpenAI兼容API配置(本地开发时使用Kimi API)
|
2025-12-19 14:03:43 +08:00
|
|
|
|
openai:
|
|
|
|
|
|
base-url: https://api.moonshot.cn/v1
|
|
|
|
|
|
api-key: sk-U9fdriPxwBcrpWW0Ite3N0eVtX7VxnqqqYUIBAdWd1hgEA9m
|
2025-12-20 12:08:33 +08:00
|
|
|
|
embed-model: none
|
2025-12-19 14:03:43 +08:00
|
|
|
|
generate-model: moonshot-v1-32k
|
2025-12-20 12:08:33 +08:00
|
|
|
|
connect-timeout: 10
|
|
|
|
|
|
read-timeout: 60
|
2025-12-21 18:57:14 +08:00
|
|
|
|
enabled: false
|
2025-12-19 14:03:43 +08:00
|
|
|
|
|
2025-12-21 18:57:14 +08:00
|
|
|
|
# Ollama配置(服务器部署时使用本地Ollama)
|
2025-12-19 14:03:43 +08:00
|
|
|
|
ollama:
|
|
|
|
|
|
url: http://localhost:11434
|
2025-12-21 18:57:14 +08:00
|
|
|
|
embed-model: nomic-embed-text
|
|
|
|
|
|
generate-model: deepseek-r1:32b
|
|
|
|
|
|
connect-timeout: 30
|
|
|
|
|
|
read-timeout: 300
|
|
|
|
|
|
enabled: true
|
2025-12-19 14:03:43 +08:00
|
|
|
|
|
2025-12-20 12:08:33 +08:00
|
|
|
|
# ChromaDB配置(禁用)
|
2025-12-19 14:03:43 +08:00
|
|
|
|
chromadb:
|
|
|
|
|
|
url: http://localhost:8000
|
|
|
|
|
|
collection: psychology_knowledge
|
2025-12-20 12:08:33 +08:00
|
|
|
|
enabled: false
|
2025-12-19 14:03:43 +08:00
|
|
|
|
|
|
|
|
|
|
# 存储配置
|
|
|
|
|
|
storage:
|
|
|
|
|
|
upload-path: D:/wwwroot/RAG/uploads
|
|
|
|
|
|
log-path: D:/wwwroot/RAG/logs
|
|
|
|
|
|
chroma-data-path: D:/wwwroot/RAG/data/chroma_db
|
|
|
|
|
|
|
2025-12-20 12:08:33 +08:00
|
|
|
|
# 文件监听配置(禁用)
|
2025-12-19 14:03:43 +08:00
|
|
|
|
file-watcher:
|
2025-12-20 12:08:33 +08:00
|
|
|
|
enabled: false
|
2025-12-19 14:03:43 +08:00
|
|
|
|
watch-path: D:/wwwroot/RAG/uploads
|
|
|
|
|
|
scan-interval: 10
|
|
|
|
|
|
|
|
|
|
|
|
# 检索配置
|
|
|
|
|
|
retrieval:
|
|
|
|
|
|
top-k: 5
|
|
|
|
|
|
similarity-threshold: 0.7
|
|
|
|
|
|
|
|
|
|
|
|
# 文本分块配置
|
|
|
|
|
|
text-splitter:
|
|
|
|
|
|
chunk-size: 800
|
|
|
|
|
|
chunk-overlap: 200
|