mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-10 18:27:07 +00:00
v1.0.3
This commit is contained in:
16
README.md
16
README.md
@@ -63,7 +63,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
## 语音克隆
|
## 语音克隆
|
||||||
https://github.com/ageerle/ruoyi-ai/assets/32251822/62c60f2a-add0-421b-8e32-16ed6a3e598b
|
|
||||||
|
|
||||||
|
https://github.com/ageerle/ruoyi-ai/assets/32251822/c3dd75eb-c5bd-4ab0-93bf-9221f4888827
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 弹幕助手
|
## 弹幕助手
|
||||||
|
|
||||||
@@ -72,10 +76,14 @@ https://github.com/ageerle/ruoyi-ai/assets/32251822/2d809d94-6cfb-41b1-9dc0-a72c
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 私有知识库管理(开发中)
|
## 私有知识库管理
|
||||||
<div>
|
<div>
|
||||||
<img style="margin-top:10px" src="./image/12.png" alt="drawing" width="550px" height="300px"/>
|
<img style="margin-top:10px;width:50%" src="./image/12.png" alt="drawing" width="550px" height="300px"/>
|
||||||
<img style="margin-top:10px" src="./image/私有知识库业务架构图.drawio.png" alt="drawing" width="550px" height="300px"/>
|
<img style="margin-top:10px;width:50%" src="./image/私有知识库业务架构图.drawio.png" alt="drawing" width="550px" height="300px"/>
|
||||||
|
<img style="margin-top:10px;width:50%" src="https://github.com/ageerle/ruoyi-ai/assets/32251822/6d44ebcc-1ec4-43e0-b164-cac150e8a044" alt="drawing" width="550px" height="300px"/>
|
||||||
|
<img style="margin-top:10px;width:50%" src="https://github.com/ageerle/ruoyi-ai/assets/32251822/fbd50daf-19d9-4e0f-8e5e-8603af5fb520" alt="drawing" width="550px" height="300px"/>
|
||||||
|
<img style="margin-top:10px;width:50%" src="https://github.com/ageerle/ruoyi-ai/assets/32251822/b14dffe7-2ae1-4fa3-8bb0-bf0b44d7ebd9" alt="drawing" width="550px" height="300px"/>
|
||||||
|
<img style="margin-top:10px;width:50%" src="https://github.com/ageerle/ruoyi-ai/assets/32251822/4ae97a41-f1d2-4bb2-966f-83211193a115" alt="drawing" width="550px" height="300px"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## 进群学习
|
## 进群学习
|
||||||
|
|||||||
BIN
image/02.png
Normal file
BIN
image/02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
2
pom.xml
2
pom.xml
@@ -324,6 +324,8 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xmzs</groupId>
|
<groupId>com.xmzs</groupId>
|
||||||
<artifactId>ruoyi-generator</artifactId>
|
<artifactId>ruoyi-generator</artifactId>
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
|
#基础镜像
|
||||||
FROM findepi/graalvm:java17-native
|
FROM findepi/graalvm:java17-native
|
||||||
|
|
||||||
MAINTAINER Lion Li
|
MAINTAINER ageerle
|
||||||
|
|
||||||
RUN mkdir -p /ruoyi/server/logs \
|
RUN mkdir -p /ruoyi/server/logs \
|
||||||
/ruoyi/server/temp \
|
/ruoyi/server/temp \
|
||||||
/ruoyi/skywalking/agent
|
/ruoyi/skywalking/agent
|
||||||
|
|
||||||
|
|
||||||
|
#工作空间
|
||||||
WORKDIR /ruoyi/server
|
WORKDIR /ruoyi/server
|
||||||
|
|
||||||
ENV SERVER_PORT=8080
|
ENV SERVER_PORT=6039
|
||||||
|
|
||||||
EXPOSE ${SERVER_PORT}
|
EXPOSE ${SERVER_PORT}
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,9 @@
|
|||||||
<artifactId>ruoyi-midjourney</artifactId>
|
<artifactId>ruoyi-midjourney</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 代码生成-->
|
<!-- 代码生成-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xmzs</groupId>
|
<groupId>com.xmzs</groupId>
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ public class AuthController {
|
|||||||
private final SysRegisterService registerService;
|
private final SysRegisterService registerService;
|
||||||
private final ISysTenantService tenantService;
|
private final ISysTenantService tenantService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public class CaptchaController {
|
|||||||
*
|
*
|
||||||
* @param emailRequest 用户邮箱
|
* @param emailRequest 用户邮箱
|
||||||
*/
|
*/
|
||||||
|
//@PostMapping("/resource/email/code")
|
||||||
@PostMapping("/resource/email/code")
|
@PostMapping("/resource/email/code")
|
||||||
public R<Void> emailCode(@RequestBody @Valid EmailRequest emailRequest) {
|
public R<Void> emailCode(@RequestBody @Valid EmailRequest emailRequest) {
|
||||||
if (!mailProperties.getEnabled()) {
|
if (!mailProperties.getEnabled()) {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package com.xmzs.controller;
|
|||||||
|
|
||||||
import com.xmzs.common.chat.domain.request.ChatRequest;
|
import com.xmzs.common.chat.domain.request.ChatRequest;
|
||||||
import com.xmzs.common.chat.domain.request.Dall3Request;
|
import com.xmzs.common.chat.domain.request.Dall3Request;
|
||||||
import com.xmzs.common.chat.domain.request.MjTaskRequest;
|
|
||||||
import com.xmzs.common.chat.entity.Tts.TextToSpeech;
|
import com.xmzs.common.chat.entity.Tts.TextToSpeech;
|
||||||
|
import com.xmzs.common.chat.entity.files.UploadFileResponse;
|
||||||
import com.xmzs.common.chat.entity.images.Item;
|
import com.xmzs.common.chat.entity.images.Item;
|
||||||
import com.xmzs.common.chat.entity.whisper.WhisperResponse;
|
import com.xmzs.common.chat.entity.whisper.WhisperResponse;
|
||||||
import com.xmzs.common.core.domain.R;
|
import com.xmzs.common.core.domain.R;
|
||||||
@@ -21,25 +21,15 @@ import jakarta.servlet.http.HttpServletResponse;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.core.io.InputStreamResource;
|
import org.springframework.core.io.Resource;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import retrofit2.Response;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述:
|
* 描述:
|
||||||
*
|
*
|
||||||
@@ -64,6 +54,16 @@ public class ChatController {
|
|||||||
return ISseService.sseChat(chatRequest);
|
return ISseService.sseChat(chatRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*/
|
||||||
|
@PostMapping("/v1/upload")
|
||||||
|
@ResponseBody
|
||||||
|
public UploadFileResponse upload(@RequestPart("file") MultipartFile file) {
|
||||||
|
return ISseService.upload(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 语音转文本
|
* 语音转文本
|
||||||
*
|
*
|
||||||
@@ -94,18 +94,6 @@ public class ChatController {
|
|||||||
return R.ok(ISseService.dall3(request));
|
return R.ok(ISseService.dall3(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 扣除mj绘图费用
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/mjTask")
|
|
||||||
@ResponseBody
|
|
||||||
public R<String> mjTask(@RequestBody MjTaskRequest mjTaskRequest) {
|
|
||||||
ISseService.mjTask(mjTaskRequest);
|
|
||||||
return R.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 聊天记录
|
* 聊天记录
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import com.xmzs.system.domain.vo.SysUserVo;
|
|||||||
import com.xmzs.system.service.IPaymentOrdersService;
|
import com.xmzs.system.service.IPaymentOrdersService;
|
||||||
import com.xmzs.system.service.ISysUserService;
|
import com.xmzs.system.service.ISysUserService;
|
||||||
import com.xmzs.system.util.OrderNumberGenerator;
|
import com.xmzs.system.util.OrderNumberGenerator;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -43,15 +42,16 @@ public class PayController {
|
|||||||
|
|
||||||
private final IPaymentOrdersService paymentOrdersService;
|
private final IPaymentOrdersService paymentOrdersService;
|
||||||
|
|
||||||
|
private final PayConfig payConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取支付二维码
|
* 获取支付二维码
|
||||||
*
|
*
|
||||||
* @Date 2023/7/3
|
* @Date 2023/7/3
|
||||||
* @param response
|
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
@PostMapping("/payUrl")
|
@PostMapping("/payUrl")
|
||||||
public R<PaymentOrdersVo> payUrl(HttpServletResponse response, @RequestBody OrderRequest orderRequest) {
|
public R<PaymentOrdersVo> payUrl(@RequestBody OrderRequest orderRequest) {
|
||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
// 创建订单
|
// 创建订单
|
||||||
PaymentOrdersBo paymentOrders = new PaymentOrdersBo();
|
PaymentOrdersBo paymentOrders = new PaymentOrdersBo();
|
||||||
@@ -115,9 +115,9 @@ public class PayController {
|
|||||||
public String returnUrl(PayResponse payResponse) {
|
public String returnUrl(PayResponse payResponse) {
|
||||||
// 校验签名
|
// 校验签名
|
||||||
String mdString = "money=" + payResponse.getMoney() + "&name=" + payResponse.getName() +
|
String mdString = "money=" + payResponse.getMoney() + "&name=" + payResponse.getName() +
|
||||||
"&out_trade_no=" + payResponse.getOut_trade_no() + "&pid=" + PayConfig.pid +
|
"&out_trade_no=" + payResponse.getOut_trade_no() + "&pid=" + payConfig.getPid() +
|
||||||
"&trade_no=" + payResponse.getTrade_no() + "&trade_status=" + payResponse.getTrade_status() +
|
"&trade_no=" + payResponse.getTrade_no() + "&trade_status=" + payResponse.getTrade_status() +
|
||||||
"&type=" + payResponse.getType() + PayConfig.key;
|
"&type=" + payResponse.getType() + payConfig.getKey();
|
||||||
String sign = MD5Util.GetMD5Code(mdString);
|
String sign = MD5Util.GetMD5Code(mdString);
|
||||||
if(!sign.equals(payResponse.getSign())){
|
if(!sign.equals(payResponse.getSign())){
|
||||||
throw new BaseException("校验签名失败!");
|
throw new BaseException("校验签名失败!");
|
||||||
@@ -136,10 +136,8 @@ public class PayController {
|
|||||||
paymentOrdersVo.setPaymentMethod(payResponse.getType());
|
paymentOrdersVo.setPaymentMethod(payResponse.getType());
|
||||||
BeanUtil.copyProperties(paymentOrdersVo,paymentOrdersBo);
|
BeanUtil.copyProperties(paymentOrdersVo,paymentOrdersBo);
|
||||||
paymentOrdersService.updateByBo(paymentOrdersBo);
|
paymentOrdersService.updateByBo(paymentOrdersBo);
|
||||||
|
|
||||||
SysUserVo sysUserVo = userService.selectUserById(paymentOrdersVo.getUserId());
|
SysUserVo sysUserVo = userService.selectUserById(paymentOrdersVo.getUserId());
|
||||||
if(money>9.9){
|
|
||||||
money = money*2;
|
|
||||||
}
|
|
||||||
sysUserVo.setUserBalance(sysUserVo.getUserBalance()+money);
|
sysUserVo.setUserBalance(sysUserVo.getUserBalance()+money);
|
||||||
SysUserBo sysUserBo = new SysUserBo();
|
SysUserBo sysUserBo = new SysUserBo();
|
||||||
BeanUtil.copyProperties(sysUserVo,sysUserBo);
|
BeanUtil.copyProperties(sysUserVo,sysUserBo);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
--- # 监控中心配置
|
--- # 监控中心配置
|
||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: false
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090/admin
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
@@ -51,36 +51,36 @@ spring:
|
|||||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||||
url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
url: jdbc:mysql://127.0.0.1:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
username: ry-vue
|
username: ry-vue
|
||||||
password: xxx
|
password: ry-vue
|
||||||
|
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
# slave:
|
# slave:
|
||||||
# lazy: true
|
# lazy: true
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
# 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
|
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||||
# username:
|
# username:
|
||||||
# password:
|
# password:
|
||||||
# oracle:
|
# oracle:
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: oracle.jdbc.OracleDriver
|
# driverClassName: oracle.jdbc.OracleDriver
|
||||||
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
# url: jdbc:oracle:thin:@//localhost:1521/XE
|
||||||
# username: ROOT
|
# username: ROOT
|
||||||
# password: root
|
# password: root
|
||||||
# hikari:
|
# hikari:
|
||||||
# connectionTestQuery: SELECT 1 FROM DUAL
|
# connectionTestQuery: SELECT 1 FROM DUAL
|
||||||
# postgres:
|
# postgres:
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: org.postgresql.Driver
|
# driverClassName: org.postgresql.Driver
|
||||||
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
# url: jdbc:postgresql://localhost:5432/postgres?useUnicode=true&characterEncoding=utf8&useSSL=true&autoReconnect=true&reWriteBatchedInserts=true
|
||||||
# username: root
|
# username: root
|
||||||
# password: root
|
# password: root
|
||||||
# sqlserver:
|
# sqlserver:
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
# driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
# url: jdbc:sqlserver://localhost:1433;DatabaseName=tempdb;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true
|
||||||
# username: SA
|
# username: SA
|
||||||
# password: root
|
# password: root
|
||||||
hikari:
|
hikari:
|
||||||
# 最大连接池数量
|
# 最大连接池数量
|
||||||
maxPoolSize: 20
|
maxPoolSize: 20
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ spring.servlet.multipart.location: /ruoyi/server/temp
|
|||||||
--- # 监控中心配置
|
--- # 监控中心配置
|
||||||
spring.boot.admin.client:
|
spring.boot.admin.client:
|
||||||
# 增加客户端开关
|
# 增加客户端开关
|
||||||
enabled: true
|
enabled: false
|
||||||
url: http://localhost:9090/admin
|
url: http://localhost:9090/admin
|
||||||
instance:
|
instance:
|
||||||
service-host-type: IP
|
service-host-type: IP
|
||||||
|
|||||||
@@ -212,27 +212,6 @@ mybatis-encryptor:
|
|||||||
# 公私钥 非对称算法的公私钥 如:SM2,RSA
|
# 公私钥 非对称算法的公私钥 如:SM2,RSA
|
||||||
publicKey:
|
publicKey:
|
||||||
privateKey:
|
privateKey:
|
||||||
--- # mail 邮件发送
|
|
||||||
mail:
|
|
||||||
enabled: true
|
|
||||||
host: smtp.163.com
|
|
||||||
port: 465
|
|
||||||
# 是否需要用户名密码验证
|
|
||||||
auth: true
|
|
||||||
# 发送方,遵循RFC-822标准
|
|
||||||
from: ageerle@163.com
|
|
||||||
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
|
||||||
user: ageerle@163.com
|
|
||||||
# 密码(填写授权码)
|
|
||||||
pass: xxxx
|
|
||||||
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
|
||||||
starttlsEnable: true
|
|
||||||
# 使用SSL安全连接
|
|
||||||
sslEnable: true
|
|
||||||
# SMTP超时时长,单位毫秒,缺省值不超时
|
|
||||||
timeout: 0
|
|
||||||
# Socket连接超时值,单位毫秒,缺省值不超时
|
|
||||||
connectionTimeout: 0
|
|
||||||
|
|
||||||
# Swagger配置
|
# Swagger配置
|
||||||
swagger:
|
swagger:
|
||||||
@@ -313,15 +292,12 @@ management:
|
|||||||
|
|
||||||
--- # websocket
|
--- # websocket
|
||||||
websocket:
|
websocket:
|
||||||
enabled: true
|
enabled: false
|
||||||
# 路径
|
# 路径
|
||||||
path: ''
|
path: ''
|
||||||
# 设置访问源地址
|
# 设置访问源地址
|
||||||
allowedOrigins: '*'
|
allowedOrigins: '*'
|
||||||
# chatgpt配置信息
|
|
||||||
chat:
|
|
||||||
apiKey: 'sk-xxx'
|
|
||||||
apiHost: 'https://api.pandarobot.chat/'
|
|
||||||
# 微信小程序配置信息
|
# 微信小程序配置信息
|
||||||
wx:
|
wx:
|
||||||
miniapp:
|
miniapp:
|
||||||
@@ -338,6 +314,8 @@ baidu:
|
|||||||
textReview:
|
textReview:
|
||||||
apiKey: '' # apiKey
|
apiKey: '' # apiKey
|
||||||
secretKey: '' # secretKey
|
secretKey: '' # secretKey
|
||||||
|
appKey: xxxxxxxxxxxxxxxxx
|
||||||
|
secretKey: xxxxxxxxxxxxxxxxxxxxxxx
|
||||||
|
|
||||||
wechat:
|
wechat:
|
||||||
# 是否使用微信 true/false
|
# 是否使用微信 true/false
|
||||||
@@ -353,23 +331,62 @@ keyword:
|
|||||||
image: "ai画图"
|
image: "ai画图"
|
||||||
# ai语音指令(TTS模型 https://platform.openai.com/docs/api-reference/audio)
|
# ai语音指令(TTS模型 https://platform.openai.com/docs/api-reference/audio)
|
||||||
audio: "ai语音"
|
audio: "ai语音"
|
||||||
|
|
||||||
mj:
|
mj:
|
||||||
api-secret:
|
api-secret: 'sk-xx'
|
||||||
task-store:
|
task-store:
|
||||||
type: in_memory
|
type: in_memory
|
||||||
timeout: 30d
|
timeout: 30d
|
||||||
translate-way: gpt
|
translate-way: gpt
|
||||||
# proxy:
|
# proxy:
|
||||||
# host: 127.0.0.1
|
# host: 127.0.0.1
|
||||||
# port: 10809
|
# port: 10809
|
||||||
ng-discord:
|
ng-discord:
|
||||||
server: https://discord.pandarobot.chat/
|
server: 'https://xxx.pandarobot.chat/'
|
||||||
cdn: https://app.pandarobot.chat/
|
cdn: 'https://xxx.pandarobot.chat/'
|
||||||
wss: https://gateway.pandarobot.chat/
|
wss: 'https://xxx.pandarobot.chat/'
|
||||||
openai:
|
openai:
|
||||||
gpt-api-url: 'https://api.gptgod.online/'
|
gpt-api-url: 'https://api.pandarobot.chat/'
|
||||||
gpt-api-key: 'xxxxxxx'
|
gpt-api-key: 'sk-xx'
|
||||||
accounts:
|
accounts:
|
||||||
- guild-id: 'xxxxxx'
|
- guild-id: 'xx'
|
||||||
channel-id: 'xxxxx'
|
channel-id: 'xx'
|
||||||
user-token: 'xxxxxxx'
|
user-token: 'xx'
|
||||||
|
|
||||||
|
--- # mail 邮件发送
|
||||||
|
mail:
|
||||||
|
enabled: true
|
||||||
|
host: smtp.163.com
|
||||||
|
port: 465
|
||||||
|
# 是否需要用户名密码验证
|
||||||
|
auth: true
|
||||||
|
# 发送方,遵循RFC-822标准
|
||||||
|
from: ageerle@163.com
|
||||||
|
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
|
||||||
|
user: ageerle@163.com
|
||||||
|
# 密码(填写授权码)
|
||||||
|
pass: TOGXBVPYFVPFRQMQ
|
||||||
|
# 使用 STARTTLS安全连接,STARTTLS是对纯文本通信协议的扩展。
|
||||||
|
starttlsEnable: true
|
||||||
|
# 使用SSL安全连接
|
||||||
|
sslEnable: true
|
||||||
|
# SMTP超时时长,单位毫秒,缺省值不超时
|
||||||
|
timeout: 0
|
||||||
|
# Socket连接超时值,单位毫秒,缺省值不超时
|
||||||
|
connectionTimeout: 0
|
||||||
|
|
||||||
|
# chatgpt配置信息
|
||||||
|
chat:
|
||||||
|
apiKey: 'sk-xxx'
|
||||||
|
apiHost: 'https://api.pandarobot.chat/'
|
||||||
|
|
||||||
|
# 支付配置信息
|
||||||
|
pay:
|
||||||
|
pid: 'xxx'
|
||||||
|
key: 'xxx'
|
||||||
|
payUrl: 'https://pay.pandarobot.chat/mapi.php'
|
||||||
|
notify_url: 'https://www.pandarobot.chat/pay/returnUrl'
|
||||||
|
return_url: 'https://www.pandarobot.chat/pay/notifyUrl'
|
||||||
|
type: 'wxpay'
|
||||||
|
device: 'pc'
|
||||||
|
sign_type: 'MD5'
|
||||||
|
|||||||
45
ruoyi-admin/src/test/java/com/xmzs/test/AssertUnitTest.java
Normal file
45
ruoyi-admin/src/test/java/com/xmzs/test/AssertUnitTest.java
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
package com.xmzs.test;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 断言单元测试案例
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@DisplayName("断言单元测试案例")
|
||||||
|
public class AssertUnitTest {
|
||||||
|
|
||||||
|
@DisplayName("测试 assertEquals 方法")
|
||||||
|
@Test
|
||||||
|
public void testAssertEquals() {
|
||||||
|
Assertions.assertEquals("666", new String("666"));
|
||||||
|
Assertions.assertNotEquals("666", new String("666"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 assertSame 方法")
|
||||||
|
@Test
|
||||||
|
public void testAssertSame() {
|
||||||
|
Object obj = new Object();
|
||||||
|
Object obj1 = obj;
|
||||||
|
Assertions.assertSame(obj, obj1);
|
||||||
|
Assertions.assertNotSame(obj, obj1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 assertTrue 方法")
|
||||||
|
@Test
|
||||||
|
public void testAssertTrue() {
|
||||||
|
Assertions.assertTrue(true);
|
||||||
|
Assertions.assertFalse(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 assertNull 方法")
|
||||||
|
@Test
|
||||||
|
public void testAssertNull() {
|
||||||
|
Assertions.assertNull(null);
|
||||||
|
Assertions.assertNotNull(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
70
ruoyi-admin/src/test/java/com/xmzs/test/DemoUnitTest.java
Normal file
70
ruoyi-admin/src/test/java/com/xmzs/test/DemoUnitTest.java
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
package com.xmzs.test;
|
||||||
|
|
||||||
|
import com.xmzs.common.core.config.RuoYiConfig;
|
||||||
|
import org.junit.jupiter.api.*;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单元测试案例
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@SpringBootTest // 此注解只能在 springboot 主包下使用 需包含 main 方法与 yml 配置文件
|
||||||
|
@DisplayName("单元测试案例")
|
||||||
|
public class DemoUnitTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RuoYiConfig ruoYiConfig;
|
||||||
|
|
||||||
|
@DisplayName("测试 @SpringBootTest @Test @DisplayName 注解")
|
||||||
|
@Test
|
||||||
|
public void testTest() {
|
||||||
|
System.out.println(ruoYiConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Disabled
|
||||||
|
@DisplayName("测试 @Disabled 注解")
|
||||||
|
@Test
|
||||||
|
public void testDisabled() {
|
||||||
|
System.out.println(ruoYiConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Timeout(value = 2L, unit = TimeUnit.SECONDS)
|
||||||
|
@DisplayName("测试 @Timeout 注解")
|
||||||
|
@Test
|
||||||
|
public void testTimeout() throws InterruptedException {
|
||||||
|
Thread.sleep(3000);
|
||||||
|
System.out.println(ruoYiConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@DisplayName("测试 @RepeatedTest 注解")
|
||||||
|
@RepeatedTest(3)
|
||||||
|
public void testRepeatedTest() {
|
||||||
|
System.out.println(666);
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeAll
|
||||||
|
public static void testBeforeAll() {
|
||||||
|
System.out.println("@BeforeAll ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void testBeforeEach() {
|
||||||
|
System.out.println("@BeforeEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterEach
|
||||||
|
public void testAfterEach() {
|
||||||
|
System.out.println("@AfterEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterAll
|
||||||
|
public static void testAfterAll() {
|
||||||
|
System.out.println("@AfterAll ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
72
ruoyi-admin/src/test/java/com/xmzs/test/ParamUnitTest.java
Normal file
72
ruoyi-admin/src/test/java/com/xmzs/test/ParamUnitTest.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
package com.xmzs.test;
|
||||||
|
|
||||||
|
import com.xmzs.common.core.enums.UserType;
|
||||||
|
import org.junit.jupiter.api.AfterEach;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.params.ParameterizedTest;
|
||||||
|
import org.junit.jupiter.params.provider.EnumSource;
|
||||||
|
import org.junit.jupiter.params.provider.MethodSource;
|
||||||
|
import org.junit.jupiter.params.provider.NullSource;
|
||||||
|
import org.junit.jupiter.params.provider.ValueSource;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带参数单元测试案例
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@DisplayName("带参数单元测试案例")
|
||||||
|
public class ParamUnitTest {
|
||||||
|
|
||||||
|
@DisplayName("测试 @ValueSource 注解")
|
||||||
|
@ParameterizedTest
|
||||||
|
@ValueSource(strings = {"t1", "t2", "t3"})
|
||||||
|
public void testValueSource(String str) {
|
||||||
|
System.out.println(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 @NullSource 注解")
|
||||||
|
@ParameterizedTest
|
||||||
|
@NullSource
|
||||||
|
public void testNullSource(String str) {
|
||||||
|
System.out.println(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 @EnumSource 注解")
|
||||||
|
@ParameterizedTest
|
||||||
|
@EnumSource(UserType.class)
|
||||||
|
public void testEnumSource(UserType type) {
|
||||||
|
System.out.println(type.getUserType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@DisplayName("测试 @MethodSource 注解")
|
||||||
|
@ParameterizedTest
|
||||||
|
@MethodSource("getParam")
|
||||||
|
public void testMethodSource(String str) {
|
||||||
|
System.out.println(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Stream<String> getParam() {
|
||||||
|
List<String> list = new ArrayList<>();
|
||||||
|
list.add("t1");
|
||||||
|
list.add("t2");
|
||||||
|
list.add("t3");
|
||||||
|
return list.stream();
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void testBeforeEach() {
|
||||||
|
System.out.println("@BeforeEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterEach
|
||||||
|
public void testAfterEach() {
|
||||||
|
System.out.println("@AfterEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
54
ruoyi-admin/src/test/java/com/xmzs/test/TagUnitTest.java
Normal file
54
ruoyi-admin/src/test/java/com/xmzs/test/TagUnitTest.java
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
package com.xmzs.test;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.*;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标签单元测试案例
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
@DisplayName("标签单元测试案例")
|
||||||
|
public class TagUnitTest {
|
||||||
|
|
||||||
|
@Tag("dev")
|
||||||
|
@DisplayName("测试 @Tag dev")
|
||||||
|
@Test
|
||||||
|
public void testTagDev() {
|
||||||
|
System.out.println("dev");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Tag("prod")
|
||||||
|
@DisplayName("测试 @Tag prod")
|
||||||
|
@Test
|
||||||
|
public void testTagProd() {
|
||||||
|
System.out.println("prod");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Tag("local")
|
||||||
|
@DisplayName("测试 @Tag local")
|
||||||
|
@Test
|
||||||
|
public void testTagLocal() {
|
||||||
|
System.out.println("local");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Tag("exclude")
|
||||||
|
@DisplayName("测试 @Tag exclude")
|
||||||
|
@Test
|
||||||
|
public void testTagExclude() {
|
||||||
|
System.out.println("exclude");
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void testBeforeEach() {
|
||||||
|
System.out.println("@BeforeEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterEach
|
||||||
|
public void testAfterEach() {
|
||||||
|
System.out.println("@AfterEach ==================");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -173,13 +173,15 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 微信模块 -->
|
<!-- AI绘画 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xmzs</groupId>
|
<groupId>com.xmzs</groupId>
|
||||||
<artifactId>ruoyi-midjourney</artifactId>
|
<artifactId>ruoyi-midjourney</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 支付模块 -->
|
<!-- 支付模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xmzs</groupId>
|
<groupId>com.xmzs</groupId>
|
||||||
|
|||||||
@@ -12,22 +12,27 @@ public class OpenAIConst {
|
|||||||
|
|
||||||
public final static int SUCCEED_CODE = 200;
|
public final static int SUCCEED_CODE = 200;
|
||||||
|
|
||||||
|
/** GPT3扣除费用 */
|
||||||
public final static double GPT3_COST = 0.05;
|
public final static double GPT3_COST = 0.05;
|
||||||
|
|
||||||
public final static double GPT4_COST = 0.3;
|
/** GPT4扣除费用 */
|
||||||
|
public final static double GPT4_COST = 0.2;
|
||||||
|
|
||||||
public final static double GPT4_ALL_COST = 0.3;
|
/** DALL普通绘图扣除费用 */
|
||||||
|
public final static double DALL3_COST = 0.3;
|
||||||
|
|
||||||
/** 绘图费用 */
|
/** DALL高清绘图扣除费用 */
|
||||||
public final static double DALL3_COST = 0.4;
|
public final static double DALL3_HD_COST = 0.5;
|
||||||
|
|
||||||
/** 绘图费用-高清 */
|
/** MJ操作类型1(变化、变焦、文生图、图生图、局部重绘、混图)扣除费用 */
|
||||||
public final static double DALL3_HD_COST = 0.8;
|
public final static double MJ_COST_TYPE1 = 0.3;
|
||||||
|
|
||||||
/** mdjourney绘图费用 */
|
/** MJ操作类型2(换脸、放大、图生文、prompt分析)扣除费用 */
|
||||||
public final static double MJ_COST = 0.3;
|
public final static double MJ_COST_TYPE2 = 0.1;
|
||||||
|
|
||||||
|
/** MJ操作类型3(查询任务进度、获取seed)扣除费用 */
|
||||||
|
public final static double MJ_COST_TYPE3 = 0.0;
|
||||||
|
|
||||||
/** 默认账户余额 */
|
/** 默认账户余额 */
|
||||||
public final static double USER_BALANCE = 5;
|
public final static double USER_BALANCE = 5;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,16 +22,16 @@ public class ChatRequest {
|
|||||||
@NotEmpty(message = "对话消息不能为空")
|
@NotEmpty(message = "对话消息不能为空")
|
||||||
List<Message> messages;
|
List<Message> messages;
|
||||||
|
|
||||||
List<Content> content;
|
List<Content> imageContent;
|
||||||
|
|
||||||
private String prompt;
|
private String prompt;
|
||||||
|
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 需要识别的图片地址
|
* 知识库id
|
||||||
*/
|
*/
|
||||||
private String imgurl;
|
private String kid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gpt的默认设置
|
* gpt的默认设置
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.xmzs.common.chat.domain.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RoleRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 音频地址
|
||||||
|
*/
|
||||||
|
private String prompt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
|
||||||
|
private String preProcess;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.xmzs.common.chat.domain.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SimpleGenerateRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 要使用的模型ID (目前统一为reecho-neural-voice-001)
|
||||||
|
*/
|
||||||
|
private String model = "reecho-neural-voice-001";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多样性 (0-100,默认为97)
|
||||||
|
*/
|
||||||
|
private Integer randomness;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 稳定性过滤 (0-100,默认为0)
|
||||||
|
*/
|
||||||
|
private Integer stability_boost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色ID
|
||||||
|
*/
|
||||||
|
private String voiceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 要生成的文本内容
|
||||||
|
*/
|
||||||
|
private String text;
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.xmzs.common.chat.domain.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MetadataResponse {
|
||||||
|
private String promptMP3StorageUrl;
|
||||||
|
private String promptOriginAudioStorageUrl;
|
||||||
|
private String description;
|
||||||
|
private boolean preProcess;
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.xmzs.common.chat.domain.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RoleDataResponse {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
private String status;
|
||||||
|
private String from;
|
||||||
|
private String originId;
|
||||||
|
private MetadataResponse metadata;
|
||||||
|
private String createdAt;
|
||||||
|
private String updatedAt;
|
||||||
|
private String deletedAt;
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.xmzs.common.chat.domain.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RoleResponse {
|
||||||
|
private String status;
|
||||||
|
private String message;
|
||||||
|
private RoleDataResponse data;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.xmzs.common.chat.domain.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SimpleGenerateDataResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次生成的ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次生成结果的音频文件地址
|
||||||
|
*/
|
||||||
|
private String audio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本次生成所消耗的点数
|
||||||
|
*/
|
||||||
|
private Integer credit_used;
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.xmzs.common.chat.domain.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author WangLe
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SimpleGenerateResponse {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态码,失败时则为500
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态消息
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成详情
|
||||||
|
*/
|
||||||
|
private SimpleGenerateDataResponse data;
|
||||||
|
}
|
||||||
@@ -2,7 +2,6 @@ package com.xmzs.common.chat.entity.chat;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import com.xmzs.common.chat.constant.OpenAIConst;
|
import com.xmzs.common.chat.constant.OpenAIConst;
|
||||||
import com.xmzs.common.chat.entity.chat.tool.Tools;
|
import com.xmzs.common.chat.entity.chat.tool.Tools;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
@@ -217,6 +216,23 @@ public class BaseChatCompletion implements Serializable {
|
|||||||
* gpt-4-0613,支持函数
|
* gpt-4-0613,支持函数
|
||||||
*/
|
*/
|
||||||
GPT_4_0125_PREVIEW("gpt-4-0125-preview"),
|
GPT_4_0125_PREVIEW("gpt-4-0125-preview"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GPT_4_ALL
|
||||||
|
*/
|
||||||
|
GPT_4_ALL("gpt-4-all"),
|
||||||
|
|
||||||
|
GPT_4_GIZMO("gpt-4-gizmo"),
|
||||||
|
|
||||||
|
NET("net"),
|
||||||
|
|
||||||
|
CLAUDE_3_SONNET("claude-3-sonnet-20240229"),
|
||||||
|
|
||||||
|
GEMINI_PRO("gemini-pro"),
|
||||||
|
|
||||||
|
STABLE_DIFFUSION("stable-diffusion"),
|
||||||
|
|
||||||
|
SUNO_V3("suno-v3"),
|
||||||
;
|
;
|
||||||
private final String name;
|
private final String name;
|
||||||
}
|
}
|
||||||
@@ -238,9 +254,10 @@ public class BaseChatCompletion implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double getModelCost(String modelName) {
|
public static double getModelCost(String modelName) {
|
||||||
return switch (modelName) {
|
if(modelName.startsWith("gpt-3.5")){
|
||||||
case "gpt-3.5-turbo-0613" -> OpenAIConst.GPT3_COST;
|
return OpenAIConst.GPT3_COST;
|
||||||
default -> OpenAIConst.GPT4_COST;
|
}else {
|
||||||
};
|
return OpenAIConst.GPT4_COST;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,13 +16,20 @@ import java.io.Serializable;
|
|||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class File implements Serializable {
|
public class File implements Serializable {
|
||||||
|
|
||||||
private String id;
|
// private String id;
|
||||||
private String object;
|
// private String object;
|
||||||
|
// private long bytes;
|
||||||
|
// private long created_at;
|
||||||
|
// private String filename;
|
||||||
|
// private String purpose;
|
||||||
|
// private String status;
|
||||||
|
// @JsonProperty("status_details")
|
||||||
|
// private String statusDetails;
|
||||||
|
|
||||||
private long bytes;
|
private long bytes;
|
||||||
private long created_at;
|
private long created_at;
|
||||||
private String filename;
|
private String filename;
|
||||||
private String purpose;
|
private String id;
|
||||||
private String status;
|
private String object;
|
||||||
@JsonProperty("status_details")
|
private String url;
|
||||||
private String statusDetails;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.xmzs.common.chat.entity.billing.Subscription;
|
|||||||
import com.xmzs.common.chat.entity.chat.BaseChatCompletion;
|
import com.xmzs.common.chat.entity.chat.BaseChatCompletion;
|
||||||
import com.xmzs.common.chat.entity.chat.ChatCompletionResponse;
|
import com.xmzs.common.chat.entity.chat.ChatCompletionResponse;
|
||||||
import com.xmzs.common.chat.entity.chat.ChatCompletionWithPicture;
|
import com.xmzs.common.chat.entity.chat.ChatCompletionWithPicture;
|
||||||
|
import com.xmzs.common.chat.entity.files.UploadFileResponse;
|
||||||
import com.xmzs.common.chat.entity.images.Image;
|
import com.xmzs.common.chat.entity.images.Image;
|
||||||
import com.xmzs.common.chat.entity.images.ImageResponse;
|
import com.xmzs.common.chat.entity.images.ImageResponse;
|
||||||
import com.xmzs.common.chat.entity.models.Model;
|
import com.xmzs.common.chat.entity.models.Model;
|
||||||
@@ -231,6 +232,23 @@ public class OpenAiStreamClient {
|
|||||||
return chatCompletionResponse.blockingGet();
|
return chatCompletionResponse.blockingGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*
|
||||||
|
* @param purpose purpose
|
||||||
|
* @param file 文件对象
|
||||||
|
* @return UploadFileResponse
|
||||||
|
*/
|
||||||
|
public UploadFileResponse uploadFile(String purpose, java.io.File file) {
|
||||||
|
// 创建 RequestBody,用于封装构建RequestBody
|
||||||
|
RequestBody fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||||
|
MultipartBody.Part multipartBody = MultipartBody.Part.createFormData("file", file.getName(), fileBody);
|
||||||
|
|
||||||
|
RequestBody purposeBody = RequestBody.create(MediaType.parse("multipart/form-data"), purpose);
|
||||||
|
Single<UploadFileResponse> uploadFileResponse = this.openAiApi.uploadFile(multipartBody, purposeBody);
|
||||||
|
return uploadFileResponse.blockingGet();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取openKey账户信息(近90天)
|
* 获取openKey账户信息(近90天)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,50 +1,57 @@
|
|||||||
package com.xmzs.common.config;
|
package com.xmzs.common.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付配置信息
|
* 支付配置信息
|
||||||
*
|
*
|
||||||
* @author Admin
|
* @author Admin
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "pay")
|
||||||
public class PayConfig {
|
public class PayConfig {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户ID
|
* 商户ID
|
||||||
*/
|
*/
|
||||||
public static String pid = "xxx";
|
private String pid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口地址
|
* 接口地址
|
||||||
*/
|
*/
|
||||||
public static String payUrl = "https://pay-cloud.vip/mapi.php";
|
private String payUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 私钥
|
* 私钥
|
||||||
*/
|
*/
|
||||||
public static String key = "xxx";
|
private String key ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务器异步通知地址
|
* 服务器异步通知地址
|
||||||
*/
|
*/
|
||||||
public static String notify_url = "https://www.pandarobot.chat/pay/returnUrl";
|
private String notify_url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面跳转通知地址
|
* 页面跳转通知地址
|
||||||
*/
|
*/
|
||||||
public static String return_url = "https://www.pandarobot.chat/pay/notifyUrl";
|
private String return_url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付方式
|
* 支付方式
|
||||||
*/
|
*/
|
||||||
public static String type = "wxpay";
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备类型
|
* 设备类型
|
||||||
*/
|
*/
|
||||||
public static String device = "pc";
|
private String device;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密方式默认MD5
|
* 加密方式默认MD5
|
||||||
*/
|
*/
|
||||||
public static String sign_type = "MD5";
|
private String sign_type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package com.xmzs.common.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
|
||||||
import com.xmzs.common.config.PayConfig;
|
import com.xmzs.common.config.PayConfig;
|
||||||
import com.xmzs.common.service.PayService;
|
import com.xmzs.common.service.PayService;
|
||||||
import com.xmzs.common.utils.MD5Util;
|
import com.xmzs.common.utils.MD5Util;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -15,28 +17,31 @@ import java.util.Map;
|
|||||||
* @author Admin
|
* @author Admin
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class PayServiceImpl implements PayService {
|
public class PayServiceImpl implements PayService {
|
||||||
|
|
||||||
|
private final PayConfig payConfig;
|
||||||
@Override
|
@Override
|
||||||
public String getPayUrl(String orderNo, String name, double money, String clientIp) {
|
public String getPayUrl(String orderNo, String name, double money, String clientIp) {
|
||||||
String out_trade_no = orderNo, sign = "";
|
String out_trade_no = orderNo, sign = "";
|
||||||
//封装请求参数
|
//封装请求参数
|
||||||
String mdString = "clientip=" + clientIp + "&device=" + PayConfig.device + "&money=" + money + "&name=" + name + "&" +
|
String mdString = "clientip=" + clientIp + "&device=" + payConfig.getDevice() + "&money=" + money + "&name=" + name + "&" +
|
||||||
"notify_url=" + PayConfig.notify_url + "&out_trade_no=" + out_trade_no + "&pid=" + PayConfig.pid + "&return_url=" + PayConfig.return_url +
|
"notify_url=" + payConfig.getNotify_url() + "&out_trade_no=" + out_trade_no + "&pid=" + payConfig.getPid() + "&return_url=" + payConfig.getReturn_url() +
|
||||||
"&type=" + PayConfig.type + PayConfig.key;
|
"&type=" + payConfig.getType() + payConfig.getKey();
|
||||||
sign = MD5Util.GetMD5Code(mdString);
|
sign = MD5Util.GetMD5Code(mdString);
|
||||||
Map<String, Object> map = new HashMap<>(10);
|
Map<String, Object> map = new HashMap<>(10);
|
||||||
map.put("clientip", clientIp);
|
map.put("clientip", clientIp);
|
||||||
map.put("device", PayConfig.device);
|
map.put("device", payConfig.getDevice());
|
||||||
map.put("money", money);
|
map.put("money", money);
|
||||||
map.put("name", name);
|
map.put("name", name);
|
||||||
map.put("notify_url", PayConfig.notify_url);
|
map.put("notify_url", payConfig.getNotify_url());
|
||||||
map.put("out_trade_no", out_trade_no);
|
map.put("out_trade_no", out_trade_no);
|
||||||
map.put("pid", PayConfig.pid);
|
map.put("pid", payConfig.getPid());
|
||||||
map.put("return_url", PayConfig.return_url);
|
map.put("return_url", payConfig.getReturn_url());
|
||||||
map.put("sign_type", PayConfig.sign_type);
|
map.put("sign_type", payConfig.getSign_type());
|
||||||
map.put("type", PayConfig.type);
|
map.put("type", payConfig.getType());
|
||||||
map.put("sign", sign);
|
map.put("sign", sign);
|
||||||
String body = HttpUtil.post(PayConfig.payUrl, map);
|
String body = HttpUtil.post(payConfig.getPayUrl(), map);
|
||||||
JSONObject jsonObject = new JSONObject(body);
|
JSONObject jsonObject = new JSONObject(body);
|
||||||
return (String) jsonObject.get("qrcode");
|
return (String) jsonObject.get("qrcode");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
<module>ruoyi-job</module>
|
<module>ruoyi-job</module>
|
||||||
<module>ruoyi-midjourney</module>
|
<module>ruoyi-midjourney</module>
|
||||||
<module>ruoyi-system</module>
|
<module>ruoyi-system</module>
|
||||||
<module>ruoyi-live</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -7,30 +7,30 @@ import com.xmzs.common.core.utils.ValidatorUtils;
|
|||||||
import com.xmzs.common.core.validate.AddGroup;
|
import com.xmzs.common.core.validate.AddGroup;
|
||||||
import com.xmzs.common.core.validate.EditGroup;
|
import com.xmzs.common.core.validate.EditGroup;
|
||||||
import com.xmzs.common.core.validate.QueryGroup;
|
import com.xmzs.common.core.validate.QueryGroup;
|
||||||
import com.xmzs.common.web.core.BaseController;
|
|
||||||
import com.xmzs.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
import com.xmzs.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.xmzs.common.excel.core.ExcelResult;
|
import com.xmzs.common.excel.core.ExcelResult;
|
||||||
import com.xmzs.common.excel.utils.ExcelUtil;
|
import com.xmzs.common.excel.utils.ExcelUtil;
|
||||||
|
import com.xmzs.common.idempotent.annotation.RepeatSubmit;
|
||||||
import com.xmzs.common.log.annotation.Log;
|
import com.xmzs.common.log.annotation.Log;
|
||||||
import com.xmzs.common.log.enums.BusinessType;
|
import com.xmzs.common.log.enums.BusinessType;
|
||||||
|
import com.xmzs.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import com.xmzs.common.web.core.BaseController;
|
||||||
import com.xmzs.demo.domain.TestDemo;
|
import com.xmzs.demo.domain.TestDemo;
|
||||||
import com.xmzs.demo.domain.bo.TestDemoBo;
|
import com.xmzs.demo.domain.bo.TestDemoBo;
|
||||||
import com.xmzs.demo.domain.bo.TestDemoImportVo;
|
import com.xmzs.demo.domain.bo.TestDemoImportVo;
|
||||||
import com.xmzs.demo.domain.vo.TestDemoVo;
|
import com.xmzs.demo.domain.vo.TestDemoVo;
|
||||||
import com.xmzs.demo.service.ITestDemoService;
|
import com.xmzs.demo.service.ITestDemoService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import java.util.Arrays;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import java.util.List;
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package com.xmzs.demo.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import com.xmzs.common.excel.utils.ExcelUtil;
|
import com.xmzs.common.excel.utils.ExcelUtil;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.xmzs.demo.controller;
|
|||||||
|
|
||||||
import com.xmzs.common.core.domain.R;
|
import com.xmzs.common.core.domain.R;
|
||||||
import com.xmzs.common.core.utils.MessageUtils;
|
import com.xmzs.common.core.utils.MessageUtils;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.hibernate.validator.constraints.Range;
|
import org.hibernate.validator.constraints.Range;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -9,9 +11,6 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试国际化
|
* 测试国际化
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
package com.xmzs.demo.controller;
|
package com.xmzs.demo.controller;
|
||||||
|
|
||||||
import com.xmzs.common.core.domain.R;
|
import com.xmzs.common.core.domain.R;
|
||||||
import com.xmzs.common.web.core.BaseController;
|
|
||||||
import com.xmzs.common.sensitive.annotation.Sensitive;
|
import com.xmzs.common.sensitive.annotation.Sensitive;
|
||||||
import com.xmzs.common.sensitive.core.SensitiveStrategy;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.xmzs.common.sensitive.core.SensitiveService;
|
import com.xmzs.common.sensitive.core.SensitiveService;
|
||||||
|
import com.xmzs.common.sensitive.core.SensitiveStrategy;
|
||||||
|
import com.xmzs.common.web.core.BaseController;
|
||||||
|
import lombok.Data;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|||||||
@@ -5,21 +5,21 @@ import com.xmzs.common.core.domain.R;
|
|||||||
import com.xmzs.common.core.validate.AddGroup;
|
import com.xmzs.common.core.validate.AddGroup;
|
||||||
import com.xmzs.common.core.validate.EditGroup;
|
import com.xmzs.common.core.validate.EditGroup;
|
||||||
import com.xmzs.common.core.validate.QueryGroup;
|
import com.xmzs.common.core.validate.QueryGroup;
|
||||||
import com.xmzs.common.web.core.BaseController;
|
|
||||||
import com.xmzs.common.excel.utils.ExcelUtil;
|
import com.xmzs.common.excel.utils.ExcelUtil;
|
||||||
import com.xmzs.common.idempotent.annotation.RepeatSubmit;
|
import com.xmzs.common.idempotent.annotation.RepeatSubmit;
|
||||||
import com.xmzs.common.log.annotation.Log;
|
import com.xmzs.common.log.annotation.Log;
|
||||||
import com.xmzs.common.log.enums.BusinessType;
|
import com.xmzs.common.log.enums.BusinessType;
|
||||||
|
import com.xmzs.common.web.core.BaseController;
|
||||||
import com.xmzs.demo.domain.bo.TestTreeBo;
|
import com.xmzs.demo.domain.bo.TestTreeBo;
|
||||||
import com.xmzs.demo.domain.vo.TestTreeVo;
|
import com.xmzs.demo.domain.vo.TestTreeVo;
|
||||||
import com.xmzs.demo.service.ITestTreeService;
|
import com.xmzs.demo.service.ITestTreeService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -5,11 +5,10 @@ import com.xmzs.common.core.validate.EditGroup;
|
|||||||
import com.xmzs.common.mybatis.core.domain.BaseEntity;
|
import com.xmzs.common.mybatis.core.domain.BaseEntity;
|
||||||
import com.xmzs.demo.domain.TestDemo;
|
import com.xmzs.demo.domain.TestDemo;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试单表业务对象 test_demo
|
* 测试单表业务对象 test_demo
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package com.xmzs.demo.domain.bo;
|
package com.xmzs.demo.domain.bo;
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试单表业务对象 test_demo
|
* 测试单表业务对象 test_demo
|
||||||
|
|||||||
@@ -4,19 +4,19 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import com.xmzs.common.core.domain.R;
|
import com.xmzs.common.core.domain.R;
|
||||||
import com.xmzs.common.web.core.BaseController;
|
|
||||||
import com.xmzs.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import com.xmzs.common.log.annotation.Log;
|
import com.xmzs.common.log.annotation.Log;
|
||||||
import com.xmzs.common.log.enums.BusinessType;
|
import com.xmzs.common.log.enums.BusinessType;
|
||||||
|
import com.xmzs.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import com.xmzs.common.web.core.BaseController;
|
||||||
import com.xmzs.generator.domain.GenTable;
|
import com.xmzs.generator.domain.GenTable;
|
||||||
import com.xmzs.generator.domain.GenTableColumn;
|
import com.xmzs.generator.domain.GenTableColumn;
|
||||||
import com.xmzs.generator.service.IGenTableService;
|
import com.xmzs.generator.service.IGenTableService;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.xmzs.common.core.utils.StringUtils;
|
import com.xmzs.common.core.utils.StringUtils;
|
||||||
import com.xmzs.common.mybatis.core.domain.BaseEntity;
|
import com.xmzs.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.ibatis.type.JdbcType;
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 代码生成业务字段表 gen_table_column
|
* 代码生成业务字段表 gen_table_column
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.xmzs.common.core.constant.Constants;
|
import com.xmzs.common.core.constant.Constants;
|
||||||
import com.xmzs.generator.constant.GenConstants;
|
|
||||||
import com.xmzs.common.core.exception.ServiceException;
|
import com.xmzs.common.core.exception.ServiceException;
|
||||||
import com.xmzs.common.core.utils.StreamUtils;
|
import com.xmzs.common.core.utils.StreamUtils;
|
||||||
import com.xmzs.common.core.utils.StringUtils;
|
import com.xmzs.common.core.utils.StringUtils;
|
||||||
@@ -20,6 +19,7 @@ import com.xmzs.common.json.utils.JsonUtils;
|
|||||||
import com.xmzs.common.mybatis.core.page.PageQuery;
|
import com.xmzs.common.mybatis.core.page.PageQuery;
|
||||||
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
import com.xmzs.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.xmzs.common.satoken.utils.LoginHelper;
|
import com.xmzs.common.satoken.utils.LoginHelper;
|
||||||
|
import com.xmzs.generator.constant.GenConstants;
|
||||||
import com.xmzs.generator.domain.GenTable;
|
import com.xmzs.generator.domain.GenTable;
|
||||||
import com.xmzs.generator.domain.GenTableColumn;
|
import com.xmzs.generator.domain.GenTableColumn;
|
||||||
import com.xmzs.generator.mapper.GenTableColumnMapper;
|
import com.xmzs.generator.mapper.GenTableColumnMapper;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.xmzs.generator.util;
|
package com.xmzs.generator.util;
|
||||||
|
|
||||||
import com.xmzs.generator.constant.GenConstants;
|
|
||||||
import com.xmzs.common.core.utils.StringUtils;
|
import com.xmzs.common.core.utils.StringUtils;
|
||||||
import com.xmzs.common.satoken.utils.LoginHelper;
|
import com.xmzs.common.satoken.utils.LoginHelper;
|
||||||
import com.xmzs.generator.config.GenConfig;
|
import com.xmzs.generator.config.GenConfig;
|
||||||
|
import com.xmzs.generator.constant.GenConstants;
|
||||||
import com.xmzs.generator.domain.GenTable;
|
import com.xmzs.generator.domain.GenTable;
|
||||||
import com.xmzs.generator.domain.GenTableColumn;
|
import com.xmzs.generator.domain.GenTableColumn;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package com.xmzs.generator.util;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import com.xmzs.generator.constant.GenConstants;
|
|
||||||
import com.xmzs.common.core.utils.DateUtils;
|
import com.xmzs.common.core.utils.DateUtils;
|
||||||
import com.xmzs.common.core.utils.StringUtils;
|
import com.xmzs.common.core.utils.StringUtils;
|
||||||
import com.xmzs.common.json.utils.JsonUtils;
|
import com.xmzs.common.json.utils.JsonUtils;
|
||||||
import com.xmzs.common.mybatis.helper.DataBaseHelper;
|
import com.xmzs.common.mybatis.helper.DataBaseHelper;
|
||||||
|
import com.xmzs.generator.constant.GenConstants;
|
||||||
import com.xmzs.generator.domain.GenTable;
|
import com.xmzs.generator.domain.GenTable;
|
||||||
import com.xmzs.generator.domain.GenTableColumn;
|
import com.xmzs.generator.domain.GenTableColumn;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import {AxiosPromise} from 'axios';
|
||||||
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from '@/api/${moduleName}/${businessName}/types';
|
import {${BusinessName}Form, ${BusinessName}Query, ${BusinessName}VO} from '@/api/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
|
|||||||
@@ -258,12 +258,19 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="${BusinessName}" lang="ts">
|
<script setup name="${BusinessName}" lang="ts">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from '@/api/${moduleName}/${businessName}';
|
import {
|
||||||
import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types';
|
add${BusinessName},
|
||||||
import { ComponentInternalInstance } from 'vue';
|
${BusinessName}Form,
|
||||||
import { ElForm } from 'element-plus';
|
get${BusinessName},
|
||||||
|
list${BusinessName},
|
||||||
|
${BusinessName}Query,
|
||||||
|
update${BusinessName},
|
||||||
|
${BusinessName}VO
|
||||||
|
} from '@/api/';
|
||||||
|
import {ComponentInternalInstance} from 'vue';
|
||||||
|
import {ElForm} from 'element-plus';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
||||||
|
|||||||
@@ -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>com.xmzs</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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user