Compare commits
42 Commits
93ddcd53b1
...
v2.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd94a3eae8 | ||
|
|
fcdcf534f1 | ||
|
|
deefb6cc0b | ||
|
|
fa96c3d12f | ||
|
|
77069fdecd | ||
|
|
db4a264a52 | ||
|
|
70ae7ea8f1 | ||
|
|
6a93856d90 | ||
|
|
71cae94815 | ||
|
|
a2905d08f9 | ||
|
|
463ad6c583 | ||
|
|
abcde9e36e | ||
|
|
8e723f5b78 | ||
|
|
2021fb5071 | ||
|
|
ecbab7df7b | ||
|
|
d6fcaa0a11 | ||
|
|
58faded4ff | ||
|
|
7cc7af70f0 | ||
|
|
4312a729a2 | ||
|
|
5d972d66f4 | ||
|
|
1bff2791a6 | ||
|
|
a76769e540 | ||
|
|
bedffffd86 | ||
|
|
2884c37599 | ||
|
|
c25749c9ca | ||
|
|
147b3fd8f5 | ||
|
|
373424bd01 | ||
|
|
287a0b3d70 | ||
|
|
cd7e07bea6 | ||
|
|
7edfae09bc | ||
|
|
a1759ddf5a | ||
|
|
5517a5d19b | ||
|
|
8fb72ba4fe | ||
|
|
24511fac8f | ||
|
|
ce9f2a82da | ||
|
|
b81fb7cb3f | ||
|
|
676a63c0d6 | ||
|
|
427736271c | ||
|
|
c39dd7a917 | ||
|
|
c491a98dc7 | ||
|
|
2a4978c668 | ||
|
|
5b4eeee756 |
77
README.md
@@ -36,30 +36,37 @@
|
|||||||
|
|
||||||
## 快速启动
|
## 快速启动
|
||||||
|
|
||||||
|
### 拉取镜像(最低配置2H2G):
|
||||||
|
```bash
|
||||||
|
script/deploy/deploy目录下执行: docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### 通过脚本启动(最低配置4H4G):
|
||||||
1. 确认系统内已经安装好以下软件
|
1. 确认系统内已经安装好以下软件
|
||||||
docker
|
- docker
|
||||||
docker-compose
|
- docker-compose
|
||||||
git
|
- git
|
||||||
unzip
|
- unzip
|
||||||
|
|
||||||
2. **克隆项目**
|
2. **克隆项目**
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/ageerle/ruoyi-ai
|
git clone https://github.com/ageerle/ruoyi-ai
|
||||||
cd ruoyi-ai/docker-deploy/one-step-script/
|
cd ruoyi-ai/script/deploy/one-step-script
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **启动部署脚本**
|
3. **启动部署脚本**
|
||||||
|
|
||||||
中文界面部署脚本:
|
中文界面部署脚本(拉取gitee仓库):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./deploy-cn.sh
|
./deploy-cn.sh
|
||||||
```
|
```
|
||||||

|
按照脚本提示一步步操作,如果是一台新服务器,选择默认配置,直接回车即可。
|
||||||

|
<img src="image/deploy-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);"/>
|
||||||

|
|
||||||
|
|
||||||
英文界面部署脚本:
|
耐心等待安装完成...
|
||||||
|
|
||||||
|
英文界面部署脚本(拉取github仓库):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./deploy-en.sh
|
./deploy-en.sh
|
||||||
@@ -90,7 +97,6 @@
|
|||||||
- [项目演示](#项目演示)
|
- [项目演示](#项目演示)
|
||||||
- [管理端](#管理端)
|
- [管理端](#管理端)
|
||||||
- [用户端](#用户端)
|
- [用户端](#用户端)
|
||||||
- [小程序端](#小程序端)
|
|
||||||
- [开发环境](#开发环境)
|
- [开发环境](#开发环境)
|
||||||
- [项目结构](#项目结构)
|
- [项目结构](#项目结构)
|
||||||
- [ruoyi-ai](#ruoyi-ai)
|
- [ruoyi-ai](#ruoyi-ai)
|
||||||
@@ -105,20 +111,20 @@
|
|||||||
|
|
||||||
### 系统体验
|
### 系统体验
|
||||||
- 用户端:https://web.pandarobot.chat
|
- 用户端:https://web.pandarobot.chat
|
||||||
|
- 演示账号: demo 密码:demo123
|
||||||
- 管理端:https://admin.pandarobot.chat
|
- 管理端:https://admin.pandarobot.chat
|
||||||
- 用户名: admin 密码:admin123
|
- 演示账号: admin 密码:admin123
|
||||||
|
- 商业版:体验商业版请联系下方小助手获取演示地址(预计6月份上线)。
|
||||||
|
|
||||||
### 源码地址
|
### 源码地址
|
||||||
[1]github
|
[1]github
|
||||||
- 前端服务-用户端: https://github.com/ageerle/ruoyi-web
|
- 前端服务-用户端: https://github.com/ageerle/ruoyi-web
|
||||||
- 前端服务-管理端: https://github.com/ageerle/ruoyi-admin
|
- 前端服务-管理端: https://github.com/ageerle/ruoyi-admin
|
||||||
- 前端服务-小程序端: https://github.com/ageerle/ruoyi-uniapp
|
|
||||||
- 后端服务:https://github.com/ageerle/ruoyi-ai
|
- 后端服务:https://github.com/ageerle/ruoyi-ai
|
||||||
|
|
||||||
[2]gitcode
|
[2]gitcode
|
||||||
- 前端服务-用户端:https://gitcode.com/ageerle/ruoyi-web
|
- 前端服务-用户端:https://gitcode.com/ageerle/ruoyi-web
|
||||||
- 前端服务-管理端: https://gitcode.com/ageerle/ruoyi-admin
|
- 前端服务-管理端: https://gitcode.com/ageerle/ruoyi-admin
|
||||||
- 前端服务-小程序端: https://gitcode.com/ageerle/ruoyi-uniapp
|
|
||||||
- 后端服务:https://gitcode.com/ageerle/ruoyi-ai
|
- 后端服务:https://gitcode.com/ageerle/ruoyi-ai
|
||||||
|
|
||||||
### 配套文档
|
### 配套文档
|
||||||
@@ -127,7 +133,7 @@
|
|||||||
|
|
||||||
### 核心功能与技术亮点
|
### 核心功能与技术亮点
|
||||||
#### 1. 全栈式开源系统
|
#### 1. 全栈式开源系统
|
||||||
- 全套开源系统:提供完整的前端应用、后台管理以及小程序应用,基于MIT协议,开箱即用。
|
- 全套开源系统:提供完整的前端应用、后台管理,基于MIT协议,开箱即用。
|
||||||
#### 2. 本地化 RAG 方案
|
#### 2. 本地化 RAG 方案
|
||||||
- 基于 **Langchain4j** 框架,支持 Milvus/Weaviate/Qdrant 向量库,结合 BGE-large-zh-v1.5 本地向量化模型 实现高效文档检索与知识库构建。
|
- 基于 **Langchain4j** 框架,支持 Milvus/Weaviate/Qdrant 向量库,结合 BGE-large-zh-v1.5 本地向量化模型 实现高效文档检索与知识库构建。
|
||||||
- 支持 本地 LLM 接入,结合私有知识库实现安全可控的问答系统,避免依赖云端服务的隐私风险。
|
- 支持 本地 LLM 接入,结合私有知识库实现安全可控的问答系统,避免依赖云端服务的隐私风险。
|
||||||
@@ -151,13 +157,6 @@
|
|||||||
<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);"/>
|
<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>
|
||||||
|
|
||||||
#### 管理端
|
|
||||||
<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/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/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);"/>
|
|
||||||
<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 style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
@@ -167,12 +166,15 @@
|
|||||||
<img src="image/11.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/11.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: flex-start;">
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
<img src="image/06.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/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/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/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/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);"/>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
### 开发环境
|
### 开发环境
|
||||||
|
|
||||||
1. jdk 17
|
1. jdk 17
|
||||||
@@ -316,16 +318,19 @@
|
|||||||
|
|
||||||
### 附:技术讨论群
|
### 附:技术讨论群
|
||||||
|
|
||||||
#### 进群学习
|
#### 技术交流(如需进群请添加小助手)
|
||||||
🏠 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;">
|
<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);"/>
|
<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);"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
#### 进群学习
|
||||||
|
🏠 小助手wx:ruoyi-ai(加人备注:ruoyi-ai)
|
||||||
|
🏠 小助手qq:1603234088 (加人备注:ruoyi-ai)
|
||||||
|
|
||||||
|
👏👏👏 ruoyi-ai官方交流群(qq区)
|
||||||
|
|
||||||
|
<div style="display: flex; flex-wrap: wrap; gap: 20px; justify-content: center;">
|
||||||
|
<img src="image/qq.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>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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');
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
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`;
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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);
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
sed -i 's#127.0.0.1:6038#weaviate:8080#g' ./mysql-init/01_ruoyi-ai.sql
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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');
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
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`;
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
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);
|
|
||||||
BIN
image/08.png
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 1.5 MiB |
BIN
image/09.png
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 148 KiB |
BIN
image/10.png
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 72 KiB |
BIN
image/11.png
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 563 KiB |
|
Before Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 310 KiB |
BIN
image/deploy-01.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
image/qq.png
Normal file
|
After Width: | Height: | Size: 392 KiB |
BIN
image/wx-msg.png
|
Before Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 148 KiB |
BIN
image/wx.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
image/小助手wx.png
|
Before Width: | Height: | Size: 302 KiB |
11
pom.xml
@@ -54,10 +54,6 @@
|
|||||||
<maven-compiler-plugin.verison>3.11.0</maven-compiler-plugin.verison>
|
<maven-compiler-plugin.verison>3.11.0</maven-compiler-plugin.verison>
|
||||||
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
<maven-surefire-plugin.version>3.0.0</maven-surefire-plugin.version>
|
||||||
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
|
<flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.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-cp.version>4.6.0</weixin-java-cp.version>
|
|
||||||
<weixin-java-cp.version>4.6.0</weixin-java-cp.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
@@ -336,13 +332,6 @@
|
|||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-wechat</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|||||||
@@ -57,11 +57,6 @@
|
|||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-wechat</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -2,21 +2,16 @@ 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 jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
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.*;
|
||||||
import org.ruoyi.common.core.domain.model.LoginBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.RegisterBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.SmsLoginBody;
|
|
||||||
import org.ruoyi.common.core.domain.model.VisitorLoginBody;
|
|
||||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||||
import org.ruoyi.common.core.utils.StreamUtils;
|
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 jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.ruoyi.system.domain.bo.SysTenantBo;
|
import org.ruoyi.system.domain.bo.SysTenantBo;
|
||||||
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
import org.ruoyi.system.domain.vo.LoginTenantVo;
|
||||||
import org.ruoyi.system.domain.vo.LoginVo;
|
import org.ruoyi.system.domain.vo.LoginVo;
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ import cn.hutool.captcha.AbstractCaptcha;
|
|||||||
import cn.hutool.captcha.generator.CodeGenerator;
|
import cn.hutool.captcha.generator.CodeGenerator;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.ruoyi.common.core.constant.Constants;
|
import org.ruoyi.common.core.constant.Constants;
|
||||||
import org.ruoyi.common.core.constant.GlobalConstants;
|
import org.ruoyi.common.core.constant.GlobalConstants;
|
||||||
import org.ruoyi.common.core.domain.R;
|
import org.ruoyi.common.core.domain.R;
|
||||||
import org.ruoyi.common.core.exception.ServiceException;
|
|
||||||
import org.ruoyi.common.core.service.ConfigService;
|
import org.ruoyi.common.core.service.ConfigService;
|
||||||
import org.ruoyi.common.core.utils.SpringUtils;
|
import org.ruoyi.common.core.utils.SpringUtils;
|
||||||
import org.ruoyi.common.core.utils.StringUtils;
|
import org.ruoyi.common.core.utils.StringUtils;
|
||||||
@@ -22,10 +25,6 @@ import org.ruoyi.common.web.config.properties.CaptchaProperties;
|
|||||||
import org.ruoyi.common.web.enums.CaptchaType;
|
import org.ruoyi.common.web.enums.CaptchaType;
|
||||||
import org.ruoyi.system.domain.request.EmailRequest;
|
import org.ruoyi.system.domain.request.EmailRequest;
|
||||||
import org.ruoyi.system.domain.vo.CaptchaVo;
|
import org.ruoyi.system.domain.vo.CaptchaVo;
|
||||||
import jakarta.validation.Valid;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.expression.Expression;
|
import org.springframework.expression.Expression;
|
||||||
import org.springframework.expression.ExpressionParser;
|
import org.springframework.expression.ExpressionParser;
|
||||||
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
@@ -36,7 +35,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码操作处理
|
* 验证码操作处理
|
||||||
@@ -67,7 +67,7 @@ public class CaptchaController {
|
|||||||
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 验证码模板id 自行处理 (查数据库或写死均可)
|
// 验证码模板id
|
||||||
String templateId = "";
|
String templateId = "";
|
||||||
Map<String, String> map = new HashMap<>(1);
|
Map<String, String> map = new HashMap<>(1);
|
||||||
map.put("code", code);
|
map.put("code", code);
|
||||||
@@ -90,18 +90,6 @@ public class CaptchaController {
|
|||||||
String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername();
|
String key = GlobalConstants.CAPTCHA_CODE_KEY + emailRequest.getUsername();
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 检验邮箱后缀
|
|
||||||
String suffix = configService.getConfigValue("mail", "suffix");
|
|
||||||
String prompt = configService.getConfigValue("mail", "prompt");
|
|
||||||
if(StringUtils.isNotEmpty(suffix)){
|
|
||||||
// 动态的域名列表
|
|
||||||
String[] invalidDomains = suffix.split(",");
|
|
||||||
for (String domain : invalidDomains) {
|
|
||||||
if (emailRequest.getUsername().endsWith(domain)) {
|
|
||||||
throw new ServiceException(prompt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 自定义邮箱模板
|
// 自定义邮箱模板
|
||||||
String model = configService.getConfigValue("mail", "mailModel");
|
String model = configService.getConfigValue("mail", "mailModel");
|
||||||
String mailTitle = configService.getConfigValue("mail", "mailTitle");
|
String mailTitle = configService.getConfigValue("mail", "mailTitle");
|
||||||
|
|||||||
@@ -1,12 +1,3 @@
|
|||||||
--- # 监控中心配置
|
|
||||||
spring.boot.admin.client:
|
|
||||||
# 增加客户端开关
|
|
||||||
enabled: false
|
|
||||||
url: http://localhost:9090/admin
|
|
||||||
instance:
|
|
||||||
service-host-type: IP
|
|
||||||
username: ruoyi
|
|
||||||
password: 123456
|
|
||||||
|
|
||||||
--- # 数据源配置
|
--- # 数据源配置
|
||||||
spring:
|
spring:
|
||||||
@@ -25,9 +16,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://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
username: ry-vue
|
username: ruoyi-ai
|
||||||
password: xx
|
password: ruoyi-ai
|
||||||
|
|
||||||
hikari:
|
hikari:
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
@@ -94,11 +85,4 @@ sms:
|
|||||||
# 腾讯专用
|
# 腾讯专用
|
||||||
sdkAppId:
|
sdkAppId:
|
||||||
|
|
||||||
pdf:
|
|
||||||
extract:
|
|
||||||
service:
|
|
||||||
url: http://localhost:8080
|
|
||||||
ai-api:
|
|
||||||
url: https://api.pandarobot.chat/v1/chat/completions
|
|
||||||
key: sk-xxxx
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,182 +0,0 @@
|
|||||||
--- # 临时文件存储位置 避免临时文件被系统清理报错
|
|
||||||
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://localhost:3306/ry-vue?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://localhost:3306/ry-vue?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: localhost
|
|
||||||
# 端口,默认为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: xxx@163.com
|
|
||||||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
|
||||||
user: xxx@163.com
|
|
||||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
|
||||||
pass: xxxxxxxxxx
|
|
||||||
# 使用 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:
|
|
||||||
|
|
||||||
pdf:
|
|
||||||
extract:
|
|
||||||
service:
|
|
||||||
url: http://localhost:8080
|
|
||||||
ai-api:
|
|
||||||
url: https://api.pandarobot.chat/v1/chat/completions
|
|
||||||
key: sk-XXXXXX
|
|
||||||
@@ -49,7 +49,7 @@ server:
|
|||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
org.dromara: @logging.level@
|
org.ruoyi: @logging.level@
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
org.mybatis.spring.mapper: error
|
org.mybatis.spring.mapper: error
|
||||||
org.apache.fury: warn
|
org.apache.fury: warn
|
||||||
@@ -120,6 +120,8 @@ sa-token:
|
|||||||
security:
|
security:
|
||||||
# 排除路径
|
# 排除路径
|
||||||
excludes:
|
excludes:
|
||||||
|
# 获取模型信息
|
||||||
|
- /system/model/modelList
|
||||||
# 支付回调
|
# 支付回调
|
||||||
- /pay/returnUrl
|
- /pay/returnUrl
|
||||||
- /pay/notifyUrl
|
- /pay/notifyUrl
|
||||||
@@ -128,7 +130,9 @@ security:
|
|||||||
# 重置密码
|
# 重置密码
|
||||||
- /auth/reset/password
|
- /auth/reset/password
|
||||||
# 聊天接口
|
# 聊天接口
|
||||||
- /chat
|
- /chat/send
|
||||||
|
# 文件上传
|
||||||
|
- /chat/upload
|
||||||
# 静态资源
|
# 静态资源
|
||||||
- /*.html
|
- /*.html
|
||||||
- /**/*.html
|
- /**/*.html
|
||||||
@@ -291,26 +295,6 @@ websocket:
|
|||||||
# 设置访问源地址
|
# 设置访问源地址
|
||||||
allowedOrigins: '*'
|
allowedOrigins: '*'
|
||||||
|
|
||||||
# 微信小程序配置信息
|
|
||||||
wx:
|
|
||||||
miniapp:
|
|
||||||
configs:
|
|
||||||
- appid: # 你的appid
|
|
||||||
secret: # 你的secret
|
|
||||||
token: #微信小程序消息服务器配置的token
|
|
||||||
aesKey: #微信小程序消息服务器配置的EncodingAESKey
|
|
||||||
msgDataFormat: JSON
|
|
||||||
|
|
||||||
# 企业微信应用
|
|
||||||
wechat:
|
|
||||||
cp:
|
|
||||||
corpId:
|
|
||||||
appConfigs:
|
|
||||||
- agentId:
|
|
||||||
secret: ''
|
|
||||||
token: ''
|
|
||||||
aesKey: ''
|
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
ai:
|
ai:
|
||||||
openai:
|
openai:
|
||||||
|
|||||||
@@ -39,9 +39,7 @@
|
|||||||
<module>ruoyi-common-encrypt</module>
|
<module>ruoyi-common-encrypt</module>
|
||||||
<module>ruoyi-common-tenant</module>
|
<module>ruoyi-common-tenant</module>
|
||||||
<module>ruoyi-common-chat</module>
|
<module>ruoyi-common-chat</module>
|
||||||
<module>ruoyi-common-wechat</module>
|
|
||||||
<module>ruoyi-common-pay</module>
|
<module>ruoyi-common-pay</module>
|
||||||
<module>ruoyi-common-live</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import okhttp3.Response;
|
|||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
import okhttp3.sse.EventSource;
|
import okhttp3.sse.EventSource;
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletionResponse;
|
||||||
import org.ruoyi.common.chat.entity.chat.Message;
|
|
||||||
import org.springframework.web.socket.TextMessage;
|
import org.springframework.web.socket.TextMessage;
|
||||||
import org.springframework.web.socket.WebSocketSession;
|
import org.springframework.web.socket.WebSocketSession;
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import okhttp3.MediaType;
|
|||||||
import okhttp3.MultipartBody;
|
import okhttp3.MultipartBody;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
import org.ruoyi.common.chat.constant.OpenAIConst;
|
||||||
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
||||||
import org.ruoyi.common.chat.entity.billing.Subscription;
|
import org.ruoyi.common.chat.entity.billing.Subscription;
|
||||||
@@ -45,7 +46,6 @@ import org.ruoyi.common.chat.openai.interceptor.OpenAiAuthInterceptor;
|
|||||||
import org.ruoyi.common.chat.openai.plugin.PluginAbstract;
|
import org.ruoyi.common.chat.openai.plugin.PluginAbstract;
|
||||||
import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
||||||
import org.ruoyi.common.core.exception.base.BaseException;
|
import org.ruoyi.common.core.exception.base.BaseException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||||
import retrofit2.converter.jackson.JacksonConverterFactory;
|
import retrofit2.converter.jackson.JacksonConverterFactory;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import okhttp3.*;
|
|||||||
import okhttp3.sse.EventSource;
|
import okhttp3.sse.EventSource;
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import okhttp3.sse.EventSources;
|
import okhttp3.sse.EventSources;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.constant.OpenAIConst;
|
import org.ruoyi.common.chat.constant.OpenAIConst;
|
||||||
import org.ruoyi.common.chat.entity.Tts.TextToSpeech;
|
import org.ruoyi.common.chat.entity.Tts.TextToSpeech;
|
||||||
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
import org.ruoyi.common.chat.entity.billing.BillingUsage;
|
||||||
@@ -27,7 +28,6 @@ import org.ruoyi.common.chat.entity.images.ImageResponse;
|
|||||||
import org.ruoyi.common.chat.entity.models.Model;
|
import org.ruoyi.common.chat.entity.models.Model;
|
||||||
import org.ruoyi.common.chat.entity.models.ModelResponse;
|
import org.ruoyi.common.chat.entity.models.ModelResponse;
|
||||||
import org.ruoyi.common.chat.entity.whisper.Transcriptions;
|
import org.ruoyi.common.chat.entity.whisper.Transcriptions;
|
||||||
import org.ruoyi.common.chat.entity.whisper.Translations;
|
|
||||||
import org.ruoyi.common.chat.entity.whisper.WhisperResponse;
|
import org.ruoyi.common.chat.entity.whisper.WhisperResponse;
|
||||||
import org.ruoyi.common.chat.openai.exception.CommonError;
|
import org.ruoyi.common.chat.openai.exception.CommonError;
|
||||||
import org.ruoyi.common.chat.openai.function.KeyRandomStrategy;
|
import org.ruoyi.common.chat.openai.function.KeyRandomStrategy;
|
||||||
@@ -40,7 +40,6 @@ import org.ruoyi.common.chat.openai.plugin.PluginParam;
|
|||||||
import org.ruoyi.common.chat.sse.DefaultPluginListener;
|
import org.ruoyi.common.chat.sse.DefaultPluginListener;
|
||||||
import org.ruoyi.common.chat.sse.PluginListener;
|
import org.ruoyi.common.chat.sse.PluginListener;
|
||||||
import org.ruoyi.common.core.exception.base.BaseException;
|
import org.ruoyi.common.core.exception.base.BaseException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Retrofit;
|
import retrofit2.Retrofit;
|
||||||
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||||
@@ -145,13 +144,15 @@ public class OpenAiStreamClient {
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
okHttpClient = builder.okHttpClient;
|
okHttpClient = builder.okHttpClient;
|
||||||
|
if (apiHost.endsWith("/")) {
|
||||||
|
this.openAiApi = new Retrofit.Builder()
|
||||||
|
.baseUrl(apiHost)
|
||||||
|
.client(okHttpClient)
|
||||||
|
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||||
|
.addConverterFactory(JacksonConverterFactory.create())
|
||||||
|
.build().create(OpenAiApi.class);
|
||||||
|
}
|
||||||
|
|
||||||
// this.openAiApi = new Retrofit.Builder()
|
|
||||||
// .baseUrl(apiHost)
|
|
||||||
// .client(okHttpClient)
|
|
||||||
// .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
|
||||||
// .addConverterFactory(JacksonConverterFactory.create())
|
|
||||||
// .build().create(OpenAiApi.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,16 +36,6 @@ public class ChatRequest {
|
|||||||
*/
|
*/
|
||||||
private Boolean stream = Boolean.TRUE;
|
private Boolean stream = Boolean.TRUE;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否开启联网搜索(0关闭 1开启)
|
|
||||||
*/
|
|
||||||
private Boolean search = Boolean.FALSE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否开启mcp
|
|
||||||
*/
|
|
||||||
private Boolean isMcp = Boolean.FALSE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 知识库id
|
* 知识库id
|
||||||
*/
|
*/
|
||||||
@@ -56,7 +46,6 @@ public class ChatRequest {
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会话id
|
* 会话id
|
||||||
*/
|
*/
|
||||||
@@ -72,16 +61,4 @@ public class ChatRequest {
|
|||||||
*/
|
*/
|
||||||
private String role;
|
private String role;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上下文的条数
|
|
||||||
*/
|
|
||||||
private Integer contentNumber = 10;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否携带上下文
|
|
||||||
*/
|
|
||||||
private Boolean usingContext = Boolean.TRUE;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package org.ruoyi.common.chat.sse;
|
package org.ruoyi.common.chat.sse;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import okhttp3.sse.EventSourceListener;
|
import okhttp3.sse.EventSourceListener;
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
||||||
import org.ruoyi.common.chat.openai.OpenAiStreamClient;
|
import org.ruoyi.common.chat.openai.OpenAiStreamClient;
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import com.knuddels.jtokkit.api.EncodingRegistry;
|
|||||||
import com.knuddels.jtokkit.api.EncodingType;
|
import com.knuddels.jtokkit.api.EncodingType;
|
||||||
import com.knuddels.jtokkit.api.ModelType;
|
import com.knuddels.jtokkit.api.ModelType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
import org.ruoyi.common.chat.entity.chat.ChatCompletion;
|
||||||
import org.ruoyi.common.chat.entity.chat.FunctionCall;
|
import org.ruoyi.common.chat.entity.chat.FunctionCall;
|
||||||
import org.ruoyi.common.chat.entity.chat.Message;
|
import org.ruoyi.common.chat.entity.chat.Message;
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|||||||
@@ -82,24 +82,6 @@
|
|||||||
<artifactId>ip2region</artifactId>
|
<artifactId>ip2region</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-cp</artifactId>
|
|
||||||
<version>${weixin-java-cp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-miniapp</artifactId>
|
|
||||||
<version>${weixin-java-miniapp.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.binarywang</groupId>
|
|
||||||
<artifactId>weixin-java-pay</artifactId>
|
|
||||||
<version>${weixin-java-pay.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- JSON工具类 -->
|
<!-- JSON工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package org.ruoyi.common.core.factory;
|
|||||||
import cn.hutool.core.lang.PatternPool;
|
import cn.hutool.core.lang.PatternPool;
|
||||||
import org.ruoyi.common.core.constant.RegexConstants;
|
import org.ruoyi.common.core.constant.RegexConstants;
|
||||||
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import cn.hutool.core.io.FileUtil;
|
|||||||
import cn.hutool.core.io.resource.ClassPathResource;
|
import cn.hutool.core.io.resource.ClassPathResource;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.lionsoul.ip2region.xdb.Searcher;
|
||||||
import org.ruoyi.common.core.exception.ServiceException;
|
import org.ruoyi.common.core.exception.ServiceException;
|
||||||
import org.ruoyi.common.core.utils.file.FileUtils;
|
import org.ruoyi.common.core.utils.file.FileUtils;
|
||||||
import org.lionsoul.ip2region.xdb.Searcher;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
<!--
|
|
||||||
~ MIT License
|
|
||||||
~
|
|
||||||
~ Copyright (c) 2023 OrdinaryRoad
|
|
||||||
~
|
|
||||||
~ Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
~ of this software and associated documentation files (the "Software"), to deal
|
|
||||||
~ in the Software without restriction, including without limitation the rights
|
|
||||||
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
~ copies of the Software, and to permit persons to whom the Software is
|
|
||||||
~ furnished to do so, subject to the following conditions:
|
|
||||||
~
|
|
||||||
~ The above copyright notice and this permission notice shall be included in all
|
|
||||||
~ copies or substantial portions of the Software.
|
|
||||||
~
|
|
||||||
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
~ SOFTWARE.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>live-chat-client-commons</artifactId>
|
|
||||||
<version>${revision}</version>
|
|
||||||
<relativePath>../pom.xml</relativePath>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>live-chat-client-commons-base</artifactId>
|
|
||||||
<name>ordinaryroad-live-chat-client-commons-base</name>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.constant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
public class Constants {
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/9/5
|
|
||||||
*/
|
|
||||||
public class BaseException extends RuntimeException {
|
|
||||||
|
|
||||||
public BaseException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseException(String message, Throwable cause) {
|
|
||||||
super(message, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseException(Throwable cause) {
|
|
||||||
super(cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
|
||||||
super(message, cause, enableSuppression, writableStackTrace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 连接回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
public interface IBaseConnectionListener<T> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 连接建立成功
|
|
||||||
*/
|
|
||||||
default void onConnected(T t) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 连接建立失败
|
|
||||||
*
|
|
||||||
* @param t
|
|
||||||
*/
|
|
||||||
default void onConnectFailed(T t) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 连接断开
|
|
||||||
*
|
|
||||||
* @param t
|
|
||||||
*/
|
|
||||||
default void onDisconnected(T t) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseCmdMsg;
|
|
||||||
import tech.ordinaryroad.live.chat.client.commons.base.msg.BaseMsg;
|
|
||||||
import tech.ordinaryroad.live.chat.client.commons.base.msg.ICmdMsg;
|
|
||||||
import tech.ordinaryroad.live.chat.client.commons.base.msg.IMsg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
public interface IBaseMsgListener<T, CmdEnum extends Enum<CmdEnum>> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到消息(所有消息)
|
|
||||||
*
|
|
||||||
* @param msg IMsg
|
|
||||||
*/
|
|
||||||
default void onMsg(T t, IMsg msg) {
|
|
||||||
this.onMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onMsg(IMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到cmd消息(所有cmd)
|
|
||||||
*
|
|
||||||
* @param cmd CmdEnum
|
|
||||||
* @param cmdMsg BaseCmdMsg
|
|
||||||
*/
|
|
||||||
default void onCmdMsg(T t, CmdEnum cmd, ICmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
this.onCmdMsg(cmd, cmdMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onCmdMsg(CmdEnum cmd, ICmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到其他cmd消息(存在Enum,但Listener没有对应的回调)
|
|
||||||
*
|
|
||||||
* @param cmd CmdEnum
|
|
||||||
* @param cmdMsg BaseCmdMsg
|
|
||||||
*/
|
|
||||||
default void onOtherCmdMsg(T t, CmdEnum cmd, ICmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
this.onOtherCmdMsg(cmd, cmdMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onOtherCmdMsg(CmdEnum cmd, ICmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到未知cmd消息
|
|
||||||
*
|
|
||||||
* @param cmdString 实际收到的cmd字符串
|
|
||||||
* @param msg BaseMsg
|
|
||||||
*/
|
|
||||||
default void onUnknownCmd(T t, String cmdString, IMsg msg) {
|
|
||||||
this.onUnknownCmd(cmdString, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onUnknownCmd(String cmdString, IMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到cmd消息(所有cmd)
|
|
||||||
*
|
|
||||||
* @param cmd CmdEnum
|
|
||||||
* @param cmdMsg BaseCmdMsg
|
|
||||||
* @deprecated use {@link #onCmdMsg(T, Enum, ICmdMsg)}
|
|
||||||
*/
|
|
||||||
default void onCmdMsg(T t, CmdEnum cmd, BaseCmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
this.onCmdMsg(cmd, cmdMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use {@link #onCmdMsg(Enum, ICmdMsg)}
|
|
||||||
*/
|
|
||||||
default void onCmdMsg(CmdEnum cmd, BaseCmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到其他cmd消息(存在Enum,但Listener没有对应的回调)
|
|
||||||
*
|
|
||||||
* @param cmd CmdEnum
|
|
||||||
* @param cmdMsg BaseCmdMsg
|
|
||||||
* @deprecated use {@link #onOtherCmdMsg(T, Enum, ICmdMsg)}
|
|
||||||
*/
|
|
||||||
default void onOtherCmdMsg(T t, CmdEnum cmd, BaseCmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
this.onOtherCmdMsg(cmd, cmdMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use {@link #onOtherCmdMsg(Enum, ICmdMsg)}
|
|
||||||
*/
|
|
||||||
default void onOtherCmdMsg(CmdEnum cmd, BaseCmdMsg<CmdEnum> cmdMsg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到未知cmd消息
|
|
||||||
*
|
|
||||||
* @param cmdString 实际收到的cmd字符串
|
|
||||||
* @param msg BaseMsg
|
|
||||||
* @deprecated use {@link #onUnknownCmd(T, String, IMsg)}
|
|
||||||
*/
|
|
||||||
default void onUnknownCmd(T t, String cmdString, BaseMsg msg) {
|
|
||||||
this.onUnknownCmd(cmdString, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated use {@link #onUnknownCmd(String, IMsg)}
|
|
||||||
*/
|
|
||||||
default void onUnknownCmd(String cmdString, BaseMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹幕消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @since 0.0.6
|
|
||||||
*/
|
|
||||||
public interface IDanmuMsgListener<T, DanmuMsg> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到弹幕
|
|
||||||
*/
|
|
||||||
default void onDanmuMsg(T t, DanmuMsg msg) {
|
|
||||||
this.onDanmuMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onDanmuMsg(DanmuMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 进入房间消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/12/14
|
|
||||||
* @since 0.0.16
|
|
||||||
*/
|
|
||||||
public interface IEnterRoomMsgListener<T, EnterRoomMsg> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户进入房间
|
|
||||||
*/
|
|
||||||
default void onEnterRoomMsg(T t, EnterRoomMsg msg) {
|
|
||||||
this.onEnterRoomMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onEnterRoomMsg(EnterRoomMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 礼物消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @since 0.0.8
|
|
||||||
*/
|
|
||||||
public interface IGiftMsgListener<T, GiftMsg> {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到礼物
|
|
||||||
*/
|
|
||||||
default void onGiftMsg(T t, GiftMsg msg) {
|
|
||||||
this.onGiftMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onGiftMsg(GiftMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @since 0.2.0
|
|
||||||
*/
|
|
||||||
public interface ILikeMsgListener<T, LikeMsg> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到点赞
|
|
||||||
*/
|
|
||||||
default void onLikeMsg(T t, LikeMsg msg) {
|
|
||||||
this.onLikeMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onLikeMsg(LikeMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.listener;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 醒目留言消息回调
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/9/24
|
|
||||||
* @since 0.0.11
|
|
||||||
*/
|
|
||||||
public interface ISuperChatMsgListener<T, SuperChatMsg> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收到醒目留言
|
|
||||||
*/
|
|
||||||
default void onSuperChatMsg(T t, SuperChatMsg msg) {
|
|
||||||
this.onSuperChatMsg(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
default void onSuperChatMsg(SuperChatMsg msg) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.msg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
public abstract class BaseCmdMsg<CmdEnum extends Enum<CmdEnum>> extends BaseMsg
|
|
||||||
implements ICmdMsg<CmdEnum> {
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2023 OrdinaryRoad
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.msg;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonAnyGetter;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonAnySetter;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import tech.ordinaryroad.live.chat.client.commons.base.exception.BaseException;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
public abstract class BaseMsg implements IMsg {
|
|
||||||
|
|
||||||
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
|
|
||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
|
||||||
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 未知属性都放在这
|
|
||||||
*/
|
|
||||||
private final Map<String, JsonNode> unknownProperties = new HashMap<>();
|
|
||||||
|
|
||||||
@JsonAnyGetter
|
|
||||||
public Map<String, JsonNode> getUnknownProperties() {
|
|
||||||
return unknownProperties;
|
|
||||||
}
|
|
||||||
|
|
||||||
@JsonAnySetter
|
|
||||||
public void setOther(String key, JsonNode value) {
|
|
||||||
this.unknownProperties.put(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
try {
|
|
||||||
return OBJECT_MAPPER.writeValueAsString(this);
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new BaseException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||