feat(ai): 新增AI命令系统功能
This commit is contained in:
@@ -6,8 +6,8 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://www.youlai.tech:3306/youlai_boot?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true&allowMultiQueries=true
|
||||
username: youlai
|
||||
password: 123456
|
||||
username: root
|
||||
password: Youlai@2025
|
||||
data:
|
||||
redis:
|
||||
database: 0
|
||||
@@ -74,7 +74,7 @@ mybatis-plus:
|
||||
security:
|
||||
session:
|
||||
type: jwt # 会话方式 jwt/redis-token
|
||||
access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期
|
||||
access-token-time-to-live: 7200 # 访问令牌 有效期(单位:秒),默认 2 小时,-1 表示永不过期
|
||||
refresh-token-time-to-live: 604800 # 刷新令牌有效期(单位:秒),默认 7 天,-1 表示永不过期
|
||||
jwt:
|
||||
secret-key: SecretKey012345678901234567890123456789012345678901234567890123456789 # JWT密钥(HS256算法至少32字符)
|
||||
@@ -82,12 +82,12 @@ security:
|
||||
allow-multi-login: true # 是否允许多设备登录
|
||||
# 安全白名单路径,仅跳过 AuthorizationFilter 过滤器,还是会走 Spring Security 的其他过滤器(CSRF、CORS等)
|
||||
ignore-urls:
|
||||
- /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录)
|
||||
- /api/v1/auth/captcha # 验证码获取接口
|
||||
- /api/v1/auth/refresh-token # 刷新令牌接口
|
||||
- /api/v1/auth/logout # 开放退出登录
|
||||
- /api/v1/auth/login/** # 登录接口(账号密码登录、手机验证码登录和微信登录)
|
||||
- /api/v1/auth/captcha # 验证码获取接口
|
||||
- /api/v1/auth/refresh-token # 刷新令牌接口
|
||||
- /api/v1/auth/logout # 开放退出登录
|
||||
- /api/v1/auth/wx/miniapp/code-login # 微信小程序code登陆
|
||||
- /ws/** # WebSocket接口
|
||||
- /ws/** # WebSocket接口
|
||||
# 非安全端点路径,完全绕过 Spring Security 的安全控制
|
||||
unsecured-urls:
|
||||
- ${springdoc.swagger-ui.path}
|
||||
@@ -153,7 +153,7 @@ springdoc:
|
||||
api-docs:
|
||||
path: /v3/api-docs
|
||||
group-configs:
|
||||
- group: '系统管理'
|
||||
- group: "系统管理"
|
||||
paths-to-match: "/**"
|
||||
packages-to-scan:
|
||||
- com.youlai.boot.auth.controller
|
||||
@@ -165,9 +165,9 @@ springdoc:
|
||||
# knife4j 接口文档配置
|
||||
knife4j:
|
||||
# 是否开启 Knife4j 增强功能
|
||||
enable: true # 设置为 true 表示开启增强功能
|
||||
enable: true # 设置为 true 表示开启增强功能
|
||||
# 生产环境配置
|
||||
production: false # 设置为 true 表示在生产环境中不显示文档,为 false 表示显示文档(通常在开发环境中使用)
|
||||
production: false # 设置为 true 表示在生产环境中不显示文档,为 false 表示显示文档(通常在开发环境中使用)
|
||||
setting:
|
||||
language: zh_cn
|
||||
|
||||
@@ -223,3 +223,66 @@ wx:
|
||||
miniapp:
|
||||
app-id: xxxxxx
|
||||
app-secret: xxxxxx
|
||||
|
||||
# ==================== AI 命令系统配置 ====================
|
||||
ai:
|
||||
# 是否启用 AI 功能
|
||||
enabled: false
|
||||
|
||||
# 当前使用的提供商:qwen、deepseek、openai
|
||||
provider: qwen
|
||||
|
||||
# 所有提供商配置(统一管理,扩展性强)
|
||||
providers:
|
||||
# 阿里通义千问(推荐:有免费额度)
|
||||
qwen:
|
||||
# API Key(https://bailian.console.aliyun.com/ 获取)
|
||||
api-key: ${QWEN_API_KEY:sk-c2941d05bf2f411ca80424fcxxxxxxxx}
|
||||
|
||||
# Base URL(OpenAI 兼容端点)
|
||||
base-url: https://dashscope.aliyuncs.com/compatible-mode/v1
|
||||
|
||||
# 模型:qwen-plus(推荐)、qwen-turbo、qwen-max、qwen-long
|
||||
model: qwen-plus
|
||||
|
||||
# 显示名称
|
||||
display-name: 阿里通义千问
|
||||
|
||||
# 超时时间(秒)
|
||||
timeout: 30
|
||||
|
||||
# DeepSeek
|
||||
deepseek:
|
||||
api-key: ${DEEPSEEK_API_KEY:}
|
||||
base-url: https://api.deepseek.com/v1
|
||||
model: deepseek-chat
|
||||
display-name: DeepSeek
|
||||
timeout: 30
|
||||
|
||||
# OpenAI(添加新提供商只需配置,无需修改代码)
|
||||
openai:
|
||||
api-key: ${OPENAI_API_KEY:}
|
||||
base-url: https://api.openai.com/v1
|
||||
model: gpt-4
|
||||
display-name: OpenAI GPT-4
|
||||
timeout: 60
|
||||
|
||||
# 安全配置
|
||||
security:
|
||||
enable-audit: true
|
||||
dangerous-operations-confirm: true
|
||||
function-whitelist:
|
||||
- deleteUser
|
||||
- updateUser
|
||||
- queryUsers
|
||||
- assignRole
|
||||
sensitive-params:
|
||||
- password
|
||||
- idCard
|
||||
- bankCard
|
||||
- token
|
||||
|
||||
# 限流配置
|
||||
rate-limit:
|
||||
max-executions-per-minute: 10
|
||||
max-executions-per-day: 100
|
||||
|
||||
Reference in New Issue
Block a user