mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-04 15:27:32 +00:00
Compare commits
37 Commits
v2.0.5
...
93ddcd53b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93ddcd53b1 | ||
|
|
0ee47a5c00 | ||
|
|
3ceef41ab0 | ||
|
|
57693059a1 | ||
|
|
d18e307e10 | ||
|
|
eed708c6d3 | ||
|
|
1093888889 | ||
|
|
e58a420f9f | ||
|
|
4a0c3d132a | ||
|
|
0d81aa640e | ||
|
|
951524bff7 | ||
|
|
c7d0e9337a | ||
|
|
6955f3c7dc | ||
|
|
a52b017e1a | ||
|
|
158a0190b5 | ||
|
|
096fc11313 | ||
|
|
e9ac795d23 | ||
|
|
32f1a6bab1 | ||
|
|
052069a2df | ||
|
|
e1c997883f | ||
|
|
031b7da198 | ||
|
|
931af963b1 | ||
|
|
f5fa7d5da8 | ||
|
|
c6ffbcb3cf | ||
|
|
05ae200ff5 | ||
|
|
e745f772ef | ||
|
|
584212c569 | ||
|
|
dc9bf3e25d | ||
|
|
da84a26c47 | ||
|
|
7d3282c347 | ||
|
|
4454be44c3 | ||
|
|
52e0feda01 | ||
|
|
c89f5d07fb | ||
|
|
778a7bc21b | ||
|
|
50f5f38996 | ||
|
|
32da85daab | ||
|
|
3666157d14 |
47
README.md
47
README.md
@@ -34,6 +34,53 @@
|
||||
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
||||
</p>
|
||||
|
||||
## 快速启动
|
||||
|
||||
1. 确认系统内已经安装好以下软件
|
||||
docker
|
||||
docker-compose
|
||||
git
|
||||
unzip
|
||||
|
||||
2. **克隆项目**
|
||||
```bash
|
||||
git clone https://github.com/ageerle/ruoyi-ai
|
||||
cd ruoyi-ai/docker-deploy/one-step-script/
|
||||
```
|
||||
|
||||
3. **启动部署脚本**
|
||||
|
||||
中文界面部署脚本:
|
||||
|
||||
```bash
|
||||
./deploy-cn.sh
|
||||
```
|
||||

|
||||

|
||||

