Compare commits
79 Commits
| 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 | ||
|
|
93ddcd53b1 | ||
|
|
0ee47a5c00 | ||
|
|
3ceef41ab0 | ||
|
|
57693059a1 | ||
|
|
d18e307e10 | ||
|
|
eed708c6d3 | ||
|
|
1093888889 | ||
|
|
e58a420f9f | ||
|
|
4a0c3d132a | ||
|
|
0d81aa640e | ||
|
|
951524bff7 | ||
|
|
c7d0e9337a | ||
|
|
6955f3c7dc | ||
|
|
a52b017e1a | ||
|
|
158a0190b5 | ||
|
|
096fc11313 | ||
|
|
e9ac795d23 | ||
|
|
32f1a6bab1 | ||
|
|
052069a2df | ||
|
|
e1c997883f | ||
|
|
031b7da198 | ||
|
|
931af963b1 | ||
|
|
f5fa7d5da8 | ||
|
|
c6ffbcb3cf | ||
|
|
05ae200ff5 | ||
|
|
e745f772ef | ||
|
|
584212c569 | ||
|
|
dc9bf3e25d | ||
|
|
da84a26c47 | ||
|
|
7d3282c347 | ||
|
|
4454be44c3 | ||
|
|
52e0feda01 | ||
|
|
c89f5d07fb | ||
|
|
778a7bc21b | ||
|
|
50f5f38996 | ||
|
|
32da85daab | ||
|
|
3666157d14 |
104
README.md
@@ -34,6 +34,60 @@
|
|||||||
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
<a href="https://github.com/ageerle/ruoyi-ai/issues">提出新特性</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
## 快速启动
|
||||||
|
|
||||||
|
### 拉取镜像(最低配置2H2G):
|
||||||
|
```bash
|
||||||
|
script/deploy/deploy目录下执行: docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
### 通过脚本启动(最低配置4H4G):
|
||||||
|
1. 确认系统内已经安装好以下软件
|
||||||
|
- docker
|
||||||
|
- docker-compose
|
||||||
|
- git
|
||||||
|
- unzip
|
||||||
|
|
||||||
|
2. **克隆项目**
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/ageerle/ruoyi-ai
|
||||||
|
cd ruoyi-ai/script/deploy/one-step-script
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **启动部署脚本**
|
||||||
|
|
||||||
|
中文界面部署脚本(拉取gitee仓库):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./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
|
||||||
|
./deploy-en.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
4. 如果在执行部署脚本过程中不需要在本地重新构建编译服务软件包以及重新封装容器镜像,则需要在脚本交互提出以下问题时选择D按键进行直接部署,否则就会执行全新的编译构建及容器封装之后再执行部署:
|
||||||
|
```
|
||||||
|
已将模板文件复制到部署目录。
|
||||||
|
正在使用您的配置更新 .env 文件...
|
||||||
|
已使用您的配置更新 .env 文件。
|
||||||
|
正在使用您的配置更新 docker-compose.yaml 文件...
|
||||||
|
已使用您的配置更新 docker-compose.yaml 文件。
|
||||||
|
|
||||||
|
=== 构建或部署选项 ===
|
||||||
|
您想构建新镜像 (B) 还是直接使用现有镜像部署 (D)?[B/d]:
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **访问应用界面**
|
||||||
|
- 用户界面:`http://your-server-ip:8081`
|
||||||
|
- 管理员界面:`http://your-server-ip:8082`
|
||||||
|
|
||||||
## 目录
|
## 目录
|
||||||
|
|
||||||
- [系统体验](#系统体验)
|
- [系统体验](#系统体验)
|
||||||
@@ -43,7 +97,6 @@
|
|||||||
- [项目演示](#项目演示)
|
- [项目演示](#项目演示)
|
||||||
- [管理端](#管理端)
|
- [管理端](#管理端)
|
||||||
- [用户端](#用户端)
|
- [用户端](#用户端)
|
||||||
- [小程序端](#小程序端)
|
|
||||||
- [开发环境](#开发环境)
|
- [开发环境](#开发环境)
|
||||||
- [项目结构](#项目结构)
|
- [项目结构](#项目结构)
|
||||||
- [ruoyi-ai](#ruoyi-ai)
|
- [ruoyi-ai](#ruoyi-ai)
|
||||||
@@ -58,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
|
||||||
|
|
||||||
### 配套文档
|
### 配套文档
|
||||||
@@ -80,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 接入,结合私有知识库实现安全可控的问答系统,避免依赖云端服务的隐私风险。
|
||||||
@@ -104,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;">
|
||||||
@@ -120,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
|
||||||
@@ -269,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>
|
||||||
|
|
||||||
|
|||||||
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>
|
||||||
|
|||||||
@@ -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,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,3 +85,4 @@ sms:
|
|||||||
# 腾讯专用
|
# 腾讯专用
|
||||||
sdkAppId:
|
sdkAppId:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
@@ -68,14 +57,8 @@ public class ChatRequest {
|
|||||||
private String appId;
|
private String appId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上下文的条数
|
* 对话角色
|
||||||
*/
|
*/
|
||||||
private Integer contentNumber = 10;
|
private String role;
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否携带上下文
|
|
||||||
*/
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +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/10/2
|
|
||||||
*/
|
|
||||||
public interface ICmdMsg<CmdEnum extends Enum<CmdEnum>> extends IMsg {
|
|
||||||
|
|
||||||
String getCmd();
|
|
||||||
|
|
||||||
void setCmd(String cmd);
|
|
||||||
|
|
||||||
CmdEnum getCmdEnum();
|
|
||||||
}
|
|
||||||
@@ -1,67 +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/9/8
|
|
||||||
*/
|
|
||||||
public interface IDanmuMsg extends IMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌名称
|
|
||||||
*/
|
|
||||||
String getBadgeName();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌等级
|
|
||||||
*/
|
|
||||||
byte getBadgeLevel();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹幕发送者id
|
|
||||||
*/
|
|
||||||
String getUid();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹幕发送者用户名
|
|
||||||
*/
|
|
||||||
String getUsername();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹幕发送者头像地址
|
|
||||||
*
|
|
||||||
* @since 0.0.11
|
|
||||||
*/
|
|
||||||
default String getUserAvatar() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 弹幕内容
|
|
||||||
*/
|
|
||||||
String getContent();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,62 +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/12/26
|
|
||||||
* @since 0.0.16
|
|
||||||
*/
|
|
||||||
public interface IEnterRoomMsg extends IMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌名称
|
|
||||||
*/
|
|
||||||
String getBadgeName();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌等级
|
|
||||||
*/
|
|
||||||
byte getBadgeLevel();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户id
|
|
||||||
*/
|
|
||||||
String getUid();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户名
|
|
||||||
*/
|
|
||||||
String getUsername();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 头像地址
|
|
||||||
*/
|
|
||||||
default String getUserAvatar() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,100 +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/9/8
|
|
||||||
*/
|
|
||||||
public interface IGiftMsg extends IMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌名称
|
|
||||||
*/
|
|
||||||
default String getBadgeName() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌等级
|
|
||||||
*/
|
|
||||||
default byte getBadgeLevel() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送方id
|
|
||||||
*/
|
|
||||||
String getUid();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送方用户名
|
|
||||||
*/
|
|
||||||
String getUsername();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送方头像地址
|
|
||||||
*
|
|
||||||
* @since 0.0.11
|
|
||||||
*/
|
|
||||||
default String getUserAvatar() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 礼物名称
|
|
||||||
*/
|
|
||||||
String getGiftName();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 礼物图像地址
|
|
||||||
*/
|
|
||||||
String getGiftImg();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 礼物id
|
|
||||||
*/
|
|
||||||
String getGiftId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 礼物数量
|
|
||||||
*/
|
|
||||||
int getGiftCount();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单个礼物价格
|
|
||||||
*/
|
|
||||||
int getGiftPrice();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接收方id
|
|
||||||
*/
|
|
||||||
String getReceiveUid();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接收方用户名
|
|
||||||
*/
|
|
||||||
String getReceiveUsername();
|
|
||||||
}
|
|
||||||
@@ -1,71 +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 2024/1/31
|
|
||||||
* @since 0.2.0
|
|
||||||
*/
|
|
||||||
public interface ILikeMsg extends IMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌名称
|
|
||||||
*/
|
|
||||||
default String getBadgeName(){
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 粉丝牌等级
|
|
||||||
*/
|
|
||||||
default byte getBadgeLevel(){
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞者id
|
|
||||||
*/
|
|
||||||
String getUid();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞者用户名
|
|
||||||
*/
|
|
||||||
String getUsername();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞者头像地址
|
|
||||||
*/
|
|
||||||
default String getUserAvatar() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞数
|
|
||||||
*/
|
|
||||||
default int getClickCount() {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +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 java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/8/26
|
|
||||||
*/
|
|
||||||
public interface IMsg extends Serializable {
|
|
||||||
}
|
|
||||||
@@ -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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package tech.ordinaryroad.live.chat.client.commons.base.msg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 醒目留言
|
|
||||||
*
|
|
||||||
* @author mjz
|
|
||||||
* @date 2023/9/22
|
|
||||||
*/
|
|
||||||
public interface ISuperChatMsg extends IDanmuMsg {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 醒目留言持续时间,单位秒
|
|
||||||
*/
|
|
||||||
int getDuration();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
default String getBadgeName() {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
default byte getBadgeLevel() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +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>
|
|
||||||
<packaging>jar</packaging>
|
|
||||||
|
|
||||||
<artifactId>live-chat-client-commons-client</artifactId>
|
|
||||||
<name>live-chat-client-commons-client</name>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>live-chat-client-commons-base</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.ruoyi</groupId>
|
|
||||||
<artifactId>live-chat-client-commons-util</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
|
||||||