Compare commits
134 Commits
v2.0.2
...
951524bff7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
1a178d0ef8 | ||
|
|
b64b758263 | ||
|
|
a68c6481ba | ||
|
|
3cbacb5ed9 | ||
|
|
38667797d3 | ||
|
|
9a6acb84a4 | ||
|
|
e3c8a84849 | ||
|
|
cc349f5954 | ||
|
|
e4b78e0510 | ||
|
|
15c6cd272e | ||
|
|
1614eff008 | ||
|
|
c86e88ebd1 | ||
|
|
39ebd85f58 | ||
|
|
bde82fe516 | ||
|
|
2ca650db76 | ||
|
|
e3da640737 | ||
|
|
e1dea1d9e2 | ||
|
|
84b8d6f675 | ||
|
|
8563428bf9 | ||
|
|
7b3b727c0e | ||
|
|
08098ff3f3 | ||
|
|
fb492d41f3 | ||
|
|
9c2586ab43 | ||
|
|
1bddf5df3b | ||
|
|
57b2f833f8 | ||
|
|
7907cbeb7f | ||
|
|
9cfcdd2b9b | ||
|
|
980df20752 | ||
|
|
aa92d232bb | ||
|
|
81c0bb5738 | ||
|
|
1a645c6e10 | ||
|
|
731f6ceb6e | ||
|
|
8e21245348 | ||
|
|
936e157e4a | ||
|
|
256f72c487 | ||
|
|
009aa5f1a5 | ||
|
|
d22d2cb708 | ||
|
|
59104028b6 | ||
|
|
c2f6a8321a | ||
|
|
5476a4b0b7 | ||
|
|
cd490aa0e5 | ||
|
|
b1ff44df4b | ||
|
|
dc6d00f0fc | ||
|
|
990da8da6f | ||
|
|
8fc7ad0359 | ||
|
|
8a89d9eb9c | ||
|
|
abfa9ae97b | ||
|
|
bde2e8ff8e | ||
|
|
4d8eb1850f | ||
|
|
5aaa3a5662 | ||
|
|
8fec96f5b2 | ||
|
|
15c306eca2 | ||
|
|
620ea1fc76 | ||
|
|
c5c375dc6d | ||
|
|
1b793e822a | ||
|
|
6281840f36 | ||
|
|
f5daa7eb78 | ||
|
|
52cb563383 | ||
|
|
69efc3261e | ||
|
|
fb19fb29cc | ||
|
|
9f257cf712 | ||
|
|
4af26fe4b4 | ||
|
|
ab2a118ee9 | ||
|
|
9cd97a4dc5 | ||
|
|
788b372e32 | ||
|
|
744f9b6c7f | ||
|
|
761d954ef1 | ||
|
|
d1006f50ad | ||
|
|
f24ff5bbdd | ||
|
|
a4314dbbde | ||
|
|
188dc1e55e | ||
|
|
731352fd04 | ||
|
|
4b53939002 | ||
|
|
b50c15755d | ||
|
|
0dc6262b39 | ||
|
|
9b32e3b3b2 | ||
|
|
37a8b7dad3 | ||
|
|
efeb0bd6fb | ||
|
|
af33040117 | ||
|
|
ac4c037634 | ||
|
|
9734ec53f7 | ||
|
|
2b8a92c7d6 | ||
|
|
adb4538317 | ||
|
|
2509099146 | ||
|
|
3be9005f95 | ||
|
|
be6d027cad | ||
|
|
3d679f8749 | ||
|
|
5a5a48e153 | ||
|
|
e5da648941 | ||
|
|
d2755f00bc | ||
|
|
09abc0b5af | ||
|
|
00f362acf1 | ||
|
|
65d479458e | ||
|
|
57e17e0dda | ||
|
|
691d1735fc | ||
|
|
360984bc4b | ||
|
|
0153f004f4 | ||
|
|
cc23508527 | ||
|
|
c884f4f2d3 | ||
|
|
fab6de1f5c | ||
|
|
c02f66636d | ||
|
|
c1162148b1 | ||
|
|
f76fdbf3ad | ||
|
|
feca08b3ec | ||
|
|
72675b17c4 | ||
|
|
9ea5186f49 | ||
|
|
d0a2eadc38 |
2
.gitignore
vendored
@@ -13,6 +13,8 @@ target/
|
|||||||
|
|
||||||
ruoyi-modules/ruoyi-generator/src/main/resources/vm/vben5
|
ruoyi-modules/ruoyi-generator/src/main/resources/vm/vben5
|
||||||
|
|
||||||
|
README.md
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# IDE
|
# IDE
|
||||||
|
|
||||||
|
|||||||
153
README.md
@@ -34,50 +34,94 @@
|
|||||||
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
## 快速启动
|
||||||
|
|
||||||
|
1. **克隆项目**
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/alanpeng/ruoyi-ai-docker-deploy
|
||||||
|
cd ruoyi-ai-docker-deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **启动全套应用**
|
||||||
|
```bash
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **访问应用界面**
|
||||||
|
- 用户界面:`http://your-server-ip:8081`
|
||||||
|
- 管理员界面:`http://your-server-ip:8082`
|
||||||
|
|
||||||
## 目录
|
## 目录
|
||||||
|
|
||||||
|
- [系统体验](#系统体验)
|
||||||
- [源码地址](#源码地址)
|
- [源码地址](#源码地址)
|
||||||
- [特色功能](#特色功能)
|
- [配套文档](#项目文档)
|
||||||
|
- [核心功能](#核心功能)
|
||||||
- [项目演示](#项目演示)
|
- [项目演示](#项目演示)
|
||||||
- [后台管理](#后台管理)
|
- [管理端](#管理端)
|
||||||
- [用户端](#用户端)
|
- [用户端](#用户端)
|
||||||
- [小程序端](#小程序端)
|
- [小程序端](#小程序端)
|
||||||
- [开发前的配置要求](#开发前的配置要求)
|
- [开发环境](#开发环境)
|
||||||
- [文件目录说明](#文件目录说明)
|
- [项目结构](#项目结构)
|
||||||
- [使用到的框架](#使用到的框架)
|
- [ruoyi-ai](#ruoyi-ai)
|
||||||
|
- [注意事项](#注意事项)
|
||||||
|
- [vben模板](#vben模板)
|
||||||
- [贡献者](#贡献者)
|
- [贡献者](#贡献者)
|
||||||
- [如何参与开源项目](#如何参与开源项目)
|
- [如何参与开源项目](#如何参与开源项目)
|
||||||
- [版本控制](#版本控制)
|
- [版本控制](#版本控制)
|
||||||
- [作者](#作者)
|
- [作者](#作者)
|
||||||
- [鸣谢](#鸣谢)
|
- [鸣谢](#鸣谢)
|
||||||
|
- [技术讨论群](#技术讨论群)
|
||||||
|
|
||||||
### 源码地址
|
### 系统体验
|
||||||
- 项目文档: https://doc.pandarobot.chat
|
- 用户端:https://web.pandarobot.chat
|
||||||
- 前端-后台管理: https://github.com/ageerle/ruoyi-admin
|
- 管理端:https://admin.pandarobot.chat
|
||||||
- 前端-用户端: https://github.com/ageerle/ruoyi-web
|
|
||||||
- 小程序端: https://github.com/ageerle/ruoyi-uniapp
|
|
||||||
- 演示地址: https://web.pandarobot.chat
|
|
||||||
- 后台管理: https://admin.pandarobot.chat
|
|
||||||
- 用户名: admin 密码:admin123
|
- 用户名: admin 密码:admin123
|
||||||
|
|
||||||
### gitcode源码地址
|
### 源码地址
|
||||||
- https://gitcode.com/ageerle/ruoyi-ai
|
[1]github
|
||||||
- https://gitcode.com/ageerle/ruoyi-web
|
- 前端服务-用户端: https://github.com/ageerle/ruoyi-web
|
||||||
- https://gitcode.com/ageerle/ruoyi-admin
|
- 前端服务-管理端: https://github.com/ageerle/ruoyi-admin
|
||||||
- https://gitcode.com/ageerle/ruoyi-uniapp
|
- 前端服务-小程序端: https://github.com/ageerle/ruoyi-uniapp
|
||||||
|
- 后端服务:https://github.com/ageerle/ruoyi-ai
|
||||||
|
|
||||||
### 特色功能
|
[2]gitcode
|
||||||
1. 全套开源系统:提供完整的前端应用、后台管理以及小程序应用,基于MIT协议,开箱即用。
|
- 前端服务-用户端:https://gitcode.com/ageerle/ruoyi-web
|
||||||
2. 本地RAG方案:集成Milvus/Weaviate向量库、本地向量化模型与Ollama,实现本地化RAG
|
- 前端服务-管理端: https://gitcode.com/ageerle/ruoyi-admin
|
||||||
3. 丰富插件功能:支持联网、SQL查询插件及Text2API插件,扩展系统能力与应用场景。
|
- 前端服务-小程序端: https://gitcode.com/ageerle/ruoyi-uniapp
|
||||||
4. 内置SSE、websocket等网络协议,支持对接多种大语言模型,同时还集成了MidJourney和DALLE AI绘画功能
|
- 后端服务:https://gitcode.com/ageerle/ruoyi-ai
|
||||||
5. 强大的多媒体功能:支持AI翻译、PPT制作、语音克隆和翻唱等
|
|
||||||
6. 扩展功能:支持将大模型接入个人或企业微信
|
### 配套文档
|
||||||
7. 支付功能:支持易支付、微信支付等多种支付方式
|
- 配套文档: https://doc.pandarobot.chat
|
||||||
|
- 项目部署文档:https://doc.pandarobot.chat/guide/introduction/
|
||||||
|
|
||||||
|
### 核心功能与技术亮点
|
||||||
|
#### 1. 全栈式开源系统
|
||||||
|
- 全套开源系统:提供完整的前端应用、后台管理以及小程序应用,基于MIT协议,开箱即用。
|
||||||
|
#### 2. 本地化 RAG 方案
|
||||||
|
- 基于 **Langchain4j** 框架,支持 Milvus/Weaviate/Qdrant 向量库,结合 BGE-large-zh-v1.5 本地向量化模型 实现高效文档检索与知识库构建。
|
||||||
|
- 支持 本地 LLM 接入,结合私有知识库实现安全可控的问答系统,避免依赖云端服务的隐私风险。
|
||||||
|
#### 3. 多模态 AI 引擎与工具集成
|
||||||
|
- 智能对话:支持 OpenAI GPT-4、Azure、ChatGLM 等主流模型,内置 SSE/WebSocket 协议实现低延迟交互,兼容 **扣子**、**DIFY** 等平台 API 调用。
|
||||||
|
- **Spring AI MCP** 支持:通过注解快速定义本地工具,支持调用 MCP 广场 的海量 MCP Server 服务,扩展模型能力边界。
|
||||||
|
#### 4. 企业级扩展与商业化支持
|
||||||
|
- 即时通讯集成:支持对接个人微信、企业微信及微信公众号,实现消息自动回复、用户管理与智能客服。
|
||||||
|
- 支付系统:集成易支付、微信支付、Stripe 国际信用卡支付,满足商业化场景需求。
|
||||||
|
#### 5. 多媒体处理与创新功能
|
||||||
|
- AI 绘画:集成 DALL·E-3、MidJourney、Stable Diffusion,支持文生图、图生图及风格化创作,适用于营销素材生成与创意设计。
|
||||||
|
- PPT 制作:根据文本输入自动生成结构化幻灯片,支持自定义模板(需要使用三方平台 如:文多多)。
|
||||||
|
|
||||||
### 项目演示
|
### 项目演示
|
||||||
|
|
||||||
#### 后台管理
|
#### mcp支持
|
||||||
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
|
<img src="image/mcp-01.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
<img src="image/mcp-02.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
<img src="image/mcp-03.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
<img src="image/mcp-04.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
#### 管理端
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
<img src="image/02.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<img src="image/02.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
<img src="image/03.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<img src="image/03.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
@@ -85,7 +129,6 @@
|
|||||||
<img src="image/05.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<img src="image/05.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
#### 用户端
|
#### 用户端
|
||||||
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
<img src="image/08.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<img src="image/08.png" alt="drawing" style="width: 600px; height: 300px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
@@ -100,7 +143,7 @@
|
|||||||
<img src="image/07.png" alt="drawing" style="width: 320px; height: 600px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
<img src="image/07.png" alt="drawing" style="width: 320px; height: 600px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
### 开发前的配置要求
|
### 开发环境
|
||||||
|
|
||||||
1. jdk 17
|
1. jdk 17
|
||||||
2. mysql 5.7、8.0
|
2. mysql 5.7、8.0
|
||||||
@@ -108,8 +151,14 @@
|
|||||||
4. maven 3.8+
|
4. maven 3.8+
|
||||||
5. nodejs 20+ & pnpm
|
5. nodejs 20+ & pnpm
|
||||||
|
|
||||||
### 文件目录说明
|
- 附-部署配套视频:https://www.bilibili.com/video/BV1jDXkYWEba
|
||||||
RuoYi-AI
|
|
||||||
|
<div>
|
||||||
|
<img src="image/教程搭建.png" alt="drawing" width="600px" height="300px"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
### 项目结构
|
||||||
|
- RuoYi-AI
|
||||||
|
|
||||||
```
|
```
|
||||||
├─ ruoyi-admin // 管理模块
|
├─ ruoyi-admin // 管理模块
|
||||||
@@ -158,32 +207,34 @@ RuoYi-AI
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 注意事项
|
||||||
|
- vben模板
|
||||||
|
|
||||||
|
Q:vben5 的模板默认是没有的吗?
|
||||||
|
|
||||||
|
A:vben模板是收费的 请联系vben-vue-plus作者获取。
|
||||||
|
|
||||||
### 版本控制
|
### 版本控制
|
||||||
|
|
||||||
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
|
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### 版权说明
|
### 版权说明
|
||||||
|
|
||||||
该项目使用了MIT授权许可,详情请参阅 [LICENSE.txt](https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE)
|
该项目使用了MIT授权许可,详情请参阅 [LICENSE.txt](https://github.com/ageerle/ruoyi-ai/blob/main/LICENSE)
|
||||||
|
|
||||||
### 项目现状
|
### 项目现状
|
||||||
|
|
||||||
目前,项目还处于早期阶段,距离成熟还有很长的路要走。由于个人精力有限,项目的发展速度受到了一定的限制。为了加快项目的进度,我真诚地希望更多人能够参与到项目中来。无论是经验丰富的开发者,还是刚刚入门的小白,我都热烈欢迎你们提交Pull Request(PR)。即使代码修改得很少,或者存在一些错误,都没有关系。我会认真审核每一位贡献者的代码,并和大家一起完善项目。
|
目前,项目还处于早期阶段,距离成熟还有很长的路要走。由于个人精力有限,项目的发展速度受到了一定的限制。为了加快项目的进度,我真诚地希望更多人能够参与到项目中来。无论是经验丰富的开发者,还是刚刚入门的小白,我都热烈欢迎你们提交Pull Request(PR)👏👏👏。即使代码修改得很少,或者存在一些错误,都没有关系。我会认真审核每一位贡献者的代码,并和大家一起完善项目⛽️⛽️⛽️。
|
||||||
|
|
||||||
### 开发计划
|
### 开发计划
|
||||||
|
|
||||||
- 智能体管理
|
| 主题 | 方向 | 时间节点 |
|
||||||
|
| --- |-----------------------------------|--------|
|
||||||
|
| 前端简化版 | 与element-plus-x框架合作,推出基于该框架的前端简化版 | 2025.5 |
|
||||||
|
| agent2agent | Agent2Agent协议支持 | 2025.6 |
|
||||||
|
| 流程编排 | 通过可视化界面和灵活的配置方式,快速构建AI应用 | 2025.7 |
|
||||||
|
|
||||||
通过设置提示词、插件、知识库等,用户可以快速构建一个AI应用。这将极大地简化AI应用的开发流程,降低开发门槛,使更多企业能够轻松地利用AI技术。
|
|
||||||
<div>
|
|
||||||
<img src="image/13.png" alt="drawing" width="600px" height="300px"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
- 流程编排
|
|
||||||
|
|
||||||
通过流程编排功能,用户可以将不同的模型按照业务逻辑进行有序连接。这将解决单一模型能力不足的问题,充分发挥多个模型的协同作用,从而更好地满足企业的复杂业务需求。
|
|
||||||
|
|
||||||
- 感谢
|
- 感谢
|
||||||
|
|
||||||
@@ -193,7 +244,7 @@ RuoYi-AI
|
|||||||
|
|
||||||
#### 如何参与开源项目
|
#### 如何参与开源项目
|
||||||
|
|
||||||
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是**非常感谢**的。
|
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献,我们都非常感谢!🙏
|
||||||
|
|
||||||
1. Fork 这个项目
|
1. Fork 这个项目
|
||||||
2. 创建你的功能分支 (`git checkout -b feature/dev`)
|
2. 创建你的功能分支 (`git checkout -b feature/dev`)
|
||||||
@@ -204,7 +255,7 @@ RuoYi-AI
|
|||||||
|
|
||||||
#### 项目文档
|
#### 项目文档
|
||||||
1. 项目文档基于vitepress构建
|
1. 项目文档基于vitepress构建
|
||||||
2. 按照[如何参与开源项目](#如何参与开源项目)拉取 https://github.com/ageerle/ruoyi-doc
|
2. 按照[如何参与开源项目](#如何参与开源项目)拉取https://github.com/ageerle/ruoyi-doc
|
||||||
3. 安装依赖:npm install
|
3. 安装依赖:npm install
|
||||||
4. 启动项目:npm run docs:dev
|
4. 启动项目:npm run docs:dev
|
||||||
5. 主页路径:docs/guide/introduction/index.md
|
5. 主页路径:docs/guide/introduction/index.md
|
||||||
@@ -230,5 +281,21 @@ RuoYi-AI
|
|||||||
[license-url]: https://github.com/ageerle/ruoyi-ai/blob/master/LICENSE.txt
|
[license-url]: https://github.com/ageerle/ruoyi-ai/blob/master/LICENSE.txt
|
||||||
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
|
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
|
||||||
|
|
||||||
|
## 🌿 第三方生态
|
||||||
|
- [PPIO 派欧云:一键调用高性价比的开源模型 API 和 GPU 容器](https://ppinfra.com/user/register?invited_by=P8QTUY&utm_source=github_ruoyi-ai)
|
||||||
|
|
||||||
|
### 附:技术讨论群
|
||||||
|
|
||||||
|
#### 进群学习
|
||||||
|
🏠 wx:ruoyi-ai(加人备注:ruoyi-ai)
|
||||||
|
|
||||||
|
<img src="image/小助手wx.png" alt="drawing" style="width: 400px; height: 400px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
|
||||||
|
🏠 qq:1603234088 (加人备注:ruoyi-ai)
|
||||||
|
|
||||||
|
👏👏👏 ruoyi-ai官方交流1群(qq区):1034554687
|
||||||
|
|
||||||
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
|
<img src="image/QQ区-官方交流1群.png" alt="drawing" style="width: 400px; height: 400px; border: 2px solid #ddd; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1);"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|||||||
BIN
docker-deploy/Ruoyi-AI平台容器化构建与部署手册.docx
Normal file
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sed -i 's/[ \t]*$//' filename
|
||||||
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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
sed -i 's#127.0.0.1:6038#weaviate:8080#g' ./mysql-init/01_ruoyi-ai.sql
|
||||||
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
@@ -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
@@ -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
|
||||||
BIN
image/QQ区-官方交流1群.png
Normal file
|
After Width: | Height: | Size: 214 KiB |
BIN
image/WX区-官方交流4群.jpg
Normal file
|
After Width: | Height: | Size: 310 KiB |
BIN
image/mcp-01.png
Normal file
|
After Width: | Height: | Size: 227 KiB |
BIN
image/mcp-02.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
image/mcp-03.png
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
image/mcp-04.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
image/qq-msg.png
Normal file
|
After Width: | Height: | Size: 391 KiB |
BIN
image/wx-msg.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
image/wx-msg2.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
image/小助手wx.png
Normal file
|
After Width: | Height: | Size: 302 KiB |
BIN
image/教程搭建.png
Normal file
|
After Width: | Height: | Size: 341 KiB |
90
pom.xml
@@ -14,25 +14,26 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>1.0.0</revision>
|
<revision>1.0.0</revision>
|
||||||
<spring-boot.version>3.0.6</spring-boot.version>
|
<spring-boot.version>3.4.4</spring-boot.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<spring-boot.mybatis>3.0.1</spring-boot.mybatis>
|
<mysql.version>8.0.33</mysql.version>
|
||||||
<springdoc.version>2.1.0</springdoc.version>
|
<mybatis.version>3.5.16</mybatis.version>
|
||||||
|
<springdoc.version>2.8.5</springdoc.version>
|
||||||
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
<therapi-javadoc.version>0.15.0</therapi-javadoc.version>
|
||||||
<poi.version>5.2.3</poi.version>
|
<poi.version>5.2.3</poi.version>
|
||||||
<easyexcel.version>3.2.1</easyexcel.version>
|
<easyexcel.version>3.2.1</easyexcel.version>
|
||||||
<velocity.version>2.3</velocity.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<satoken.version>1.34.0</satoken.version>
|
<satoken.version>1.34.0</satoken.version>
|
||||||
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
<mybatis-plus.version>3.5.11</mybatis-plus.version>
|
||||||
<p6spy.version>3.9.1</p6spy.version>
|
<p6spy.version>3.9.1</p6spy.version>
|
||||||
<hutool.version>5.8.18</hutool.version>
|
<hutool.version>5.8.35</hutool.version>
|
||||||
<okhttp.version>4.10.0</okhttp.version>
|
<okhttp.version>4.10.0</okhttp.version>
|
||||||
|
<dynamic-ds.version>4.3.1</dynamic-ds.version>
|
||||||
<spring-boot-admin.version>3.0.3</spring-boot-admin.version>
|
<spring-boot-admin.version>3.0.3</spring-boot-admin.version>
|
||||||
<redisson.version>3.20.1</redisson.version>
|
<redisson.version>3.20.1</redisson.version>
|
||||||
<lock4j.version>2.2.4</lock4j.version>
|
<lock4j.version>2.2.4</lock4j.version>
|
||||||
<dynamic-ds.version>3.6.1</dynamic-ds.version>
|
|
||||||
<alibaba-ttl.version>2.14.2</alibaba-ttl.version>
|
<alibaba-ttl.version>2.14.2</alibaba-ttl.version>
|
||||||
<xxl-job.version>2.4.0</xxl-job.version>
|
<xxl-job.version>2.4.0</xxl-job.version>
|
||||||
<mapstruct-plus.version>1.2.1</mapstruct-plus.version>
|
<mapstruct-plus.version>1.2.1</mapstruct-plus.version>
|
||||||
@@ -41,10 +42,6 @@
|
|||||||
<bouncycastle.version>1.72</bouncycastle.version>
|
<bouncycastle.version>1.72</bouncycastle.version>
|
||||||
<!-- 离线IP地址定位库 -->
|
<!-- 离线IP地址定位库 -->
|
||||||
<ip2region.version>2.7.0</ip2region.version>
|
<ip2region.version>2.7.0</ip2region.version>
|
||||||
|
|
||||||
<!-- 临时修复 snakeyaml 漏洞 -->
|
|
||||||
<snakeyaml.version>1.33</snakeyaml.version>
|
|
||||||
|
|
||||||
<!-- OSS 配置 -->
|
<!-- OSS 配置 -->
|
||||||
<aws-java-sdk-s3.version>1.12.400</aws-java-sdk-s3.version>
|
<aws-java-sdk-s3.version>1.12.400</aws-java-sdk-s3.version>
|
||||||
<!-- SMS 配置 -->
|
<!-- SMS 配置 -->
|
||||||
@@ -60,6 +57,7 @@
|
|||||||
<weixin-java-miniapp.version>4.5.0</weixin-java-miniapp.version>
|
<weixin-java-miniapp.version>4.5.0</weixin-java-miniapp.version>
|
||||||
<weixin-java-pay.version>4.6.0</weixin-java-pay.version>
|
<weixin-java-pay.version>4.6.0</weixin-java-pay.version>
|
||||||
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
||||||
|
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
@@ -96,6 +94,12 @@
|
|||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>${mysql.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot的依赖配置-->
|
<!-- SpringBoot的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -194,22 +198,22 @@
|
|||||||
<version>${satoken.version}</version>
|
<version>${satoken.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- dynamic-datasource 多数据源-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baomidou</groupId>
|
|
||||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
|
||||||
<version>${dynamic-ds.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.mybatis</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>mybatis</artifactId>
|
||||||
<version>${spring-boot.mybatis}</version>
|
<version>${mybatis.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||||
|
<version>${mybatis-plus.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-jsqlparser</artifactId>
|
||||||
<version>${mybatis-plus.version}</version>
|
<version>${mybatis-plus.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -219,6 +223,13 @@
|
|||||||
<version>${mybatis-plus.version}</version>
|
<version>${mybatis-plus.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- dynamic-datasource 多数据源-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
|
||||||
|
<version>${dynamic-ds.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- sql性能分析插件 -->
|
<!-- sql性能分析插件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>p6spy</groupId>
|
<groupId>p6spy</groupId>
|
||||||
@@ -244,18 +255,6 @@
|
|||||||
<version>${tencent.sms.version}</version>
|
<version>${tencent.sms.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>de.codecentric</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-admin-starter-server</artifactId>-->
|
|
||||||
<!-- <version>${spring-boot-admin.version}</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
<!-- <dependency>-->
|
|
||||||
<!-- <groupId>de.codecentric</groupId>-->
|
|
||||||
<!-- <artifactId>spring-boot-admin-starter-client</artifactId>-->
|
|
||||||
<!-- <version>${spring-boot-admin.version}</version>-->
|
|
||||||
<!-- </dependency>-->
|
|
||||||
|
|
||||||
<!--redisson-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.redisson</groupId>
|
<groupId>org.redisson</groupId>
|
||||||
<artifactId>redisson-spring-boot-starter</artifactId>
|
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||||
@@ -281,13 +280,6 @@
|
|||||||
<version>${alibaba-ttl.version}</version>
|
<version>${alibaba-ttl.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 临时修复 snakeyaml 漏洞 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.yaml</groupId>
|
|
||||||
<artifactId>snakeyaml</artifactId>
|
|
||||||
<version>${snakeyaml.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 加密包引入 -->
|
<!-- 加密包引入 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
@@ -321,10 +313,21 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-knowledge-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ruoyi</groupId>
|
<groupId>org.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-knowledge</artifactId>
|
<artifactId>ruoyi-chat-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-system-api</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -336,7 +339,7 @@
|
|||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ruoyi</groupId>
|
<groupId>org.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-demo</artifactId>
|
<artifactId>ruoyi-wechat</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -344,10 +347,13 @@
|
|||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>ruoyi-admin</module>
|
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
<module>ruoyi-modules</module>
|
<module>ruoyi-modules</module>
|
||||||
|
<module>ruoyi-modules-api</module>
|
||||||
|
<module>ruoyi-admin</module>
|
||||||
|
<module>ruoyi-extend</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
#基础镜像
|
|
||||||
FROM findepi/graalvm:java17-native
|
|
||||||
|
|
||||||
# 设置环境变量
|
|
||||||
ENV LANG C.UTF-8
|
|
||||||
ENV LANGUAGE C.UTF-8
|
|
||||||
ENV LC_ALL C.UTF-8
|
|
||||||
ENV SERVER_PORT=6039
|
|
||||||
|
|
||||||
MAINTAINER ageerle
|
|
||||||
|
|
||||||
RUN mkdir -p /ruoyi/server/logs \
|
|
||||||
/ruoyi/server/temp \
|
|
||||||
/ruoyi/skywalking/agent
|
|
||||||
|
|
||||||
|
|
||||||
#工作空间
|
|
||||||
WORKDIR /ruoyi/server
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE ${SERVER_PORT}
|
|
||||||
|
|
||||||
ADD ./target/ruoyi-admin.jar ./app.jar
|
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["java", \
|
|
||||||
"-Djava.security.egd=file:/dev/./urandom", \
|
|
||||||
"-Dserver.port=${SERVER_PORT}", \
|
|
||||||
# 应用名称 如果想区分集群节点监控 改成不同的名称即可
|
|
||||||
# "-Dskywalking.agent.service_name=ruoyi-server", \
|
|
||||||
# "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
|
|
||||||
"-jar", "app.jar"]
|
|
||||||
|
|
||||||
|
|
||||||
@@ -42,11 +42,6 @@
|
|||||||
<artifactId>mssql-jdbc</artifactId>
|
<artifactId>mssql-jdbc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-common-doc</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ruoyi</groupId>
|
<groupId>org.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-system</artifactId>
|
<artifactId>ruoyi-system</artifactId>
|
||||||
@@ -57,39 +52,14 @@
|
|||||||
<artifactId>ruoyi-chat</artifactId>
|
<artifactId>ruoyi-chat</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-knowledge</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ruoyi</groupId>
|
<groupId>org.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- demo模块 -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.ruoyi</groupId>
|
<groupId>org.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-demo</artifactId>
|
<artifactId>ruoyi-wechat</artifactId>
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 添加thumbnailator依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>net.coobird</groupId>
|
|
||||||
<artifactId>thumbnailator</artifactId>
|
|
||||||
<version>0.4.11</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.github.ollama4j</groupId>
|
|
||||||
<artifactId>ollama4j</artifactId>
|
|
||||||
<version>1.0.79</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package org.ruoyi;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
|
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
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableAsync
|
||||||
public class RuoYiAIApplication {
|
public class RuoYiAIApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package org.ruoyi.controller;
|
|||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
|
||||||
import org.ruoyi.common.core.constant.Constants;
|
import org.ruoyi.common.core.constant.Constants;
|
||||||
import org.ruoyi.common.core.domain.R;
|
import org.ruoyi.common.core.domain.R;
|
||||||
import org.ruoyi.common.core.domain.model.EmailLoginBody;
|
import org.ruoyi.common.core.domain.model.EmailLoginBody;
|
||||||
@@ -16,18 +14,17 @@ import org.ruoyi.common.core.utils.StreamUtils;
|
|||||||
import org.ruoyi.common.core.utils.StringUtils;
|
import org.ruoyi.common.core.utils.StringUtils;
|
||||||
import org.ruoyi.common.satoken.utils.LoginHelper;
|
import org.ruoyi.common.satoken.utils.LoginHelper;
|
||||||
import org.ruoyi.common.tenant.helper.TenantHelper;
|
import org.ruoyi.common.tenant.helper.TenantHelper;
|
||||||
import org.ruoyi.system.domain.bo.SysTenantBo;
|
|
||||||
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
|
||||||
import org.ruoyi.system.domain.vo.SysTenantVo;
|
|
||||||
import org.ruoyi.system.domain.vo.TenantListVo;
|
|
||||||
import org.ruoyi.system.service.ISysTenantService;
|
|
||||||
|
|
||||||
import org.ruoyi.system.service.SysLoginService;
|
|
||||||
import org.ruoyi.system.service.SysRegisterService;
|
|
||||||
import org.ruoyi.system.domain.vo.LoginVo;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.ruoyi.system.domain.bo.SysTenantBo;
|
||||||
|
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
||||||
|
import org.ruoyi.system.domain.vo.LoginVo;
|
||||||
|
import org.ruoyi.system.domain.vo.SysTenantVo;
|
||||||
|
import org.ruoyi.system.domain.vo.TenantListVo;
|
||||||
|
import org.ruoyi.system.service.ISysTenantService;
|
||||||
|
import org.ruoyi.system.service.SysLoginService;
|
||||||
|
import org.ruoyi.system.service.SysRegisterService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -50,15 +47,6 @@ public class AuthController {
|
|||||||
private final SysRegisterService registerService;
|
private final SysRegisterService registerService;
|
||||||
private final ISysTenantService tenantService;
|
private final ISysTenantService tenantService;
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/xcxLogin")
|
|
||||||
public R<LoginVo> login(@Validated @RequestBody String xcxCode) throws WxErrorException {
|
|
||||||
|
|
||||||
String openidFromCode = loginService.getOpenidFromCode((String) JSONUtil.parseObj(xcxCode).get("xcxCode"));
|
|
||||||
LoginVo loginVo = loginService.mpLogin(openidFromCode);
|
|
||||||
return R.ok(loginVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
*
|
*
|
||||||
@@ -75,6 +63,7 @@ public class AuthController {
|
|||||||
body.getUsername(), body.getPassword(),
|
body.getUsername(), body.getPassword(),
|
||||||
body.getCode(), body.getUuid());
|
body.getCode(), body.getUuid());
|
||||||
loginVo.setToken(token);
|
loginVo.setToken(token);
|
||||||
|
// 兼容后台管理登录
|
||||||
loginVo.setAccess_token(token);
|
loginVo.setAccess_token(token);
|
||||||
loginVo.setUserInfo(LoginHelper.getLoginUser());
|
loginVo.setUserInfo(LoginHelper.getLoginUser());
|
||||||
return R.ok(loginVo);
|
return R.ok(loginVo);
|
||||||
@@ -97,7 +86,6 @@ public class AuthController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 访客登录
|
* 访客登录
|
||||||
*
|
|
||||||
* @param loginBody 登录信息
|
* @param loginBody 登录信息
|
||||||
* @return token信息
|
* @return token信息
|
||||||
*/
|
*/
|
||||||
@@ -136,7 +124,7 @@ public class AuthController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public R<Void> register(@Validated @RequestBody RegisterBody user, HttpServletRequest request) {
|
public R<Void> register(@Validated @RequestBody RegisterBody user, HttpServletRequest request) {
|
||||||
String domainName = request.getServerName();
|
String domainName = request.getServerName();
|
||||||
user.setDomainName(domainName);
|
user.setDomainName(domainName);
|
||||||
registerService.register(user);
|
registerService.register(user);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.ruoyi.controller;
|
package org.ruoyi.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -11,7 +10,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@SaIgnore
|
@SaIgnore
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RestController
|
@RestController
|
||||||
public class IndexController {
|
public class IndexController {
|
||||||
|
|
||||||
@@ -20,7 +18,9 @@ public class IndexController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/")
|
@GetMapping("/")
|
||||||
public String index() {
|
public String index() {
|
||||||
return "RuoYi-AI 启动成功";
|
return "RuoYi AI启动成功!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
package org.ruoyi.controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.ruoyi.common.chat.config.ChatConfig;
|
|
||||||
import org.ruoyi.common.chat.domain.request.ChatRequest;
|
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
|
||||||
import org.ruoyi.common.chat.entity.chat.Message;
|
|
||||||
import org.ruoyi.common.chat.openai.OpenAiStreamClient;
|
|
||||||
import org.ruoyi.common.core.domain.R;
|
|
||||||
import org.ruoyi.common.core.validate.AddGroup;
|
|
||||||
import org.ruoyi.common.excel.utils.ExcelUtil;
|
|
||||||
import org.ruoyi.common.log.annotation.Log;
|
|
||||||
import org.ruoyi.common.log.enums.BusinessType;
|
|
||||||
import org.ruoyi.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.ruoyi.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import org.ruoyi.common.satoken.utils.LoginHelper;
|
|
||||||
import org.ruoyi.common.web.core.BaseController;
|
|
||||||
import org.ruoyi.knowledge.domain.bo.KnowledgeAttachBo;
|
|
||||||
import org.ruoyi.knowledge.domain.bo.KnowledgeFragmentBo;
|
|
||||||
import org.ruoyi.knowledge.domain.bo.KnowledgeInfoBo;
|
|
||||||
import org.ruoyi.knowledge.domain.req.KnowledgeInfoUploadRequest;
|
|
||||||
import org.ruoyi.knowledge.domain.vo.KnowledgeAttachVo;
|
|
||||||
import org.ruoyi.knowledge.domain.vo.KnowledgeFragmentVo;
|
|
||||||
import org.ruoyi.knowledge.domain.vo.KnowledgeInfoVo;
|
|
||||||
import org.ruoyi.knowledge.service.EmbeddingService;
|
|
||||||
import org.ruoyi.knowledge.service.IKnowledgeAttachService;
|
|
||||||
import org.ruoyi.knowledge.service.IKnowledgeFragmentService;
|
|
||||||
import org.ruoyi.knowledge.service.IKnowledgeInfoService;
|
|
||||||
import org.ruoyi.system.listener.SSEEventSourceListener;
|
|
||||||
import org.ruoyi.system.service.ISseService;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.ruoyi.knowledge.chain.vectorstore.VectorStore;
|
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 知识库
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
* @date 2024-10-21
|
|
||||||
*/
|
|
||||||
@Validated
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/knowledge")
|
|
||||||
public class KnowledgeController extends BaseController {
|
|
||||||
|
|
||||||
private final IKnowledgeInfoService knowledgeInfoService;
|
|
||||||
|
|
||||||
private final VectorStore vectorStore;
|
|
||||||
|
|
||||||
private final IKnowledgeAttachService attachService;
|
|
||||||
|
|
||||||
private final IKnowledgeFragmentService fragmentService;
|
|
||||||
|
|
||||||
private final EmbeddingService embeddingService;
|
|
||||||
|
|
||||||
private OpenAiStreamClient openAiStreamClient;
|
|
||||||
|
|
||||||
private final ChatConfig chatConfig;
|
|
||||||
|
|
||||||
private final ISseService sseService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 知识库对话
|
|
||||||
*/
|
|
||||||
@PostMapping("/send")
|
|
||||||
public SseEmitter send(@RequestBody @Valid ChatRequest chatRequest) {
|
|
||||||
|
|
||||||
openAiStreamClient = chatConfig.getOpenAiStreamClient();
|
|
||||||
SseEmitter sseEmitter = new SseEmitter(0L);
|
|
||||||
SSEEventSourceListener openAIEventSourceListener = new SSEEventSourceListener(sseEmitter);
|
|
||||||
List<Message> messages = chatRequest.getMessages();
|
|
||||||
String content = messages.get(messages.size() - 1).getContent().toString();
|
|
||||||
List<String> nearestList;
|
|
||||||
List<Double> queryVector = embeddingService.getQueryVector(content, chatRequest.getKid());
|
|
||||||
nearestList = vectorStore.nearest(queryVector,chatRequest.getKid());
|
|
||||||
for (String prompt : nearestList) {
|
|
||||||
Message sysMessage = Message.builder().content(prompt).role(Message.Role.USER).build();
|
|
||||||
messages.add(sysMessage);
|
|
||||||
}
|
|
||||||
Message userMessage = Message.builder().content(content + (nearestList.size() > 0 ? "\n\n注意:回答问题时,须严格根据我给你的系统上下文内容原文进行回答,请不要自己发挥,回答时保持原来文本的段落层级" : "") ).role(Message.Role.USER).build();
|
|
||||||
messages.add(userMessage);
|
|
||||||
if (chatRequest.getModel().startsWith("ollama")) {
|
|
||||||
return sseService.ollamaChat(chatRequest);
|
|
||||||
}
|
|
||||||
|
|
||||||
ChatCompletion completion = ChatCompletion
|
|
||||||
.builder()
|
|
||||||
.messages(messages)
|
|
||||||
.model(chatRequest.getModel())
|
|
||||||
.temperature(chatRequest.getTemperature())
|
|
||||||
.topP(chatRequest.getTop_p())
|
|
||||||
.stream(true)
|
|
||||||
.build();
|
|
||||||
openAiStreamClient.streamChatCompletion(completion, openAIEventSourceListener);
|
|
||||||
|
|
||||||
return sseEmitter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户信息查询本地知识库
|
|
||||||
*/
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo<KnowledgeInfoVo> list(KnowledgeInfoBo bo, PageQuery pageQuery) {
|
|
||||||
if(!StpUtil.isLogin()){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
bo.setUid(LoginHelper.getUserId());
|
|
||||||
return knowledgeInfoService.queryPageList(bo, pageQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增知识库
|
|
||||||
*/
|
|
||||||
@Log(title = "知识库", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping("/save")
|
|
||||||
public R<Void> save(@Validated(AddGroup.class) @RequestBody KnowledgeInfoBo bo) {
|
|
||||||
knowledgeInfoService.saveOne(bo);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除知识库
|
|
||||||
*/
|
|
||||||
@PostMapping("/remove/{id}")
|
|
||||||
public R<String> remove(@PathVariable String id){
|
|
||||||
knowledgeInfoService.removeKnowledge(id);
|
|
||||||
return R.ok("删除知识库成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改知识库
|
|
||||||
*/
|
|
||||||
@Log(title = "知识库", businessType = BusinessType.UPDATE)
|
|
||||||
@PostMapping("/edit")
|
|
||||||
public R<Void> edit( @RequestBody KnowledgeInfoBo bo) {
|
|
||||||
return toAjax(knowledgeInfoService.updateByBo(bo));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出知识库列表
|
|
||||||
*/
|
|
||||||
@Log(title = "知识库", businessType = BusinessType.EXPORT)
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(KnowledgeInfoBo bo, HttpServletResponse response) {
|
|
||||||
List<KnowledgeInfoVo> list = knowledgeInfoService.queryList(bo);
|
|
||||||
ExcelUtil.exportExcel(list, "知识库", KnowledgeInfoVo.class, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询知识附件信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail/{kid}")
|
|
||||||
public TableDataInfo<KnowledgeAttachVo> attach(KnowledgeAttachBo bo, PageQuery pageQuery,@PathVariable String kid){
|
|
||||||
bo.setKid(kid);
|
|
||||||
return attachService.queryPageList(bo, pageQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传知识库附件
|
|
||||||
*/
|
|
||||||
@PostMapping(value = "/attach/upload")
|
|
||||||
public R<String> upload(KnowledgeInfoUploadRequest request){
|
|
||||||
knowledgeInfoService.upload(request);
|
|
||||||
return R.ok("上传知识库附件成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取知识库附件详细信息
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
*/
|
|
||||||
@GetMapping("attach/info/{id}")
|
|
||||||
public R<KnowledgeAttachVo> getAttachInfo(@NotNull(message = "主键不能为空")
|
|
||||||
@PathVariable Long id) {
|
|
||||||
return R.ok(attachService.queryById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除知识库附件
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@PostMapping("attach/remove/{docId}")
|
|
||||||
public R<Void> removeAttach(@NotEmpty(message = "主键不能为空") @PathVariable String docId) {
|
|
||||||
attachService.removeKnowledgeAttach(docId);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询知识片段
|
|
||||||
*/
|
|
||||||
@GetMapping("/fragment/list/{docId}")
|
|
||||||
public TableDataInfo<KnowledgeFragmentVo> fragmentList(KnowledgeFragmentBo bo, PageQuery pageQuery, @PathVariable String docId) {
|
|
||||||
bo.setDocId(docId);
|
|
||||||
return fragmentService.queryPageList(bo, pageQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -25,10 +25,9 @@ spring:
|
|||||||
master:
|
master:
|
||||||
type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://43.139.70.230:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
username: ruoyi-ai
|
username: ry-vue
|
||||||
password: ruoyi-ai
|
password: xx
|
||||||
|
|
||||||
|
|
||||||
hikari:
|
hikari:
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
@@ -61,9 +60,6 @@ spring.data:
|
|||||||
# password: 123456
|
# password: 123456
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
timeout: 10S
|
timeout: 10S
|
||||||
# 是否开启ssl
|
|
||||||
ssl: false
|
|
||||||
|
|
||||||
redisson:
|
redisson:
|
||||||
# redis key前缀
|
# redis key前缀
|
||||||
keyPrefix:
|
keyPrefix:
|
||||||
@@ -97,3 +93,12 @@ sms:
|
|||||||
signName: 测试
|
signName: 测试
|
||||||
# 腾讯专用
|
# 腾讯专用
|
||||||
sdkAppId:
|
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: 测试
|
signName: 测试
|
||||||
# 腾讯专用
|
# 腾讯专用
|
||||||
sdkAppId:
|
sdkAppId:
|
||||||
|
|
||||||
|
pdf:
|
||||||
|
extract:
|
||||||
|
service:
|
||||||
|
url: http://localhost:8080
|
||||||
|
ai-api:
|
||||||
|
url: https://api.pandarobot.chat/v1/chat/completions
|
||||||
|
key: sk-XXXXXX
|
||||||