|
||||
|
||||
英文界面部署脚本:
|
||||
|
||||
```bash
|
||||
./deploy-en.sh
|
||||
```
|
||||
|
||||
4. 如果在执行部署脚本过程中不需要在本地重新构建编译服务软件包以及重新封装容器镜像,则需要在脚本交互提出以下问题时选择D按键进行直接部署,否则就会执行全新的编译构建及容器封装之后再执行部署:
|
||||
```
|
||||
已将模板文件复制到部署目录。
|
||||
正在使用您的配置更新 .env 文件...
|
||||
已使用您的配置更新 .env 文件。
|
||||
正在使用您的配置更新 docker-compose.yaml 文件...
|
||||
已使用您的配置更新 docker-compose.yaml 文件。
|
||||
|
||||
=== 构建或部署选项 ===
|
||||
您想构建新镜像 (B) 还是直接使用现有镜像部署 (D)?[B/d]:
|
||||
```
|
||||
|
||||
5. **访问应用界面**
|
||||
- 用户界面:`http://your-server-ip:8081`
|
||||
- 管理员界面:`http://your-server-ip:8082`
|
||||
|
||||
## 目录
|
||||
|
||||
- [系统体验](#系统体验)
|
||||
|
||||
BIN
docker-deploy/Ruoyi-AI平台容器化构建与部署手册.docx
Normal file
BIN
docker-deploy/Ruoyi-AI平台容器化构建与部署手册.docx
Normal file
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
FROM nginx:1.25-alpine
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
proxy_pass http://ruoyi-backend:6039/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM openjdk:17-jdk
|
||||
WORKDIR /app
|
||||
COPY ruoyi-admin.jar /app/ruoyi-admin.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java","-jar","ruoyi-admin.jar"]
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM nginx:1.25-alpine
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://ruoyi-backend:6039/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# 应用标题
|
||||
VITE_APP_TITLE=RuoYi AI
|
||||
|
||||
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
||||
VITE_APP_NAMESPACE=vben-web-antd
|
||||
@@ -0,0 +1,7 @@
|
||||
# public path
|
||||
VITE_BASE=/
|
||||
|
||||
# Basic interface address SPA
|
||||
VITE_GLOB_API_URL=/api
|
||||
|
||||
VITE_VISUALIZER=true
|
||||
@@ -0,0 +1,25 @@
|
||||
# 端口号
|
||||
VITE_PORT=5666
|
||||
|
||||
VITE_BASE=/
|
||||
# 是否开启 Nitro Mock服务,true 为开启,false 为关闭
|
||||
VITE_NITRO_MOCK=false
|
||||
# 是否打开 devtools,true 为打开,false 为关闭
|
||||
VITE_DEVTOOLS=false
|
||||
# 是否注入全局loading
|
||||
VITE_INJECT_APP_LOADING=true
|
||||
|
||||
# 后台请求路径 具体在vite.config.mts配置代理
|
||||
VITE_GLOB_API_URL=/api
|
||||
|
||||
# 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应)
|
||||
VITE_GLOB_ENABLE_ENCRYPT=false
|
||||
# RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
|
||||
# RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
|
||||
# 客户端id
|
||||
VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
||||
|
||||
# 开启SSE
|
||||
VITE_GLOB_SSE_ENABLE=false
|
||||
@@ -0,0 +1,32 @@
|
||||
VITE_BASE=/
|
||||
|
||||
# 是否开启压缩,可以设置为 none, brotli, gzip
|
||||
VITE_COMPRESS=gzip
|
||||
|
||||
# 是否开启 PWA
|
||||
VITE_PWA=false
|
||||
|
||||
# vue-router 的模式
|
||||
VITE_ROUTER_HISTORY=history
|
||||
|
||||
# 是否注入全局loading
|
||||
VITE_INJECT_APP_LOADING=true
|
||||
|
||||
# 打包后是否生成dist.zip
|
||||
VITE_ARCHIVER=true
|
||||
|
||||
# 后端接口地址
|
||||
VITE_GLOB_API_URL=/prod-api
|
||||
|
||||
# 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应)
|
||||
VITE_GLOB_ENABLE_ENCRYPT=false
|
||||
# RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
|
||||
# RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
|
||||
# 客户端id
|
||||
VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
||||
|
||||
# 开启SSE
|
||||
VITE_GLOB_SSE_ENABLE=false
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# 该文件是为了给一个增加环境变量打包的例子
|
||||
# 对应在根目录package.json -> build:antd:test 命令
|
||||
|
||||
VITE_BASE=/
|
||||
|
||||
# 是否开启压缩,可以设置为 none, brotli, gzip
|
||||
VITE_COMPRESS=gzip
|
||||
|
||||
# 是否开启 PWA
|
||||
VITE_PWA=false
|
||||
|
||||
# vue-router 的模式
|
||||
VITE_ROUTER_HISTORY=history
|
||||
|
||||
# 是否注入全局loading
|
||||
VITE_INJECT_APP_LOADING=true
|
||||
|
||||
# 打包后是否生成dist.zip
|
||||
VITE_ARCHIVER=true
|
||||
|
||||
# 后端接口地址
|
||||
VITE_GLOB_API_URL=/test-api
|
||||
|
||||
# 全局加密开关(即开启了加解密功能才会生效 不是全部接口加密 需要和后端对应)
|
||||
VITE_GLOB_ENABLE_ENCRYPT=true
|
||||
# RSA公钥 请求加密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PUBLIC_KEY=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdHnzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==
|
||||
# RSA私钥 响应解密使用 注意这两个是两对RSA公私钥 请求加密-后端解密是一对 响应解密-后端加密是一对
|
||||
VITE_GLOB_RSA_PRIVATE_KEY=MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3CuPiGL/LcIIm7zryCEIbl1SPzBkr75E2VMtxegyZ1lYRD+7TZGAPkvIsBcaMs6Nsy0L78n2qh+lIZMpLH8wIDAQABAkEAk82Mhz0tlv6IVCyIcw/s3f0E+WLmtPFyR9/WtV3Y5aaejUkU60JpX4m5xNR2VaqOLTZAYjW8Wy0aXr3zYIhhQQIhAMfqR9oFdYw1J9SsNc+CrhugAvKTi0+BF6VoL6psWhvbAiEAxPPNTmrkmrXwdm/pQQu3UOQmc2vCZ5tiKpW10CgJi8kCIFGkL6utxw93Ncj4exE/gPLvKcT+1Emnoox+O9kRXss5AiAMtYLJDaLEzPrAWcZeeSgSIzbL+ecokmFKSDDcRske6QIgSMkHedwND1olF8vlKsJUGK3BcdtM8w4Xq7BpSBwsloE=
|
||||
# 客户端id
|
||||
VITE_GLOB_APP_CLIENT_ID=e5cd7e4891bf95d1d19206ce24a7b32e
|
||||
|
||||
# 开启SSE
|
||||
VITE_GLOB_SSE_ENABLE=true
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { defineConfig } from '@vben/vite-config';
|
||||
|
||||
// 自行取消注释来启用按需导入功能
|
||||
// import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
||||
// import Components from 'unplugin-vue-components/vite';
|
||||
|
||||
export default defineConfig(async () => {
|
||||
return {
|
||||
application: {},
|
||||
vite: {
|
||||
plugins: [
|
||||
// Components({
|
||||
// dirs: [], // 默认会导入src/components目录下所有组件 不需要
|
||||
// dts: './types/components.d.ts', // 输出类型文件
|
||||
// resolvers: [
|
||||
// AntDesignVueResolver({
|
||||
// // 需要排除Button组件 全局已经默认导入了
|
||||
// exclude: ['Button'],
|
||||
// importStyle: false, // css in js
|
||||
// }),
|
||||
// ],
|
||||
// }),
|
||||
],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
target: 'http://ruoyi-backend:6039',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,174 @@
|
||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
||||
spring.servlet.multipart.location: /ruoyi/server/temp
|
||||
|
||||
--- # 监控中心配置
|
||||
spring.boot.admin.client:
|
||||
# 增加客户端开关
|
||||
enabled: false
|
||||
url: http://localhost:9090/admin
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ruoyi
|
||||
password: 123456
|
||||
|
||||
--- # xxl-job 配置
|
||||
xxl.job:
|
||||
# 执行器开关
|
||||
enabled: false
|
||||
# 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
|
||||
admin-addresses: http://localhost:9100/xxl-job-admin
|
||||
# 执行器通讯TOKEN:非空时启用
|
||||
access-token: xxl-job
|
||||
executor:
|
||||
# 执行器AppName:执行器心跳注册分组依据;为空则关闭自动注册
|
||||
appname: xxl-job-executor
|
||||
# 执行器端口号 执行器从9101开始往后写
|
||||
port: 9101
|
||||
# 执行器注册:默认IP:PORT
|
||||
address:
|
||||
# 执行器IP:默认自动获取IP
|
||||
ip:
|
||||
# 执行器运行日志文件存储磁盘路径
|
||||
logpath: ./logs/xxl-job
|
||||
# 执行器日志文件保存天数:大于3生效
|
||||
logretentiondays: 30
|
||||
|
||||
--- # 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
# 动态数据源文档 https://www.kancloud.cn/tracy5546/dynamic-datasource/content
|
||||
dynamic:
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: false
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
# 严格模式 匹配不到数据源则报错
|
||||
strict: true
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://mysql:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
lazy: true
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://mysql:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username:
|
||||
password:
|
||||
# oracle:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: oracle.jdbc.OracleDriver
|
||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||
# username: ROOT
|
||||
# password: root
|
||||
# hikari:
|
||||
# connectionTestQuery: SELECT 1 FROM DUAL
|
||||
# postgres:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: org.postgresql.Driver
|
||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||
# username: root
|
||||
# password: root
|
||||
# sqlserver:
|
||||
# type: ${spring.datasource.type}
|
||||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||
# username: SA
|
||||
# password: root
|
||||
hikari:
|
||||
# 最大连接池数量
|
||||
maxPoolSize: 20
|
||||
# 最小空闲线程数量
|
||||
minIdle: 10
|
||||
# 配置获取连接等待超时的时间
|
||||
connectionTimeout: 30000
|
||||
# 校验超时时间
|
||||
validationTimeout: 5000
|
||||
# 空闲连接存活最大时间,默认10分钟
|
||||
idleTimeout: 600000
|
||||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||
maxLifetime: 1800000
|
||||
# 连接测试query(配置检测连接是否有效)
|
||||
connectionTestQuery: SELECT 1
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
|
||||
--- # redis 单机配置(单机与集群只能开启一个另一个需要注释掉)
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: redis
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码(如没有密码请注释掉)
|
||||
# password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启ssl
|
||||
ssl: false
|
||||
|
||||
redisson:
|
||||
# redis key前缀
|
||||
keyPrefix:
|
||||
# 线程池数量
|
||||
threads: 16
|
||||
# Netty线程池数量
|
||||
nettyThreads: 32
|
||||
# 单节点配置
|
||||
singleServerConfig:
|
||||
# 客户端名称
|
||||
clientName: ${ruoyi.name}
|
||||
# 最小空闲连接数
|
||||
connectionMinimumIdleSize: 32
|
||||
# 连接池大小
|
||||
connectionPoolSize: 64
|
||||
# 连接空闲超时,单位:毫秒
|
||||
idleConnectionTimeout: 10000
|
||||
# 命令等待超时,单位:毫秒
|
||||
timeout: 3000
|
||||
# 发布和订阅连接池大小
|
||||
subscriptionConnectionPoolSize: 50
|
||||
|
||||
--- # mail 邮件发送
|
||||
mail:
|
||||
enabled: false
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
# 是否需要用户名密码验证
|
||||
auth: true
|
||||
# 发送方,遵循RFC-822标准
|
||||
from: pengpan@163.com
|
||||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||
user: pengpan@163.com
|
||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
||||
pass: JXLAASWFNLNNAYJU
|
||||
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
||||
starttlsEnable: true
|
||||
# 使用SSL安全连接
|
||||
sslEnable: true
|
||||
# SMTP超时时长,单位毫秒,缺省值不超时
|
||||
timeout: 0
|
||||
# Socket连接超时值,单位毫秒,缺省值不超时
|
||||
connectionTimeout: 0
|
||||
|
||||
--- # sms 短信
|
||||
sms:
|
||||
enabled: false
|
||||
# 阿里云 dysmsapi.aliyuncs.com
|
||||
# 腾讯云 sms.tencentcloudapi.com
|
||||
endpoint: "dysmsapi.aliyuncs.com"
|
||||
accessKeyId: xxxxxxx
|
||||
accessKeySecret: xxxxxx
|
||||
signName: 测试
|
||||
# 腾讯专用
|
||||
sdkAppId:
|
||||
22
docker-deploy/build-docker-images/scripts/build-ruoyi-admin-image.sh
Executable file
22
docker-deploy/build-docker-images/scripts/build-ruoyi-admin-image.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/.env.analyze
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/.env.development
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/.env.production
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/.env.test
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/vite.config.mts
|
||||
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-admin/.env.analyze /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-admin/.env.development /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-admin/.env.production /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-admin/.env.test /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-admin/vite.config.mts /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/
|
||||
|
||||
docker run --rm --name build-ruoyi-ai-admin -v /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin:/app -w /app node:20 bash -c "npm install -g pnpm && pnpm install && pnpm build"
|
||||
|
||||
rm -f /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-admin/dist.zip
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-admin/apps/web-antd/dist.zip /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-admin/
|
||||
cd /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-admin/
|
||||
rm -rf dist
|
||||
unzip dist.zip -d dist
|
||||
rm -f dist.zip
|
||||
docker build -t ruoyi-ai-admin:v2.0.5 .
|
||||
8
docker-deploy/build-docker-images/scripts/build-ruoyi-backend-image.sh
Executable file
8
docker-deploy/build-docker-images/scripts/build-ruoyi-backend-image.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
rm -f /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/ruoyi-admin/src/main/resources/application-prod.yml
|
||||
cp /root/ruoyi-ai-docker/build-docker-images/modify-source-code/ruoyi-ai-backend/application-prod.yml /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/ruoyi-admin/src/main/resources/application-prod.yml
|
||||
docker run --rm --name build-ruoyi-ai-backend -v /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend:/app -w /app maven:3.9.9-eclipse-temurin-17-alpine bash -c "mvn clean package -Pprod"
|
||||
rm -f /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-backend/ruoyi-admin.jar
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/ruoyi-admin/target/ruoyi-admin.jar /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-backend/
|
||||
cd /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-backend/
|
||||
docker build -t ruoyi-ai-backend:v2.0.5 .
|
||||
6
docker-deploy/build-docker-images/scripts/build-ruoyi-web-image.sh
Executable file
6
docker-deploy/build-docker-images/scripts/build-ruoyi-web-image.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
docker run --rm --name build-ruoyi-ai-web -v /root/ruoyi-ai-docker/source-code/ruoyi-ai-web:/app -w /app node:20 bash -c "npm install -g pnpm && pnpm install && pnpm approve-builds && pnpm build"
|
||||
rm -rf /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-web/dist
|
||||
cp -pr /root/ruoyi-ai-docker/source-code/ruoyi-ai-web/dist /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-web/
|
||||
cd /root/ruoyi-ai-docker/build-docker-images/Dockerfile-Resources/ruoyi-ai-web/
|
||||
docker build -t ruoyi-ai-web:v2.0.5 .
|
||||
2
docker-deploy/build-docker-images/scripts/remove-blank.sh
Executable file
2
docker-deploy/build-docker-images/scripts/remove-blank.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sed -i 's/[ \t]*$//' filename
|
||||
37
docker-deploy/deploy/.env
Normal file
37
docker-deploy/deploy/.env
Normal file
@@ -0,0 +1,37 @@
|
||||
# Timezone
|
||||
TZ=Asia/Shanghai
|
||||
|
||||
# MySQL Configuration
|
||||
MYSQL_ROOT_PASSWORD=root
|
||||
MYSQL_DATABASE=ruoyi-ai
|
||||
MYSQL_PORT=3306
|
||||
|
||||
# Redis Configuration
|
||||
REDIS_PORT=6379
|
||||
REDIS_PASSWORD=
|
||||
REDIS_DATABASE=0
|
||||
REDIS_TIMEOUT=10s
|
||||
|
||||
# Weaviate Configuration
|
||||
WEAVIATE_QUERY_LIMIT=25
|
||||
WEAVIATE_ANONYMOUS_ACCESS=true
|
||||
WEAVIATE_DATA_PATH=/var/lib/weaviate
|
||||
WEAVIATE_VECTORIZER_MODULE=none
|
||||
WEAVIATE_MODULES=text2vec-cohere,text2vec-huggingface,text2vec-palm,text2vec-openai,generative-openai,generative-cohere,generative-palm,ref2vec-centroid,reranker-cohere,qna-openai
|
||||
WEAVIATE_CLUSTER_HOSTNAME=node1
|
||||
WEAVIATE_PROTOCOL=http
|
||||
WEAVIATE_HOST=weaviate:8080
|
||||
WEAVIATE_CLASSNAME=LocalKnowledge
|
||||
|
||||
# Backend Configuration
|
||||
BACKEND_SERVER_PORT=6039
|
||||
DB_URL=jdbc:mysql://mysql:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=root
|
||||
REDIS_HOST=redis
|
||||
|
||||
# Admin Configuration
|
||||
ADMIN_SERVER_PORT=8082
|
||||
|
||||
# Web Configuration
|
||||
WEB_SERVER_PORT=8081
|
||||
6
docker-deploy/deploy/copy-mysql-init-script.sh
Executable file
6
docker-deploy/deploy/copy-mysql-init-script.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
rm -f /root/ruoyi-ai-docker/deploy/mysql-init/*.sql
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/script/sql/ruoyi-ai.sql /root/ruoyi-ai-docker/deploy/mysql-init/01_ruoyi-ai.sql
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/script/sql/update/20250407.sql /root/ruoyi-ai-docker/deploy/mysql-init/02_update_20250407.sql
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/script/sql/update/20250505.sql /root/ruoyi-ai-docker/deploy/mysql-init/03_update_20250505.sql
|
||||
cp /root/ruoyi-ai-docker/source-code/ruoyi-ai-backend/script/sql/update/20250509.sql /root/ruoyi-ai-docker/deploy/mysql-init/04_update_20250509.sql
|
||||
105
docker-deploy/deploy/docker-compose.yaml
Normal file
105
docker-deploy/deploy/docker-compose.yaml
Normal file
@@ -0,0 +1,105 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.0.33
|
||||
container_name: ruoyi-ai-mysql
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||
#ports:
|
||||
# - "${MYSQL_PORT}:3306"
|
||||
volumes:
|
||||
- ./mysql-init:/docker-entrypoint-initdb.d
|
||||
- ./data/mysql:/var/lib/mysql
|
||||
command:
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
--explicit_defaults_for_timestamp=true
|
||||
--lower_case_table_names=1
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
redis:
|
||||
image: redis:6.2
|
||||
container_name: ruoyi-ai-redis
|
||||
env_file:
|
||||
- ./.env
|
||||
#ports:
|
||||
# - "${REDIS_PORT}:6379"
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
weaviate:
|
||||
image: semitechnologies/weaviate:1.30.0
|
||||
container_name: ruoyi-ai-weaviate
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- QUERY_DEFAULTS_LIMIT=${WEAVIATE_QUERY_LIMIT}
|
||||
- AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=${WEAVIATE_ANONYMOUS_ACCESS}
|
||||
- PERSISTENCE_DATA_PATH=${WEAVIATE_DATA_PATH}
|
||||
- DEFAULT_VECTORIZER_MODULE=${WEAVIATE_VECTORIZER_MODULE}
|
||||
- ENABLE_MODULES=${WEAVIATE_MODULES}
|
||||
- CLUSTER_HOSTNAME=${WEAVIATE_CLUSTER_HOSTNAME}
|
||||
command: --host 0.0.0.0 --port 8080 --scheme http
|
||||
ports:
|
||||
- "50050:8080"
|
||||
- "50051:50051"
|
||||
volumes:
|
||||
- ./data/weaviate:/var/lib/weaviate
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-backend:
|
||||
image: ruoyi-ai-backend:v2.0.5
|
||||
container_name: ruoyi-ai-backend
|
||||
env_file:
|
||||
- ./.env
|
||||
ports:
|
||||
- "${BACKEND_SERVER_PORT}:${BACKEND_SERVER_PORT}"
|
||||
volumes:
|
||||
- ./data/logs:/ruoyi/server/logs
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-admin:
|
||||
image: ruoyi-ai-admin:v2.0.5
|
||||
container_name: ruoyi-ai-admin
|
||||
ports:
|
||||
#- "8082:80"
|
||||
- "${ADMIN_SERVER_PORT}:80"
|
||||
restart: always
|
||||
depends_on:
|
||||
- ruoyi-backend
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-web:
|
||||
image: ruoyi-ai-web:v2.0.5
|
||||
container_name: ruoyi-ai-web
|
||||
ports:
|
||||
#- "8081:80"
|
||||
- "${WEB_SERVER_PORT}:80"
|
||||
restart: always
|
||||
depends_on:
|
||||
- ruoyi-backend
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
networks:
|
||||
ruoyi-net:
|
||||
driver: bridge
|
||||
2687
docker-deploy/deploy/mysql-init/01_ruoyi-ai.sql
Normal file
2687
docker-deploy/deploy/mysql-init/01_ruoyi-ai.sql
Normal file
File diff suppressed because it is too large
Load Diff
4
docker-deploy/deploy/mysql-init/02_update_20250407.sql
Normal file
4
docker-deploy/deploy/mysql-init/02_update_20250407.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907575746601119746, '000000', 'vector', 'text-embedding-3-small', 'text-embedding-3-small', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'sk-cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:27:54', 1, '2025-04-03 07:27:54', 'text-embedding-3-small');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576007017066497, '000000', 'vector', 'quentinz/bge-large-zh-v1.5', 'bge-large-zh-v1.5', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:28:56', 1, '2025-04-03 07:28:56', 'bge-large-zh-v1.5');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576806191362049, '000000', 'vector', 'nomic-embed-text', 'nomic-embed-text', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'nomic-embed-text', 103, 1, '2025-04-03 07:32:06', 1, '2025-04-03 07:32:06', 'nomic-embed-text');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907577073490161665, '000000', 'vector', 'snowflake-arctic-embed', 'snowflake-arctic-embed', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'snowflake-arctic-embed', 103, 1, '2025-04-03 07:33:10', 1, '2025-04-03 07:33:10', 'snowflake-arctic-embed');
|
||||
42
docker-deploy/deploy/mysql-init/03_update_20250505.sql
Normal file
42
docker-deploy/deploy/mysql-init/03_update_20250505.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 129.211.24.7
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50744
|
||||
Source Host : 129.211.24.7:3306
|
||||
Source Schema : ry-vue
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50744
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 05/05/2025 15:01:08
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for chat_session
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `chat_session`;
|
||||
CREATE TABLE `chat_session` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
|
||||
`session_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会话标题',
|
||||
`session_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '会话内容',
|
||||
`create_dept` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门',
|
||||
`create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会话管理' ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
ALTER TABLE `chat_message`
|
||||
ADD COLUMN `session_id` bigint(20) NULL COMMENT '会话id' AFTER `id`;
|
||||
|
||||
4
docker-deploy/deploy/mysql-init/04_update_20250509.sql
Normal file
4
docker-deploy/deploy/mysql-init/04_update_20250509.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `chat_model`
|
||||
ADD COLUMN `api_url` varchar(50) NULL COMMENT '请求后缀' AFTER `api_key`;
|
||||
|
||||
INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1779450794872414211, 'chat', 'apiUrl', 'v1/chat/completions', 'API 请求后缀', 103, '2024-04-14 18:05:05', '1', '1', '2025-04-23 22:29:04', NULL, NULL, '0', NULL, 0);
|
||||
2
docker-deploy/deploy/update_ruoyi-qi-sql.sh
Executable file
2
docker-deploy/deploy/update_ruoyi-qi-sql.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sed -i 's#127.0.0.1:6038#weaviate:8080#g' ./mysql-init/01_ruoyi-ai.sql
|
||||
519
docker-deploy/one-step-script/deploy-cn.sh
Executable file
519
docker-deploy/one-step-script/deploy-cn.sh
Executable file
File diff suppressed because it is too large
Load Diff
519
docker-deploy/one-step-script/deploy-en.sh
Executable file
519
docker-deploy/one-step-script/deploy-en.sh
Executable file
File diff suppressed because it is too large
Load Diff
2687
docker-deploy/one-step-script/mysql-init/01_ruoyi-ai.sql
Normal file
2687
docker-deploy/one-step-script/mysql-init/01_ruoyi-ai.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907575746601119746, '000000', 'vector', 'text-embedding-3-small', 'text-embedding-3-small', 0, '2', '0', NULL, 'https://api.pandarobot.chat/', 'sk-cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:27:54', 1, '2025-04-03 07:27:54', 'text-embedding-3-small');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576007017066497, '000000', 'vector', 'quentinz/bge-large-zh-v1.5', 'bge-large-zh-v1.5', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'cdBlIaZcufccm2RaDe547cBd054d49C7B0782eCa72A0052b', 103, 1, '2025-04-03 07:28:56', 1, '2025-04-03 07:28:56', 'bge-large-zh-v1.5');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907576806191362049, '000000', 'vector', 'nomic-embed-text', 'nomic-embed-text', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'nomic-embed-text', 103, 1, '2025-04-03 07:32:06', 1, '2025-04-03 07:32:06', 'nomic-embed-text');
|
||||
INSERT INTO `chat_model` (`id`, `tenant_id`, `category`, `model_name`, `model_describe`, `model_price`, `model_type`, `model_show`, `system_prompt`, `api_host`, `api_key`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (1907577073490161665, '000000', 'vector', 'snowflake-arctic-embed', 'snowflake-arctic-embed', 0, '2', '0', NULL, 'http://127.0.0.1:11434/', 'snowflake-arctic-embed', 103, 1, '2025-04-03 07:33:10', 1, '2025-04-03 07:33:10', 'snowflake-arctic-embed');
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : 129.211.24.7
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50744
|
||||
Source Host : 129.211.24.7:3306
|
||||
Source Schema : ry-vue
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50744
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 05/05/2025 15:01:08
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for chat_session
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `chat_session`;
|
||||
CREATE TABLE `chat_session` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键',
|
||||
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
|
||||
`session_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会话标题',
|
||||
`session_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '会话内容',
|
||||
`create_dept` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门',
|
||||
`create_by` bigint(20) NULL DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) NULL DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
|
||||
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '会话管理' ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
|
||||
ALTER TABLE `chat_message`
|
||||
ADD COLUMN `session_id` bigint(20) NULL COMMENT '会话id' AFTER `id`;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE `chat_model`
|
||||
ADD COLUMN `api_url` varchar(50) NULL COMMENT '请求后缀' AFTER `api_key`;
|
||||
|
||||
INSERT INTO `chat_config` (`id`, `category`, `config_name`, `config_value`, `config_dict`, `create_dept`, `create_time`, `create_by`, `update_by`, `update_time`, `remark`, `version`, `del_flag`, `update_ip`, `tenant_id`) VALUES (1779450794872414211, 'chat', 'apiUrl', 'v1/chat/completions', 'API 请求后缀', 103, '2024-04-14 18:05:05', '1', '1', '2025-04-23 22:29:04', NULL, NULL, '0', NULL, 0);
|
||||
50
docker-deploy/one-step-script/template/.env.template
Normal file
50
docker-deploy/one-step-script/template/.env.template
Normal file
@@ -0,0 +1,50 @@
|
||||
# Timezone
|
||||
TZ={{TZ}}
|
||||
|
||||
# MySQL Configuration
|
||||
MYSQL_ROOT_PASSWORD={{MYSQL_ROOT_PASSWORD}}
|
||||
MYSQL_DATABASE={{MYSQL_DATABASE}}
|
||||
MYSQL_PORT={{MYSQL_PORT}}
|
||||
|
||||
# Redis Configuration
|
||||
REDIS_PORT={{REDIS_PORT}}
|
||||
REDIS_PASSWORD={{REDIS_PASSWORD}}
|
||||
REDIS_DATABASE={{REDIS_DATABASE}}
|
||||
REDIS_TIMEOUT={{REDIS_TIMEOUT}}
|
||||
|
||||
# Backend Configuration
|
||||
SERVER_PORT={{SERVER_PORT}}
|
||||
DB_URL=jdbc:mysql://mysql:3306/{{MYSQL_DATABASE}}?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
DB_USERNAME={{DB_USERNAME}}
|
||||
DB_PASSWORD={{DB_PASSWORD}}
|
||||
REDIS_HOST=redis
|
||||
BACKEND_HOST={{BACKEND_HOST}}
|
||||
|
||||
# Frontend Configuration
|
||||
ADMIN_PORT={{ADMIN_PORT}}
|
||||
WEB_PORT={{WEB_PORT}}
|
||||
FRONTEND_API_BASE_URL={{FRONTEND_API_BASE_URL}}
|
||||
FRONTEND_DEV_PORT={{FRONTEND_DEV_PORT}}
|
||||
|
||||
# Weaviate Configuration
|
||||
WEAVIATE_HTTP_PORT={{WEAVIATE_HTTP_PORT}}
|
||||
WEAVIATE_GRPC_PORT={{WEAVIATE_GRPC_PORT}}
|
||||
WEAVIATE_QUERY_LIMIT={{WEAVIATE_QUERY_LIMIT}}
|
||||
WEAVIATE_ANONYMOUS_ACCESS={{WEAVIATE_ANONYMOUS_ACCESS}}
|
||||
WEAVIATE_DATA_PATH={{WEAVIATE_DATA_PATH}}
|
||||
WEAVIATE_VECTORIZER_MODULE={{WEAVIATE_VECTORIZER_MODULE}}
|
||||
WEAVIATE_MODULES={{WEAVIATE_MODULES}}
|
||||
WEAVIATE_CLUSTER_HOSTNAME={{WEAVIATE_CLUSTER_HOSTNAME}}
|
||||
WEAVIATE_PROTOCOL={{WEAVIATE_PROTOCOL}}
|
||||
WEAVIATE_HOST=weaviate:8080
|
||||
WEAVIATE_CLASSNAME={{WEAVIATE_CLASSNAME}}
|
||||
|
||||
# Production Configuration
|
||||
PROD_DB_URL={{PROD_DB_URL}}
|
||||
PROD_DB_USERNAME={{PROD_DB_USERNAME}}
|
||||
PROD_DB_PASSWORD={{PROD_DB_PASSWORD}}
|
||||
PROD_REDIS_HOST={{PROD_REDIS_HOST}}
|
||||
PROD_REDIS_PORT={{PROD_REDIS_PORT}}
|
||||
PROD_REDIS_DATABASE={{PROD_REDIS_DATABASE}}
|
||||
PROD_REDIS_PASSWORD={{PROD_REDIS_PASSWORD}}
|
||||
PROD_REDIS_TIMEOUT={{PROD_REDIS_TIMEOUT}}
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
dynamic:
|
||||
# 性能分析插件(有性能损耗 不建议生产环境使用)
|
||||
p6spy: false
|
||||
# 设置默认的数据源或者数据源组,默认值即为 master
|
||||
primary: master
|
||||
# 严格模式 匹配不到数据源则报错
|
||||
strict: true
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: {{PROD_DB_URL}}
|
||||
username: {{PROD_DB_USERNAME}}
|
||||
password: {{PROD_DB_PASSWORD}}
|
||||
hikari:
|
||||
# 最大连接池数量
|
||||
maxPoolSize: 20
|
||||
# 最小空闲线程数量
|
||||
minIdle: 10
|
||||
# 配置获取连接等待超时的时间
|
||||
connectionTimeout: 30000
|
||||
# 校验超时时间
|
||||
validationTimeout: 5000
|
||||
# 空闲连接存活最大时间,默认10分钟
|
||||
idleTimeout: 600000
|
||||
# 此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认30分钟
|
||||
maxLifetime: 1800000
|
||||
# 连接测试query(配置检测连接是否有效)
|
||||
connectionTestQuery: SELECT 1
|
||||
# 多久检查一次连接的活性
|
||||
keepaliveTime: 30000
|
||||
|
||||
--- # redis 单机配置
|
||||
spring.data:
|
||||
redis:
|
||||
# 地址
|
||||
host: {{PROD_REDIS_HOST}}
|
||||
# 端口,默认为6379
|
||||
port: {{PROD_REDIS_PORT}}
|
||||
# 数据库索引
|
||||
database: {{PROD_REDIS_DATABASE}}
|
||||
# 密码
|
||||
password: {{PROD_REDIS_PASSWORD}}
|
||||
# 连接超时时间
|
||||
timeout: {{PROD_REDIS_TIMEOUT}}
|
||||
# 是否开启ssl
|
||||
ssl: false
|
||||
|
||||
# 日志配置
|
||||
logging:
|
||||
level:
|
||||
org.ruoyi: info
|
||||
org.springframework: warn
|
||||
config: classpath:logback-plus.xml
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token有效期 设为7天 (必定过期) 单位: 秒
|
||||
timeout: 604800
|
||||
# token临时有效期 (指定时间无操作就过期) 单位: 秒
|
||||
activity-timeout: 604800
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# 是否尝试从header里读取token
|
||||
is-read-header: true
|
||||
# 是否尝试从cookie里读取token
|
||||
is-read-cookie: false
|
||||
# token前缀
|
||||
token-prefix: "Bearer"
|
||||
# jwt秘钥
|
||||
jwt-secret-key: abcdefghijklmnopqrstuvwxyz
|
||||
|
||||
# websocket
|
||||
websocket:
|
||||
enabled: true
|
||||
# 路径
|
||||
path: '/resource/websocket'
|
||||
# 设置访问源地址
|
||||
allowedOrigins: '*'
|
||||
@@ -0,0 +1,115 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/breeze-project/mysql:8.0.33
|
||||
container_name: ruoyi-ai-mysql
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD={{MYSQL_ROOT_PASSWORD}}
|
||||
- MYSQL_DATABASE={{MYSQL_DATABASE}}
|
||||
ports:
|
||||
- "{{MYSQL_PORT}}:3306"
|
||||
volumes:
|
||||
- ./mysql-init:/docker-entrypoint-initdb.d
|
||||
- ./data/mysql:/var/lib/mysql
|
||||
command:
|
||||
--default-authentication-plugin=mysql_native_password
|
||||
--character-set-server=utf8mb4
|
||||
--collation-server=utf8mb4_general_ci
|
||||
--explicit_defaults_for_timestamp=true
|
||||
--lower_case_table_names=1
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
redis:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/breeze-project/redis:6.2
|
||||
container_name: ruoyi-ai-redis
|
||||
env_file:
|
||||
- ./.env
|
||||
ports:
|
||||
- "{{REDIS_PORT}}:6379"
|
||||
volumes:
|
||||
- ./data/redis:/data
|
||||
command: redis-server --appendonly yes ${REDIS_PASSWORD:+--requirepass ${REDIS_PASSWORD}}
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
weaviate:
|
||||
image: registry.cn-shenzhen.aliyuncs.com/breeze-project/weaviate:1.30.0
|
||||
container_name: ruoyi-ai-weaviate
|
||||
ports:
|
||||
- "{{WEAVIATE_HTTP_PORT}}:8080"
|
||||
- "{{WEAVIATE_GRPC_PORT}}:50051"
|
||||
volumes:
|
||||
- ./data/weaviate:/var/lib/weaviate
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- QUERY_DEFAULTS_LIMIT={{WEAVIATE_QUERY_LIMIT}}
|
||||
- AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED={{WEAVIATE_ANONYMOUS_ACCESS}}
|
||||
- PERSISTENCE_DATA_PATH={{WEAVIATE_DATA_PATH}}
|
||||
- DEFAULT_VECTORIZER_MODULE={{WEAVIATE_VECTORIZER_MODULE}}
|
||||
- ENABLE_MODULES={{WEAVIATE_MODULES}}
|
||||
- CLUSTER_HOSTNAME={{WEAVIATE_CLUSTER_HOSTNAME}}
|
||||
command: --host 0.0.0.0 --port 8080 --scheme http
|
||||
restart: always
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-backend:
|
||||
image: ruoyi-ai-backend:latest
|
||||
container_name: ruoyi-ai-backend
|
||||
env_file:
|
||||
- ./.env
|
||||
ports:
|
||||
- "{{SERVER_PORT}}:{{SERVER_PORT}}"
|
||||
environment:
|
||||
- SERVER_PORT={{SERVER_PORT}}
|
||||
- DB_URL={{DB_URL}}
|
||||
- DB_USERNAME={{DB_USERNAME}}
|
||||
- DB_PASSWORD={{DB_PASSWORD}}
|
||||
- REDIS_HOST={{REDIS_HOST}}
|
||||
- REDIS_PORT={{REDIS_PORT}}
|
||||
- REDIS_DATABASE={{REDIS_DATABASE}}
|
||||
- REDIS_PASSWORD={{REDIS_PASSWORD}}
|
||||
- REDIS_TIMEOUT={{REDIS_TIMEOUT}}
|
||||
- TZ={{TZ}}
|
||||
volumes:
|
||||
- ./data/logs:/ruoyi/server/logs
|
||||
restart: always
|
||||
depends_on:
|
||||
- mysql
|
||||
- redis
|
||||
- weaviate
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-admin:
|
||||
image: ruoyi-ai-admin:latest
|
||||
container_name: ruoyi-ai-admin
|
||||
ports:
|
||||
- "{{ADMIN_PORT}}:80"
|
||||
restart: always
|
||||
depends_on:
|
||||
- ruoyi-backend
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
ruoyi-web:
|
||||
image: ruoyi-ai-web:latest
|
||||
container_name: ruoyi-ai-web
|
||||
ports:
|
||||
- "{{WEB_PORT}}:80"
|
||||
restart: always
|
||||
depends_on:
|
||||
- ruoyi-backend
|
||||
networks:
|
||||
- ruoyi-net
|
||||
|
||||
networks:
|
||||
ruoyi-net:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /prod-api/ {
|
||||
proxy_pass http://{{BACKEND_HOST}}:{{SERVER_PORT}}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://{{BACKEND_HOST}}:{{SERVER_PORT}}/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
4
docker-deploy/source-code/fetch-admin-source-code.sh
Executable file
4
docker-deploy/source-code/fetch-admin-source-code.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
rm -rf ruoyi-ai-admin
|
||||
git clone https://github.com/ageerle/ruoyi-admin
|
||||
mv ruoyi-admin ruoyi-ai-admin
|
||||
7
docker-deploy/source-code/fetch-backend-source-code.sh
Executable file
7
docker-deploy/source-code/fetch-backend-source-code.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
rm -rf ruoyi-ai-backend
|
||||
git clone https://github.com/ageerle/ruoyi-ai
|
||||
mv ruoyi-ai ruoyi-ai-backend
|
||||
cd ruoyi-ai-backend
|
||||
# git checkout v2.0.4
|
||||
# cd ..
|
||||
4
docker-deploy/source-code/fetch-web-source-code.sh
Executable file
4
docker-deploy/source-code/fetch-web-source-code.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
rm -rf ruoyi-ai-web
|
||||
git clone https://github.com/ageerle/ruoyi-web
|
||||
mv ruoyi-web ruoyi-ai-web
|
||||
@@ -3,6 +3,8 @@ package org.ruoyi;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
@@ -10,6 +12,8 @@ import org.springframework.boot.context.metrics.buffering.BufferingApplicationSt
|
||||
* @author Lion Li
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
@EnableAsync
|
||||
public class RuoYiAIApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -94,3 +94,11 @@ sms:
|
||||
# 腾讯专用
|
||||
sdkAppId:
|
||||
|
||||
pdf:
|
||||
extract:
|
||||
service:
|
||||
url: http://localhost:8080
|
||||
ai-api:
|
||||
url: https://api.pandarobot.chat/v1/chat/completions
|
||||
key: sk-xxxx
|
||||
|
||||
|
||||
@@ -172,3 +172,11 @@ sms:
|
||||
signName: 测试
|
||||
# 腾讯专用
|
||||
sdkAppId:
|
||||
|
||||
pdf:
|
||||
extract:
|
||||
service:
|
||||
url: http://localhost:8080
|
||||
ai-api:
|
||||
url: https://api.pandarobot.chat/v1/chat/completions
|
||||
key: sk-XXXXXX
|
||||
@@ -67,6 +67,12 @@ public class ChatRequest {
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 对话角色
|
||||
*/
|
||||
private String role;
|
||||
|
||||
|
||||
/**
|
||||
* 上下文的条数
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 获取所有Url配置
|
||||
@@ -19,23 +20,24 @@ import java.util.regex.Pattern;
|
||||
@Data
|
||||
public class AllUrlHandler implements InitializingBean {
|
||||
|
||||
private static final Pattern PATTERN = Pattern.compile("\\{(.*?)\\}");
|
||||
|
||||
private List<String> urls = new ArrayList<>();
|
||||
private List<String> urls = new ArrayList<>(256);
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
Set<String> set = new HashSet<>();
|
||||
RequestMappingHandlerMapping mapping = SpringUtils.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class);
|
||||
Map<RequestMappingInfo, HandlerMethod> map = mapping.getHandlerMethods();
|
||||
map.keySet().forEach(info -> {
|
||||
// 获取注解上边的 path 替代 path variable 为 *
|
||||
if(info.getPathPatternsCondition()!=null){
|
||||
Objects.requireNonNull(info.getPathPatternsCondition().getPatterns())
|
||||
.forEach(url -> set.add(ReUtil.replaceAll(url.getPatternString(), PATTERN, "*")));
|
||||
}
|
||||
});
|
||||
urls.addAll(set);
|
||||
String name = "requestMappingHandlerMapping";
|
||||
RequestMappingHandlerMapping mapping = SpringUtils.getBean(name, RequestMappingHandlerMapping.class);
|
||||
|
||||
Map<RequestMappingInfo, HandlerMethod> handlerMethods = mapping.getHandlerMethods();
|
||||
|
||||
Pattern pattern = Pattern.compile("\\{(.*?)\\}");
|
||||
|
||||
Set<String> handlerSet = handlerMethods.keySet().stream()
|
||||
.flatMap(info -> info.getPatternsCondition().getPatterns().stream())
|
||||
.collect(Collectors.toSet());
|
||||
|
||||
// 获取注解上边的 path 替代 path variable 为 *
|
||||
handlerSet.stream().map(path -> ReUtil.replaceAll(path, pattern, "*"))
|
||||
.forEach(item -> urls.add(item));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ public class ChatMessageBo extends BaseEntity {
|
||||
/**
|
||||
* 会话id
|
||||
*/
|
||||
@NotBlank(message = "会话id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long sessionId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,13 +29,11 @@ public class ChatSessionBo extends BaseEntity {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 会话标题
|
||||
*/
|
||||
@NotBlank(message = "会话标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String sessionTitle;
|
||||
|
||||
/**
|
||||
@@ -47,7 +45,6 @@ public class ChatSessionBo extends BaseEntity {
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@ import java.math.BigDecimal;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.ruoyi.domain.ChatMessage;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
@@ -83,4 +84,11 @@ public class ChatMessageVo implements Serializable {
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.ruoyi.service.impl;
|
||||
|
||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||
import org.ruoyi.common.core.utils.StringUtils;
|
||||
import org.ruoyi.common.satoken.utils.LoginHelper;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -45,6 +46,10 @@ public class ChatMessageServiceImpl implements IChatMessageService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ChatMessageVo> queryPageList(ChatMessageBo bo, PageQuery pageQuery) {
|
||||
if(!LoginHelper.isLogin()){
|
||||
return TableDataInfo.build();
|
||||
}
|
||||
bo.setUserId(LoginHelper.getUserId());
|
||||
LambdaQueryWrapper<ChatMessage> lqw = buildQueryWrapper(bo);
|
||||
Page<ChatMessageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
@@ -64,9 +69,8 @@ public class ChatMessageServiceImpl implements IChatMessageService {
|
||||
LambdaQueryWrapper<ChatMessage> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getUserId() != null, ChatMessage::getUserId, bo.getUserId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), ChatMessage::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRole()), ChatMessage::getRole, bo.getRole());
|
||||
lqw.eq(bo.getDeductCost() != null, ChatMessage::getDeductCost, bo.getDeductCost());
|
||||
lqw.eq(bo.getTotalTokens() != null, ChatMessage::getTotalTokens, bo.getTotalTokens());
|
||||
lqw.eq(bo.getSessionId() != null, ChatMessage::getSessionId, bo.getSessionId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRole()), ChatMessage::getRole, bo.getRole());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getModelName()), ChatMessage::getModelName, bo.getModelName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,10 @@
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.17.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user