update m2pool 移除运算力平台模块
This commit is contained in:
@@ -1,234 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>m2pool-modules</artifactId>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<version>3.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>m2pool-lease</artifactId>
|
||||
<dependencies>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– Mybatis-Plus –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baomidou</groupId>-->
|
||||
<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>jsqlparser</artifactId>-->
|
||||
<!-- <groupId>com.github.jsqlparser</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!--<!– <exclusion>–>-->
|
||||
<!--<!– <artifactId>mybatis</artifactId>–>-->
|
||||
<!--<!– <groupId>org.mybatis</groupId>–>-->
|
||||
<!--<!– </exclusion>–>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- M2Pool Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- M2Pool Common security -->
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-security</artifactId>
|
||||
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- WebSocket-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.java-websocket</groupId>
|
||||
<artifactId>Java-WebSocket</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<!--google两步认证相关-->
|
||||
<dependency>
|
||||
<groupId>de.taimos</groupId>
|
||||
<artifactId>totp</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>5.12.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pt.kcry</groupId>
|
||||
<artifactId>blake3_3</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Thymeleaf 用于发送邮箱 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<!-- 本地环境 -->
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<spring.profile>dev</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<!-- 是否默认激活 -->
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- 测试环境 -->
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<spring.profile>test</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- 生产环境 -->
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<spring.profile>prod</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.m2pool.lease;
|
||||
|
||||
import com.m2pool.common.security.annotation.EnableCustomConfig;
|
||||
import com.m2pool.common.security.annotation.EnableM2PoolFeignClients;
|
||||
import com.m2pool.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import com.m2pool.lease.netty.server.NettyTcpServer;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableM2PoolFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan({"com.m2pool.lease.mapper"})
|
||||
public class M2poolLeaseApplication implements CommandLineRunner {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(M2poolLeaseApplication.class, args);
|
||||
}
|
||||
|
||||
@Resource
|
||||
NettyTcpServer nettyTcpServer;
|
||||
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
//启动服务端
|
||||
ChannelFuture start = nettyTcpServer.start();
|
||||
//服务端管道关闭的监听器并同步阻塞,直到channel关闭,线程才会往下执行,结束进程
|
||||
start.channel().closeFuture().syncUninterruptibly();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 标记在方法上,表示需要对请求体进行解密
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Decrypt {
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 标记在字段上,表示该字段需要解密
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface EncryptedField {
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/***
|
||||
* 账本日志注解
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface LedgerLog {
|
||||
String value();
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface LedgerLogParam {
|
||||
String value() default "";
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/***
|
||||
* 账本日志地址标识注解
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface LedgerLogTag {
|
||||
String value() default "";
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.m2pool.lease.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface LoginRequired {
|
||||
boolean value() default true;
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
package com.m2pool.lease.aspect;
|
||||
|
||||
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import com.m2pool.lease.exception.RSAException;
|
||||
import com.m2pool.lease.utils.RsaUtils;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Parameter;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
public class DecryptAspect {
|
||||
|
||||
// 定义切点,拦截所有带 @Decrypt 注解的方法
|
||||
@Pointcut("@annotation(com.m2pool.lease.annotation.Decrypt)")
|
||||
public void decryptPointcut() {}
|
||||
|
||||
@Around("decryptPointcut()")
|
||||
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
Object[] args = joinPoint.getArgs();
|
||||
Parameter[] parameters = ((MethodSignature) joinPoint.getSignature()).getMethod().getParameters();
|
||||
|
||||
for (int i = 0; i < parameters.length; i++) {
|
||||
// 找到被 @RequestBody 标记的参数
|
||||
if (parameters[i].isAnnotationPresent(RequestBody.class)) {
|
||||
Object requestBody = args[i];
|
||||
// 递归解密对象中的加密字段
|
||||
decryptObjectFields(requestBody);
|
||||
}
|
||||
}
|
||||
// 继续执行原方法
|
||||
return joinPoint.proceed(args);
|
||||
}
|
||||
|
||||
private void decryptObjectFields(Object obj) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理集合或数组类型
|
||||
if (obj instanceof Collection) {
|
||||
for (Object item : (Collection<?>) obj) {
|
||||
decryptObjectFields(item);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理Map类型
|
||||
if (obj instanceof Map) {
|
||||
for (Object value : ((Map<?, ?>) obj).values()) {
|
||||
decryptObjectFields(value);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理普通对象
|
||||
Field[] fields = obj.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (field.isAnnotationPresent(EncryptedField.class)) {
|
||||
handleEncryptedField(obj, field);
|
||||
} else {
|
||||
//这里可能是普通对象或者集合或其他非EncryptedField标记的普通属性字段
|
||||
handleNestedField(obj, field);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleEncryptedField(Object obj, Field field) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
Object value = field.get(obj);
|
||||
if (value != null) {
|
||||
String encryptedValue = value.toString();
|
||||
System.out.println("加密前地址:"+value +"类型"+(value instanceof String));
|
||||
String decryptedValue = RsaUtils.decrypt(encryptedValue);
|
||||
System.out.println("解密后地址:"+decryptedValue);
|
||||
field.set(obj, decryptedValue);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RSAException("校验失败: " + e.getMessage());
|
||||
} finally {
|
||||
field.setAccessible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleNestedField(Object obj, Field field) {
|
||||
field.setAccessible(true);
|
||||
try {
|
||||
Object fieldValue = field.get(obj);
|
||||
if (fieldValue != null && !isPrimitiveOrWrapper(fieldValue)) {
|
||||
decryptObjectFields(fieldValue);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
// 忽略访问异常
|
||||
} finally {
|
||||
field.setAccessible(false);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isPrimitiveOrWrapper(Object obj) {
|
||||
Class<?> clazz = obj.getClass();
|
||||
return clazz.isPrimitive() ||
|
||||
clazz == String.class ||
|
||||
clazz == Integer.class ||
|
||||
clazz == Long.class ||
|
||||
clazz == Double.class ||
|
||||
clazz == Float.class ||
|
||||
clazz == Boolean.class ||
|
||||
clazz == Character.class ||
|
||||
clazz == Byte.class ||
|
||||
clazz == Short.class ||
|
||||
clazz == BigDecimal.class;
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.m2pool.lease.aspect;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* 用户账本日志服务类
|
||||
*/
|
||||
@Service
|
||||
public class LedgerLogService {
|
||||
private static final String LOG_DIR = "/home/ubuntu/web/logs/ledger/";
|
||||
private static final DateTimeFormatter MONTH_FORMAT = DateTimeFormatter.ofPattern("yyyyMM");
|
||||
|
||||
public void logOperation(String tag, String operation, String content) {
|
||||
String month = LocalDate.now().format(MONTH_FORMAT);
|
||||
String fileName = String.format("%s%s_%s.log", LOG_DIR, tag, month);
|
||||
|
||||
try {
|
||||
Files.createDirectories(Paths.get(LOG_DIR));
|
||||
String logEntry = String.format("[%s] %s: %s%n",
|
||||
LocalDateTime.now(), operation, content);
|
||||
Files.write(Paths.get(fileName),
|
||||
logEntry.getBytes(StandardCharsets.UTF_8),
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.APPEND);
|
||||
} catch (IOException e) {
|
||||
System.out.println("创建用户日志文件失败"+e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package com.m2pool.lease.aspect;
|
||||
|
||||
import com.m2pool.common.security.utils.SecurityUtils;
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import com.m2pool.lease.annotation.LedgerLog;
|
||||
import com.m2pool.lease.annotation.LedgerLogParam;
|
||||
import com.m2pool.lease.annotation.LedgerLogTag;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@Aspect
|
||||
@Component
|
||||
public class OperationLogAspect {
|
||||
@Autowired
|
||||
private LedgerLogService ledgerLogService;
|
||||
|
||||
@Pointcut("@annotation(com.m2pool.lease.annotation.LedgerLog)")
|
||||
public void operationPointcut() {}
|
||||
|
||||
@AfterReturning(pointcut = "operationPointcut()", returning = "result")
|
||||
public void afterOperation(JoinPoint joinPoint, Object result) {
|
||||
// 获取当前登录用户
|
||||
String address = "";
|
||||
|
||||
// 获取操作类型
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method method = signature.getMethod();
|
||||
LedgerLog annotation = method.getAnnotation(LedgerLog.class);
|
||||
//获取操作信息
|
||||
StringBuilder ledgerLog = new StringBuilder();
|
||||
for (Object arg : joinPoint.getArgs()) {
|
||||
if (arg != null) {
|
||||
Field[] fields = arg.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
try {
|
||||
if (field.isAnnotationPresent(LedgerLogParam.class)) {
|
||||
field.setAccessible(true);
|
||||
Object value = field.get(arg);
|
||||
ledgerLog.append(field.getAnnotation(LedgerLogParam.class).value())
|
||||
.append("=")
|
||||
.append(value)
|
||||
.append("; ");
|
||||
|
||||
}else if (field.isAnnotationPresent(LedgerLogTag.class)){
|
||||
field.setAccessible(true);
|
||||
address = (String) field.get(arg);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result != null){
|
||||
// 添加手续费值的特殊处理(手续不准在请求参数中传递,只能通过返回获取)
|
||||
if (result instanceof Result) {
|
||||
ledgerLog.append(((Result<?>) result).getData()).append("; ");
|
||||
}
|
||||
ledgerLog.append("\n结果:").append(result);
|
||||
}
|
||||
// 记录日志
|
||||
ledgerLogService.logOperation(address, annotation.value(), ledgerLog.toString());
|
||||
}
|
||||
|
||||
@AfterThrowing(pointcut = "operationPointcut()", throwing = "ex")
|
||||
public void afterOperationError(JoinPoint joinPoint, Exception ex) {
|
||||
// 获取当前登录用户
|
||||
String username = SecurityUtils.getUsername();
|
||||
String operation = joinPoint.getSignature().getName();
|
||||
ledgerLogService.logOperation(username, operation, "操作失败: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
|
||||
public class JacksonMessageConverter extends Jackson2JsonMessageConverter {
|
||||
public JacksonMessageConverter() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromMessage(Message message) {
|
||||
message.getMessageProperties().setContentType("application/json");
|
||||
return super.fromMessage(message);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.m2pool.lease.config;//package com.m2pool.lease.config;
|
||||
//
|
||||
//import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import springfox.documentation.builders.ApiInfoBuilder;
|
||||
//import springfox.documentation.builders.PathSelectors;
|
||||
//import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
//import springfox.documentation.service.ApiInfo;
|
||||
//import springfox.documentation.spi.DocumentationType;
|
||||
//import springfox.documentation.spring.web.plugins.Docket;
|
||||
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
//
|
||||
//@Configuration
|
||||
//@EnableSwagger2
|
||||
//@EnableKnife4j
|
||||
//public class Knife4jConfiguration {
|
||||
//
|
||||
// @Bean
|
||||
// public Docket createRestApi() {
|
||||
// return new Docket(DocumentationType.SWAGGER_2)
|
||||
// .useDefaultResponseMessages(false)
|
||||
// .apiInfo(apiInfo())
|
||||
// .select()
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.m2pool.lease.controller"))
|
||||
// .paths(PathSelectors.any())
|
||||
// .build();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private ApiInfo apiInfo() {
|
||||
// return new ApiInfoBuilder()
|
||||
// .description("Kinfe4j 集成测试文档")
|
||||
// .version("v1.0.0")
|
||||
// .title("API测试文档")
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import com.m2pool.common.redis.service.RedisService;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.entity.LeaseUser;
|
||||
import com.m2pool.lease.exception.AuthException;
|
||||
import com.m2pool.lease.redis.RedisAuthKey;
|
||||
import com.m2pool.lease.utils.JwtUtils;
|
||||
import com.m2pool.lease.utils.UserThreadLocal;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.method.HandlerMethod;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.m2pool.lease.utils.JwtUtils.AUTHENTICATION;
|
||||
import static com.m2pool.lease.utils.JwtUtils.EXPIRETIME;
|
||||
|
||||
@Component
|
||||
public class LoginInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Resource
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
// 如果不是映射到方法直接通过
|
||||
if (!(handler instanceof HandlerMethod)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String uri = request.getRequestURI();
|
||||
if (uri.contains("/doc.html") || uri.contains("/webjars/")
|
||||
|| uri.contains("/swagger-resources") || uri.contains("/v2/api-docs")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||
Method method = handlerMethod.getMethod();
|
||||
|
||||
// 获取方法上的注解
|
||||
LoginRequired loginRequired = method.getAnnotation(LoginRequired.class);
|
||||
// 如果方法上没有注解,获取类上的注解
|
||||
if (loginRequired == null) {
|
||||
loginRequired = handlerMethod.getBeanType().getAnnotation(LoginRequired.class);
|
||||
}
|
||||
|
||||
// 如果没有注解或者注解值为true,则校验token
|
||||
if (loginRequired == null || loginRequired.value()) {
|
||||
String token = request.getHeader(AUTHENTICATION);
|
||||
System.out.println("用户token:"+token);
|
||||
if (token == null || !isValidToken(token)) {
|
||||
throw new AuthException("用户未登录");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证token 并刷新token
|
||||
*/
|
||||
private boolean isValidToken(String token) {
|
||||
String userEmail = JwtUtils.getUserName(token);
|
||||
//1.把userEmail存入ThreadLocal 本地线程变量中
|
||||
UserThreadLocal.setUserEmail(userEmail);
|
||||
//2.校验token是否过期
|
||||
String userKey = RedisAuthKey.getUserLoginKey(userEmail);
|
||||
LeaseUser loginUser = redisService.getCacheObject(userKey);
|
||||
if (loginUser == null){
|
||||
return false;
|
||||
}
|
||||
//3.刷新token 过期时间
|
||||
redisService.setCacheObject(userKey, loginUser, EXPIRETIME, TimeUnit.MINUTES);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
|
||||
UserThreadLocal.remove();
|
||||
}
|
||||
}
|
||||
@@ -1,289 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
|
||||
import org.springframework.amqp.core.*;
|
||||
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.m2pool.lease.constant.RabbitmqConstant.*;
|
||||
|
||||
@Configuration
|
||||
public class RabbitMQConfig {
|
||||
|
||||
@Bean
|
||||
public MessageConverter jackson2JsonMessageConverter() {
|
||||
//自动生成消息唯一id
|
||||
//jackson2JsonMessageConverter.setCreateMessageIds(true);
|
||||
return new JacksonMessageConverter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
|
||||
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
|
||||
rabbitTemplate.setMessageConverter(jackson2JsonMessageConverter());
|
||||
|
||||
//// 自定义 MessagePostProcessor 来设置 content-type
|
||||
//rabbitTemplate.setBeforePublishPostProcessors(new MessagePostProcessor() {
|
||||
// @Override
|
||||
// public Message postProcessMessage(Message message) {
|
||||
// // 设置 content-type 为 application/json
|
||||
// message.getMessageProperties().setContentType("application/json");
|
||||
// return message;
|
||||
// }
|
||||
//});
|
||||
// 开启发布确认模式
|
||||
rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> {
|
||||
if (ack) {
|
||||
System.out.println("消息发送成功,correlationData: " + correlationData);
|
||||
} else {
|
||||
System.out.println("消息发送失败,原因: " + cause);
|
||||
// 这里可以添加将失败消息存储到数据库的逻辑
|
||||
}
|
||||
});
|
||||
rabbitTemplate.setMandatory(true);
|
||||
return rabbitTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
|
||||
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||
factory.setConnectionFactory(connectionFactory);
|
||||
//消费者序列化
|
||||
factory.setMessageConverter(jackson2JsonMessageConverter());
|
||||
factory.setConcurrentConsumers(3); // 设置初始消费者数量
|
||||
factory.setMaxConcurrentConsumers(5); // 设置最大消费者数量
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 矿池代理队列
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue poolProxyQueue() {
|
||||
// durable 设置为 true 表示队列持久化
|
||||
return new Queue(POOL_PROXY_QUEUE_NAME, true);
|
||||
}
|
||||
|
||||
//----------------定义订单延迟队列------------------------
|
||||
|
||||
/**
|
||||
* 死信 交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange deadLetterExchange() {
|
||||
return new DirectExchange(DEAD_LETTER_EXCHANGE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 死信 队列
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue deadLetterQueue() {
|
||||
return new Queue(DEAD_LETTER_QUEUE_NAME, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 死信 队列绑定死信交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding deadLetterBinding() {
|
||||
return BindingBuilder.bind(deadLetterQueue()).to(deadLetterExchange()).with(DEAD_LETTER_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange orderOvertimeExchange() {
|
||||
return new DirectExchange(ORDER_OVERTIME_EXCHANGE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 队列 (死信交换机达成延迟队列功能)
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue orderOvertimeQueue() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
// 设置死信交换机
|
||||
args.put("x-dead-letter-exchange", DEAD_LETTER_EXCHANGE_NAME);
|
||||
// 设置死信路由键
|
||||
args.put("x-dead-letter-routing-key", DEAD_LETTER_ROUTING_KEY);
|
||||
// 设置队列中消息的 TTL(单位:毫秒)
|
||||
args.put("x-message-ttl", 900000);
|
||||
return new Queue(ORDER_OVERTIME_QUEUE_NAME, true, false, false, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 队列绑定普通交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding orderOvertimeBinding() {
|
||||
return BindingBuilder.bind(orderOvertimeQueue()).to(orderOvertimeExchange()).with(ORDER_OVERTIME_ROUTING_KEY);
|
||||
}
|
||||
|
||||
//----------------定义订单延迟队列------------------------
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
/**
|
||||
* 声明 Topic 类型的交换机
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange payExchange() {
|
||||
return new DirectExchange(PAY_EXCHANGE);
|
||||
}
|
||||
|
||||
// 支付相关队列声明
|
||||
/**
|
||||
* 声明支付消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payAutoQueue() {
|
||||
return new Queue(PAY_AUTO_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明支付返回消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payAutoReturnQueue() {
|
||||
return new Queue(PAY_AUTO_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 余额充值相关队列声明
|
||||
/**
|
||||
* 声明余额充值消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payRechargeQueue() {
|
||||
return new Queue(PAY_RECHARGE_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明余额充值返回信息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payRechargeReturnQueue() {
|
||||
return new Queue(PAY_RECHARGE_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 余额提现相关队列声明
|
||||
/**
|
||||
* 声明余额提现消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payWithdrawQueue() {
|
||||
return new Queue(PAY_WITHDRAW_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明余额提现返回信息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payWithdrawReturnQueue() {
|
||||
return new Queue(PAY_WITHDRAW_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 支付相关绑定
|
||||
/**
|
||||
* 将支付消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payAutoBinding() {
|
||||
return BindingBuilder.bind(payAutoQueue()).to(payExchange()).with(PAY_AUTO_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将支付返回消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payAutoReturnBinding() {
|
||||
return BindingBuilder.bind(payAutoReturnQueue()).to(payExchange()).with(PAY_AUTO_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
// 余额充值相关绑定
|
||||
/**
|
||||
* 将余额充值消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payRechargeBinding() {
|
||||
return BindingBuilder.bind(payRechargeQueue()).to(payExchange()).with(PAY_RECHARGE_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将余额充值返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payRechargeReturnBinding() {
|
||||
return BindingBuilder.bind(payRechargeReturnQueue()).to(payExchange()).with(PAY_RECHARGE_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
// 余额提现相关绑定
|
||||
/**
|
||||
* 将余额提现消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payWithdrawBinding() {
|
||||
return BindingBuilder.bind(payWithdrawQueue()).to(payExchange()).with(PAY_WITHDRAW_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将余额提现返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payWithdrawReturnBinding() {
|
||||
return BindingBuilder.bind(payWithdrawReturnQueue()).to(payExchange()).with(PAY_WITHDRAW_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//钱包删除 提现相关绑定
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue deleteWalletReturnQueue() {
|
||||
return new Queue(DELETE_WALLET_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue deleteWalletQueue() {
|
||||
return new Queue(DELETE_WALLET_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将钱包删除消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding deleteWalletBinding() {
|
||||
return BindingBuilder.bind(deleteWalletQueue()).to(payExchange()).with(DELETE_WALLET_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将钱包删除返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding deleteWalletReturnBinding() {
|
||||
return BindingBuilder.bind(deleteWalletReturnQueue()).to(payExchange()).with(DELETE_WALLET_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean(name = "customThreadPool")
|
||||
public ThreadPoolTaskExecutor customTaskThreadPool() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程数
|
||||
executor.setCorePoolSize(5);
|
||||
// 最大线程数
|
||||
executor.setMaxPoolSize(10);
|
||||
// 队列容量
|
||||
executor.setQueueCapacity(50);
|
||||
// 线程空闲时间(秒)
|
||||
executor.setKeepAliveSeconds(30);
|
||||
// 线程名前缀
|
||||
executor.setThreadNamePrefix("custom-task-thread-");
|
||||
// 拒绝策略
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Resource
|
||||
private LoginInterceptor loginInterceptor;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(loginInterceptor)
|
||||
.addPathPatterns("/**");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
|
||||
// 设置允许跨域请求路径
|
||||
registry.addMapping("/**")
|
||||
// 设置允许跨域请求的域名
|
||||
.allowedOriginPatterns("*") //或.allowedOriginPatterns("http://www.baidu.com") 指定域名
|
||||
//是否允许cookie
|
||||
.allowCredentials(true)
|
||||
// 设置允许的请求方式
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE")
|
||||
// 设置允许的header属性
|
||||
.allowedHeaders("*")
|
||||
// 允许跨域时间
|
||||
.maxAge(3600);
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import com.m2pool.common.core.utils.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 币种算法
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class Algorithm {
|
||||
public static final String GRS_ALGORITHM= "groestl";
|
||||
|
||||
public static final String MONA_ALGORITHM= "Lyra2REv2";
|
||||
|
||||
public static final String NEXA_ALGORITHM= "NexaPow";
|
||||
|
||||
public static final String RXD_ALGORITHM= "Sha512256D";
|
||||
|
||||
public static final String DGBQ_ALGORITHM= "DigiByte(Qubit)";
|
||||
|
||||
public static final String DGBS_ALGORITHM= "DigiByte(Skein)";
|
||||
|
||||
public static final String DGBO_ALGORITHM= "DigiByte(Odocrypt)";
|
||||
|
||||
public static final String MONERO_ALGORITHM= "randomx";
|
||||
|
||||
public static final String ALPH_ALGORITHM= "Blake3";
|
||||
|
||||
|
||||
|
||||
public static final String GRS_FULL_NAME= "Groestlcoin";
|
||||
|
||||
public static final String MONA_FULL_NAME= "Monacoin";
|
||||
|
||||
public static final String NEXA_FULL_NAME= "nexa";
|
||||
|
||||
public static final String RXD_FULL_NAME= "Radiant";
|
||||
|
||||
public static final String DGBQ_FULL_NAME= "DigiByte(qubit)";
|
||||
|
||||
public static final String DGBS_FULL_NAME= "DigiByte(skein)";
|
||||
|
||||
public static final String DGBO_FULL_NAME= "DigiByte(odocrypt)";
|
||||
|
||||
public static final String MONERO_FULL_NAME= "monero";
|
||||
|
||||
public static final String ALPH_FULL_NAME = "Alephium";
|
||||
|
||||
private static final Map<String, String> ALGORITHM_MAP;
|
||||
|
||||
private static final Map<String, String> COINFLULLNAME_MAP;
|
||||
|
||||
|
||||
static {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("grs", GRS_ALGORITHM);
|
||||
map.put("mona", MONA_ALGORITHM);
|
||||
map.put("nexa", NEXA_ALGORITHM);
|
||||
map.put("rxd", RXD_ALGORITHM);
|
||||
map.put("dgbq", DGBQ_ALGORITHM);
|
||||
map.put("dgbs", DGBS_ALGORITHM);
|
||||
map.put("dgbo", DGBO_ALGORITHM);
|
||||
map.put("monero", MONERO_ALGORITHM);
|
||||
map.put("alph", ALPH_ALGORITHM);
|
||||
ALGORITHM_MAP = Collections.unmodifiableMap(map);
|
||||
HashMap<String, String> mapFullName = new HashMap<>();
|
||||
mapFullName.put("grs", GRS_FULL_NAME);
|
||||
mapFullName.put("mona", MONA_FULL_NAME);
|
||||
mapFullName.put("nexa", NEXA_FULL_NAME);
|
||||
mapFullName.put("rxd", RXD_FULL_NAME);
|
||||
mapFullName.put("dgbq", DGBQ_FULL_NAME);
|
||||
mapFullName.put("dgbs", DGBS_FULL_NAME);
|
||||
mapFullName.put("dgbo", DGBO_FULL_NAME);
|
||||
mapFullName.put("monero", MONERO_FULL_NAME);
|
||||
mapFullName.put("alph", ALPH_FULL_NAME);
|
||||
COINFLULLNAME_MAP = Collections.unmodifiableMap(mapFullName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名称获取对应的算法
|
||||
* @param coinName 币种名称,不区分大小写
|
||||
* @return 对应的每日理论出块数,如果未找到则返回 null
|
||||
*/
|
||||
public static String getAlgorithm(String coinName) {
|
||||
String algorithm = ALGORITHM_MAP.get(coinName.toLowerCase());
|
||||
if (StringUtils.isEmpty(algorithm)){
|
||||
return "";
|
||||
}
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
|
||||
public static String getCoinFullName(String coinName) {
|
||||
String algorithm = COINFLULLNAME_MAP.get(coinName.toLowerCase());
|
||||
if (StringUtils.isEmpty(algorithm)){
|
||||
return "";
|
||||
}
|
||||
return algorithm;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 出块间隔数
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class BlockInterval {
|
||||
// GRS 出块间隔时间单位s
|
||||
public static final BigDecimal GRS_BLOCK_INTERVAL = BigDecimal.valueOf(60);
|
||||
// Mona 出块间隔时间单位s
|
||||
public static final BigDecimal MONA_BLOCK_INTERVAL = BigDecimal.valueOf(90);
|
||||
// NEXA 出块间隔时间单位s
|
||||
public static final BigDecimal NEXA_BLOCK_INTERVAL = BigDecimal.valueOf(120);
|
||||
// RXD 出块间隔时间单位s
|
||||
public static final BigDecimal RXD_BLOCK_INTERVAL= BigDecimal.valueOf(300);
|
||||
|
||||
private static final Map<String, BigDecimal> BLOCK_MAP;
|
||||
|
||||
static {
|
||||
HashMap<String, BigDecimal> map = new HashMap<>();
|
||||
map.put("grs", GRS_BLOCK_INTERVAL);
|
||||
map.put("mona", MONA_BLOCK_INTERVAL);
|
||||
map.put("nexa", NEXA_BLOCK_INTERVAL);
|
||||
map.put("rxd", RXD_BLOCK_INTERVAL);
|
||||
BLOCK_MAP = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名称获取对应的每日理论出块数
|
||||
* @param coinName 币种名称,不区分大小写
|
||||
* @return 对应的每日理论出块数,如果未找到则返回 null
|
||||
*/
|
||||
public static BigDecimal getBlockCountByCoinName(String coinName) {
|
||||
if (coinName == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return BLOCK_MAP.get(coinName.toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import com.m2pool.lease.dto.ChargeDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 币种手续费
|
||||
* @Date 2025/10/23 11:15
|
||||
* @Author yyb
|
||||
*/
|
||||
public enum CoinCharge {
|
||||
|
||||
ETH_USDT("ETH","USDT", BigDecimal.valueOf(1), BigDecimal.valueOf(1)),
|
||||
ETH_ETH("ETH","ETH", BigDecimal.valueOf(0.00005),BigDecimal.valueOf(0.01)),
|
||||
TRON_USDT("TRON","USDT", BigDecimal.valueOf(1),BigDecimal.valueOf(1)),
|
||||
TRON_NEXA("TRON","NEXA", BigDecimal.valueOf(1000),BigDecimal.valueOf(0.1));
|
||||
|
||||
private final String chain;
|
||||
/** 币种参数名 */
|
||||
private final String coin;
|
||||
/** 手续费 */
|
||||
private final BigDecimal amount;
|
||||
/** 费率 */
|
||||
private final BigDecimal feeRate;
|
||||
|
||||
CoinCharge(String chain, String coin, BigDecimal amount, BigDecimal feeRate) {
|
||||
this.chain = chain;
|
||||
this.coin = coin;
|
||||
this.amount = amount;
|
||||
this.feeRate = feeRate;
|
||||
}
|
||||
/**
|
||||
* 根据 chain 和 coin 查找对应的手续费,未找到则返回 1
|
||||
* @param chain 链名
|
||||
* @param coin 币种名
|
||||
* @return 对应的手续费,未找到返回 1
|
||||
*/
|
||||
public static BigDecimal getChargeByChainAndCoin(String chain, String coin) {
|
||||
for (CoinCharge charge : CoinCharge.values()) {
|
||||
if (charge.chain.equals(chain) && charge.coin.equals(coin)) {
|
||||
return charge.amount;
|
||||
}
|
||||
}
|
||||
return BigDecimal.ONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 chain 和 coin 查找对应的手续费,未找到则返回 1
|
||||
* @param chain 链名
|
||||
* @param coin 币种名
|
||||
* @return 对应的手续费,未找到返回 1
|
||||
*/
|
||||
public static BigDecimal getDeductibleAmountByChainAndCoin(String chain, String coin) {
|
||||
for (CoinCharge charge : CoinCharge.values()) {
|
||||
if (charge.chain.equals(chain) && charge.coin.equals(coin)) {
|
||||
return charge.amount.divide(charge.feeRate, 4, RoundingMode.HALF_UP);
|
||||
}
|
||||
}
|
||||
return BigDecimal.ONE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据 chain 和 coin 找到手续费和费率,然后比较totalPrice是否小于 费率/手续费
|
||||
* @param chain 链名
|
||||
* @param coin 币种名
|
||||
* @return 对应的手续费,未找到返回 1
|
||||
*/
|
||||
public static BigDecimal getFee(String chain, String coin, BigDecimal totalPrice) {
|
||||
BigDecimal fee = BigDecimal.ONE;
|
||||
for (CoinCharge charge : CoinCharge.values()) {
|
||||
if (charge.chain.equals(chain) && charge.coin.equals(coin)) {
|
||||
BigDecimal feeRate = charge.feeRate;
|
||||
BigDecimal deductible= charge.amount.divide(feeRate, 4, RoundingMode.HALF_UP);
|
||||
if(deductible.compareTo(totalPrice) < 0){
|
||||
fee = BigDecimal.ZERO;
|
||||
}else{
|
||||
fee = charge.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
return fee;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取枚举类中所有枚举,并封装成 List<ChargeDto>
|
||||
* @return 包含所有枚举信息的 ChargeDto 列表
|
||||
*/
|
||||
public static List<ChargeDto> getAllChargesAsDtoList() {
|
||||
List<ChargeDto> chargeDtoList = new ArrayList<>();
|
||||
for (CoinCharge charge : CoinCharge.values()) {
|
||||
chargeDtoList.add(new ChargeDto(
|
||||
charge.amount,
|
||||
charge.chain,
|
||||
charge.coin,
|
||||
charge.feeRate
|
||||
));
|
||||
}
|
||||
return chargeDtoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DailyBlockOutputConstant {
|
||||
// GRS 每日理论出块数常量
|
||||
public static final BigDecimal GRS_BLOCK = BigDecimal.valueOf(1440);
|
||||
// Mona 每日理论出块数常量
|
||||
public static final BigDecimal MONA_BLOCK = BigDecimal.valueOf(960);
|
||||
// DGBS 每日理论出块数常量
|
||||
public static final BigDecimal DGBS_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGBQ 每日理论出块数常量
|
||||
public static final BigDecimal DGBQ_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGBO 每日理论出块数常量
|
||||
public static final BigDecimal DGBO_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGB2_ODO 每日理论出块数常量
|
||||
public static final BigDecimal DGB2_ODO_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_QUBIT_A10 每日理论出块数常量
|
||||
public static final BigDecimal DGB_QUBIT_A10_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_SKEIN_A10 每日理论出块数常量
|
||||
public static final BigDecimal DGB_SKEIN_A10_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_ODO_B20 每日理论出块数常量
|
||||
public static final BigDecimal DGB_ODO_B20_BLOCK = BigDecimal.valueOf(720);
|
||||
// NEXA 每日理论出块数常量
|
||||
public static final BigDecimal NEXA_BLOCK = BigDecimal.valueOf(720);
|
||||
// RXD 每日理论出块数常量
|
||||
public static final BigDecimal RXD_BLOCK = BigDecimal.valueOf(288);
|
||||
// ALPH 每日理论出块数常量
|
||||
public static final BigDecimal ALPH_BLOCK = BigDecimal.valueOf(5400);
|
||||
// ENX 每日理论出块数常量
|
||||
public static final BigDecimal ENX_BLOCK = BigDecimal.valueOf(86400);
|
||||
|
||||
private static final Map<String, BigDecimal> BLOCK_MAP;
|
||||
|
||||
static {
|
||||
BLOCK_MAP = new HashMap<>();
|
||||
BLOCK_MAP.put("grs", GRS_BLOCK);
|
||||
BLOCK_MAP.put("mona", MONA_BLOCK);
|
||||
BLOCK_MAP.put("dgbs", DGBS_BLOCK);
|
||||
BLOCK_MAP.put("dgbq", DGBQ_BLOCK);
|
||||
BLOCK_MAP.put("dgbo", DGBO_BLOCK);
|
||||
BLOCK_MAP.put("dgb2_odo", DGB2_ODO_BLOCK);
|
||||
BLOCK_MAP.put("dgb_qubit_a10", DGB_QUBIT_A10_BLOCK);
|
||||
BLOCK_MAP.put("dgb_skein_a10", DGB_SKEIN_A10_BLOCK);
|
||||
BLOCK_MAP.put("dgb_odo_b20", DGB_ODO_B20_BLOCK);
|
||||
BLOCK_MAP.put("nexa", NEXA_BLOCK);
|
||||
BLOCK_MAP.put("rxd", RXD_BLOCK);
|
||||
BLOCK_MAP.put("alph", ALPH_BLOCK);
|
||||
BLOCK_MAP.put("enx", ENX_BLOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名称获取对应的每日理论出块数
|
||||
* @param coinName 币种名称,不区分大小写
|
||||
* @return 对应的每日理论出块数,如果未找到则返回 null
|
||||
*/
|
||||
public static BigDecimal getBlockCountByCoinName(String coinName) {
|
||||
if (coinName == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return BLOCK_MAP.get(coinName.toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import com.m2pool.lease.netty.message.GpuMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description 币种算法
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class GpuBrand {
|
||||
|
||||
private static final String NVIDIA= "NVIDIA";
|
||||
|
||||
private static final String AMD= "ADM";
|
||||
|
||||
private static final String APPLE= "APPLE";
|
||||
|
||||
private static final String INTEL= "INTEL";
|
||||
|
||||
private static final List<String> BRAND_LIST;
|
||||
|
||||
|
||||
static {
|
||||
BRAND_LIST = new ArrayList<>();
|
||||
BRAND_LIST.add(NVIDIA);
|
||||
BRAND_LIST.add(AMD);
|
||||
BRAND_LIST.add(APPLE);
|
||||
BRAND_LIST.add(INTEL);
|
||||
}
|
||||
|
||||
public static List<String> trimBrand(List<String> targetList) {
|
||||
return targetList.stream()
|
||||
.map(model -> {
|
||||
for (String brand : BRAND_LIST) {
|
||||
if (model.contains(brand)) {
|
||||
return model.replace(brand, "").trim();
|
||||
}
|
||||
}
|
||||
return model.trim();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 普通订单状态
|
||||
* @Date 2025/9/3 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public enum OrderStatus {
|
||||
PENDING_PAYMENT(0, "待支付"),
|
||||
FULLY_PAID(1, "(全部)已支付"),
|
||||
CANCELLED(2, "已取消"),
|
||||
AFTER_SALES(3, "售后状态"),
|
||||
REFUNDED(4, "已退款"),
|
||||
PAYMENT_TIMEOUT(5, "支付已超时"),
|
||||
PAYMENT_IN_PROGRESS(6, "支付中"),
|
||||
PARTIALLY_PAID(10, "部分已支付");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
OrderStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态编码
|
||||
* @return 订单状态编码
|
||||
*/
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态描述
|
||||
* @return 订单状态描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码获取对应的订单状态枚举
|
||||
* @param code 订单状态编码
|
||||
* @return 订单状态枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static OrderStatus getByCode(int code) {
|
||||
for (OrderStatus status : OrderStatus.values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 支付订单状态
|
||||
* @Date 2025/9/3 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public enum PaymentStatus {
|
||||
PAYMENT_FAILED(0, "支付失败"),
|
||||
PAYMENT_SUCCESS_FULL(1, "支付成功--全部货款已支付"),
|
||||
PENDING_PAYMENT(2, "待支付"),
|
||||
PAYMENT_TIMEOUT(5, "支付已超时"),
|
||||
PAYMENT_IN_PROGRESS(6, "支付中"),
|
||||
PAYMENT_SUCCESS_PARTIAL(10, "支付成功--已支付部分货款");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
PaymentStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付状态编码
|
||||
* @return 支付状态编码
|
||||
*/
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付状态描述
|
||||
* @return 支付状态描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码获取对应的支付状态枚举
|
||||
* @param code 支付状态编码
|
||||
* @return 支付状态枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static PaymentStatus getByCode(int code) {
|
||||
for (PaymentStatus status : PaymentStatus.values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 单位换算
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class PowerUnit {
|
||||
|
||||
public static final String KH_UNIT = "KH/S";
|
||||
|
||||
public static final String MH_UNIT = "MH/S";
|
||||
|
||||
public static final String GH_UNIT = "GH/S";
|
||||
|
||||
public static final String TH_UNIT = "TH/S";
|
||||
|
||||
public static final String PH_UNIT = "PH/S";
|
||||
|
||||
private static final Map<String, BigDecimal> UNIT_MAP;
|
||||
|
||||
static {
|
||||
HashMap<String, BigDecimal> map = new HashMap<>();
|
||||
map.put(KH_UNIT, BigDecimal.valueOf(1000));
|
||||
map.put(MH_UNIT, BigDecimal.valueOf(1000 * 1000));
|
||||
map.put(GH_UNIT, BigDecimal.valueOf(1000L * 1000 * 1000));
|
||||
map.put(TH_UNIT, BigDecimal.valueOf(1000L * 1000 * 1000 * 1000 ));
|
||||
map.put(PH_UNIT, BigDecimal.valueOf(1000L * 1000 * 1000 * 1000 * 1000));
|
||||
UNIT_MAP = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
|
||||
public static BigDecimal getPower(String unit) {
|
||||
if (unit == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return UNIT_MAP.get(unit);
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 常量信息
|
||||
* @Date 2024/6/11 18:13
|
||||
* @Author dy
|
||||
*/
|
||||
public class RabbitmqConstant {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 矿池代理消息队列
|
||||
*/
|
||||
public static final String POOL_PROXY_QUEUE_NAME = "pool.proxy.queue";
|
||||
|
||||
/**
|
||||
* 矿池代理消息correlationData(用于生成者手动ack)
|
||||
*/
|
||||
public static final String POOL_PROXY_CORRELATION = "pool.proxy.message";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单超时消息 交换机
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_EXCHANGE_NAME = "order.overtime.exchange";
|
||||
|
||||
/**
|
||||
* 订单超时消息 路由键
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_ROUTING_KEY = "order.overtime.routing.key";
|
||||
/**
|
||||
*
|
||||
* 订单超时消息 队列
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_QUEUE_NAME = "order.overtime.queue";
|
||||
/**
|
||||
* 订单超时消息correlationData(用于生成者手动ack)
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_CORRELATION= "order.overtime.message";
|
||||
|
||||
/**
|
||||
* 死信 队列
|
||||
*/
|
||||
public static final String DEAD_LETTER_QUEUE_NAME = "dead.letter.queue";
|
||||
/**
|
||||
* 死信 交换机
|
||||
*/
|
||||
public static final String DEAD_LETTER_EXCHANGE_NAME = "dead.letter.exchange";
|
||||
/**
|
||||
* 死信 路由键
|
||||
*/
|
||||
public static final String DEAD_LETTER_ROUTING_KEY = "dead.letter.routing.key";
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
|
||||
/**
|
||||
* 支付模块 交换机
|
||||
*/
|
||||
public static final String PAY_EXCHANGE = "pay.exchange";
|
||||
|
||||
|
||||
/**
|
||||
* 支付 消息队列
|
||||
*/
|
||||
public static final String PAY_AUTO_QUEUE = "pay.auto.queue";
|
||||
|
||||
/**
|
||||
* 支付 路由键
|
||||
*/
|
||||
public static final String PAY_AUTO_ROUTING_KEY = "pay.auto.routing.key";
|
||||
|
||||
/**
|
||||
* 支付 返回消息消息队列
|
||||
*/
|
||||
public static final String PAY_AUTO_RETURN_QUEUE = "pay.auto.return.queue";
|
||||
|
||||
/**
|
||||
* 支付 返回消息路由键
|
||||
*/
|
||||
public static final String PAY_AUTO_RETURN_ROUTING_KEY = "pay.auto.return.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 余额充值 消息队列
|
||||
*/
|
||||
public static final String PAY_RECHARGE_QUEUE = "pay.recharge.queue";
|
||||
|
||||
/**
|
||||
* 余额充值 路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_RECHARGE_ROUTING_KEY = "pay.recharge.routing.key";
|
||||
|
||||
/**
|
||||
* 余额充值 返回信息消息队列
|
||||
*/
|
||||
public static final String PAY_RECHARGE_RETURN_QUEUE = "pay.recharge.return.queue";
|
||||
|
||||
/**
|
||||
* 余额充值 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_RECHARGE_RETURN_ROUTING_KEY = "pay.recharge.return.routing.key";
|
||||
/**
|
||||
* 余额提现 消息队列
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_QUEUE = "pay.withdraw.queue";
|
||||
|
||||
/**
|
||||
* 余额提现 路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_ROUTING_KEY = "pay.withdraw.routing.key";
|
||||
|
||||
/**
|
||||
* 余额提现 返回信息消息队列
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_RETURN_QUEUE = "pay.withdraw.return.queue";
|
||||
/**
|
||||
* 余额提现 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_RETURN_ROUTING_KEY = "pay.withdraw.return.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 钱包删除 信息消息队列
|
||||
*/
|
||||
public static final String DELETE_WALLET_QUEUE = "pay.remove.queue";
|
||||
/**
|
||||
* 钱包删除 信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String DELETE_WALLET_ROUTING_KEY = "pay.remove.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 钱包删除 返回信息消息队列
|
||||
*/
|
||||
public static final String DELETE_WALLET_RETURN_QUEUE = "pay.remove.return.queue";
|
||||
/**
|
||||
* 钱包删除 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String DELETE_WALLET_RETURN_ROUTING_KEY = "pay.remove.return.routing.key";
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 常量信息
|
||||
* @Date 2024/6/11 18:13
|
||||
* @Author dy
|
||||
*/
|
||||
public class ResponseConstant {
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
public static final Integer SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
public static final Integer FAIL = 500;
|
||||
|
||||
/**
|
||||
* 登录成功状态
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS_STATUS = "0";
|
||||
|
||||
/**
|
||||
* 登录失败状态
|
||||
*/
|
||||
public static final String LOGIN_FAIL_STATUS = "1";
|
||||
|
||||
/**
|
||||
* 登录成功
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS = "Success";
|
||||
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public static final String LOGOUT = "Logout";
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public static final String REGISTER = "Register";
|
||||
|
||||
/**
|
||||
* 登录失败
|
||||
*/
|
||||
public static final String LOGIN_FAIL = "Error";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 验证码 redis key
|
||||
*/
|
||||
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
||||
|
||||
/**
|
||||
* 验证码有效期(分钟)
|
||||
*/
|
||||
public static final long CAPTCHA_EXPIRATION = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 参数管理 cache key
|
||||
*/
|
||||
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
public static final String RESOURCE_PREFIX = "/profile";
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.v2.GoogleInfoDto;
|
||||
import com.m2pool.lease.service.LeaseUserService;
|
||||
import com.m2pool.lease.vo.EmailCodeVo;
|
||||
import com.m2pool.lease.vo.UserLoginVo;
|
||||
import com.m2pool.lease.vo.UserRegisterVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleBindVo;
|
||||
import com.m2pool.lease.vo.v2.GoogleCloseVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "用户授权控制器")
|
||||
@LoginRequired(value = false)
|
||||
@RestController
|
||||
@RequestMapping("/auth")
|
||||
public class LeaseAuthController {
|
||||
|
||||
@Resource
|
||||
private LeaseUserService leaseUserService;
|
||||
|
||||
@Decrypt
|
||||
@PostMapping("/login")
|
||||
@ApiOperation(value = "用户登录")
|
||||
public Result<Map<String, Object>> login(@RequestBody UserLoginVo userLoginVo){
|
||||
return leaseUserService.login(userLoginVo);
|
||||
}
|
||||
|
||||
|
||||
@Decrypt
|
||||
@PostMapping("/register")
|
||||
@ApiOperation(value = "用户注册")
|
||||
public Result<String> register(@RequestBody UserRegisterVo userRegisterVo){
|
||||
return leaseUserService.register(userRegisterVo);
|
||||
}
|
||||
|
||||
@Decrypt
|
||||
@PostMapping("/updatePassword")
|
||||
@ApiOperation(value = "修改密码")
|
||||
public Result<String> updatePassword(@RequestBody UserLoginVo userLoginVo){
|
||||
return leaseUserService.updatePassword(userLoginVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/logout")
|
||||
@ApiOperation(value = "登出")
|
||||
public Result<String> logout(){
|
||||
return leaseUserService.logout();
|
||||
}
|
||||
|
||||
@PostMapping("/sendLoginCode")
|
||||
@ApiOperation(value = "发送用户登录邮箱验证码")
|
||||
public Result<String> sendLoginCode(@RequestBody @Valid EmailCodeVo emailCodeVo){
|
||||
return leaseUserService.sendLoginCode(emailCodeVo);
|
||||
}
|
||||
|
||||
@PostMapping("/sendRegisterCode")
|
||||
@ApiOperation(value = "发送用户注册邮箱验证码")
|
||||
public Result<String> sendRegisterCode(@RequestBody @Valid EmailCodeVo emailCodeVo){
|
||||
return leaseUserService.sendRegisterCode(emailCodeVo);
|
||||
}
|
||||
|
||||
@PostMapping("/sendUpdatePwdCode")
|
||||
@ApiOperation(value = "发送修改密码验证码")
|
||||
public Result<String> sendUpdatePwdCode(@RequestBody @Valid EmailCodeVo emailCodeVo){
|
||||
return leaseUserService.sendUpdatePwdCode(emailCodeVo);
|
||||
}
|
||||
|
||||
/*-----------------------------谷歌双重验证接口----------------------------*/
|
||||
|
||||
@Decrypt
|
||||
@LoginRequired
|
||||
@PostMapping("/bindGoogle")
|
||||
@ApiOperation(value = "绑定开启谷歌验证")
|
||||
public Result<String> bindGoogle(@RequestBody @Valid GoogleBindVo googleBindVo){
|
||||
return leaseUserService.bindGoogle(googleBindVo);
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@PostMapping("/getBindInfo")
|
||||
@ApiOperation(value = "获取谷歌验证器安全码和验证码")
|
||||
public Result<GoogleInfoDto> getBindInfo(){
|
||||
return leaseUserService.getBindInfo();
|
||||
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@PostMapping("/sendOpenGoogleCode")
|
||||
@ApiOperation(value = "开启谷歌验证器 发送邮箱验证码")
|
||||
public Result<String> sendOpenGoogleCode(){
|
||||
return leaseUserService.sendOpenGoogleCode();
|
||||
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@PostMapping("/sendCloseGoogleCode")
|
||||
@ApiOperation(value = "关闭谷歌验证器 发送邮箱验证码")
|
||||
public Result<String> sendCloseGoogleCode(){
|
||||
return leaseUserService.sendCloseGoogleCode();
|
||||
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
@PostMapping("/closeStepTwo")
|
||||
@ApiOperation(value = "关闭双重验证")
|
||||
public Result<String> closeStepTwo(@Valid @RequestBody GoogleCloseVo vo){
|
||||
return leaseUserService.closeStepTwo(vo);
|
||||
|
||||
}
|
||||
|
||||
/*-----------------------------谷歌双重验证接口----------------------------*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.OrderInfoDto;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.PaymentRecordDto;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.service.LeaseOrderInfoService;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "订单控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/order/info")
|
||||
public class LeaseOrderInfoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private LeaseOrderInfoService leaseOrderInfoService;
|
||||
|
||||
@ApiOperation("创建订单及订单详情 + 支付订单(返回二维码内容)")
|
||||
@PostMapping("/addOrders")
|
||||
@Decrypt
|
||||
public Result<String> addOrders(@RequestBody OrderAndCodeVo orderAndCodeVo) {
|
||||
return leaseOrderInfoService.addOrders(orderAndCodeVo);
|
||||
}
|
||||
|
||||
@ApiOperation("订单支付超时--再次购买功能")
|
||||
@PostMapping("/buyAgain")
|
||||
@Deprecated
|
||||
public Result<List<PaymentRecordDto>> buyAgain(@RequestBody List<OrderInfoVo> orderInfoVoList) {
|
||||
return leaseOrderInfoService.buyAgain(orderInfoVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("查询订单列表(买家)")
|
||||
@PostMapping("/getOrdersByStatus")
|
||||
public PageResult<OrderInfoDto> getOrdersByStatus(@RequestBody OrderInfoStateVo orderInfoStateVo) {
|
||||
return leaseOrderInfoService.getOrdersByStatus(orderInfoStateVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("卖家已售出订单列表(卖家)")
|
||||
@PostMapping("/getOrdersByStatusForSeller")
|
||||
public PageResult<OrderInfoDto> getOrdersByStatusForSeller(@RequestBody OrderInfoStateVo orderInfoStateVo) {
|
||||
return leaseOrderInfoService.getOrdersByStatusForSeller(orderInfoStateVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据订单id查询订单信息")
|
||||
@PostMapping("/getOrdersByIds")
|
||||
public Result<OrderInfoDto> getOrdersByIds(@RequestBody OrderVo orderVo) {
|
||||
return leaseOrderInfoService.getOrdersByIds(orderVo);
|
||||
}
|
||||
|
||||
@ApiOperation("取消订单(如果有支付订单同时取消)")
|
||||
@PostMapping("/cancelOrder")
|
||||
public Result<String> cancelOrder(@RequestBody OrderVo orderVo) {
|
||||
return leaseOrderInfoService.cancelOrder(orderVo);
|
||||
}
|
||||
|
||||
@ApiOperation("生成订单时获取用户选择的支付币种 实时币价")
|
||||
@PostMapping("/getCoinPrice")
|
||||
public Result<BigDecimal> getCoinPrice(@RequestBody CoinVo coinVo){
|
||||
return leaseOrderInfoService.getCoinPrice(coinVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.v2.*;
|
||||
import com.m2pool.lease.service.LeaseOrderInfoService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.OrderAndCodeVo;
|
||||
import com.m2pool.lease.vo.PageVo;
|
||||
import com.m2pool.lease.vo.v2.CoinAndAlgorithmVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "v2版本--订单控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/v2/order/info")
|
||||
public class LeaseOrderInfoV2Controller {
|
||||
|
||||
@Resource
|
||||
private LeaseOrderInfoService leaseOrderInfoService;
|
||||
|
||||
@ApiOperation("算法币种选择框:购物车结算获取选中矿机支持的算法和币种列表")
|
||||
@PostMapping("/getMachineSupportCoinAndAlgorithm")
|
||||
public Result<List<CoinAndAlgorithmListDto>> getMachineSupportCoinAndAlgorithm(@RequestBody List<BaseVo> machineIds) {
|
||||
return leaseOrderInfoService.getMachineSupportCoinAndAlgorithm(machineIds);
|
||||
}
|
||||
|
||||
@ApiOperation("矿池选择框:根据矿机id 获取当前矿机支持的矿池币种信息")
|
||||
@PostMapping("/getMachineSupportPool")
|
||||
public Result<List<MiningInfoDto>> getMachineSupportPool(@RequestBody CoinAndAlgorithmVo coinAndAlgorithmVo) {
|
||||
return leaseOrderInfoService.getMachineSupportPool(coinAndAlgorithmVo);
|
||||
}
|
||||
|
||||
@ApiOperation("创建订单及订单详情 + 支付订单(返回二维码内容)")
|
||||
@PostMapping("/addOrdersV2")
|
||||
@Decrypt
|
||||
public Result<String> addOrdersV2(@RequestBody OrderAndCodeVo orderAndCodeVo) {
|
||||
return leaseOrderInfoService.addOrdersV2(orderAndCodeVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("买家:已购矿机列表")
|
||||
@PostMapping("/getPurchasedItems")
|
||||
public PageResult<PurchasedMachineListDto> getPurchasedItems(@RequestBody(required = false) PageVo pageVo) {
|
||||
if (pageVo == null){
|
||||
pageVo = new PageVo();
|
||||
}
|
||||
return leaseOrderInfoService.getPurchasedItems(pageVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("买家:根据id查询已购矿机详情")
|
||||
@PostMapping("/getPurchasedInfo")
|
||||
public Result<MiningConfigInfoDto> getPurchasedInfo(@RequestBody BaseVo baseVo) {
|
||||
return leaseOrderInfoService.getPurchasedInfo(baseVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.dto.PaymentCallbackDto;
|
||||
import com.m2pool.lease.dto.PaymentRecordDto;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.service.LeasePaymentRecordService;
|
||||
import com.m2pool.lease.vo.CheckPayStatusVo;
|
||||
import com.m2pool.lease.vo.OrderVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "支付记录控制器")
|
||||
@RestController
|
||||
@RequestMapping("/payment/record")
|
||||
public class LeasePaymentRecordController {
|
||||
|
||||
@Resource
|
||||
private LeasePaymentRecordService leasePaymentRecordService;
|
||||
|
||||
@ApiOperation("根据订单详情信息生成 支付订单 + 根据返回的集合生成多个支付二维码")
|
||||
@PostMapping("/addPayOrder")
|
||||
@Deprecated
|
||||
public Result<List<PaymentRecordDto>> addPayOrder(@RequestBody OrderVo orderVo) {
|
||||
return leasePaymentRecordService.addPayOrder(orderVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据订单id找到支付订单")
|
||||
@PostMapping("/getPayOrderByOrderId")
|
||||
public Result<List<PaymentRecordDto>> getPayOrderByOrderId(@RequestBody OrderVo orderVo) {
|
||||
return leasePaymentRecordService.getPayOrderByOrderId(orderVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("支付回调结果---根据订单id批量校验本次支付是否成功")
|
||||
@PostMapping("/paymentCallbackBatch")
|
||||
@Deprecated
|
||||
public Result<List<PaymentCallbackDto>> paymentCallbackBatch(@RequestBody List<CheckPayStatusVo> checkPayStatusVoList) {
|
||||
return leasePaymentRecordService.paymentCallbackBatch(checkPayStatusVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("支付回调结果----根据支付id校验支付是否成功")
|
||||
@PostMapping("/paymentCallbackByPayId")
|
||||
@Deprecated
|
||||
public Result<PaymentCallbackDto> paymentCallbackByPayId(@RequestBody CheckPayStatusVo checkPayStatusVo) {
|
||||
return leasePaymentRecordService.paymentCallbackByPayId(checkPayStatusVo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseProductService;
|
||||
import com.m2pool.lease.service.LeaseUserOwnedProductService;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "商品控制器")
|
||||
@RestController
|
||||
@RequestMapping("/product")
|
||||
public class LeaseProductController {
|
||||
@Autowired
|
||||
private LeaseProductService leaseProductService;
|
||||
|
||||
|
||||
@Resource
|
||||
private LeaseUserOwnedProductService leaseUserOwnedProductService;
|
||||
@ApiOperation("查询商品列表(不包含商品对应的售卖机器详情列表)")
|
||||
@PostMapping("/getList")
|
||||
public PageResult<ProductDto> getProductList(@RequestBody(required = false) ProductPageVo productPageVo) {
|
||||
if (productPageVo == null){
|
||||
productPageVo = new ProductPageVo();
|
||||
}
|
||||
return leaseProductService.getProductList(productPageVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据商品id查询单个商品详情信息")
|
||||
@PostMapping("/getMachineInfoById")
|
||||
public Result<ProductDto> getMachineInfoById(@RequestBody BaseVo baseVo) {
|
||||
return leaseProductService.getMachineInfoById(baseVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("查询单个商品详情(包含商品对应的售卖机器详情列表)")
|
||||
@PostMapping("/getMachineInfo")
|
||||
public PageResult<ProductMachineDto> getProductMachineInfo(@RequestBody ProductMachineVo productMachineVo) {
|
||||
return leaseProductService.getProductMachineInfo(productMachineVo);
|
||||
}
|
||||
|
||||
@ApiOperation("单个商品矿机列表页面---获取支付方式")
|
||||
@PostMapping("/getPayTypes")
|
||||
public Result<List<PayConfigDto>> getPayTypes() {
|
||||
return leaseProductService.getPayTypes();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("新增商品(不包含商品对应的售卖机器)")
|
||||
@PostMapping("/add")
|
||||
public Result<String> addProduct(@RequestBody ProductURDVo productURDVo) {
|
||||
return leaseProductService.addProduct(productURDVo);
|
||||
}
|
||||
|
||||
@ApiOperation("编辑商品 + 商品上下架(不包含商品对应的售卖机器)")
|
||||
@PostMapping("/update")
|
||||
public Result<String> updateProduct(@RequestBody ProductURDVo productURDVo) {
|
||||
return leaseProductService.updateProduct(productURDVo);
|
||||
}
|
||||
|
||||
@ApiOperation("删除商品(包含商品对应的售卖机器)")
|
||||
@PostMapping("/delete")
|
||||
public Result<String> deleteProduct(@RequestBody BaseVo baseVo) {
|
||||
return leaseProductService.deleteProduct(baseVo.getId());
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("用户查询当前自身已购商品列表")
|
||||
@PostMapping("/getOwnedList")
|
||||
public PageResult<UserOwnedProductDto> getOwnedList(@RequestBody(required = false) UserOwnedProductVo userOwnedProductVo) {
|
||||
if (userOwnedProductVo == null){
|
||||
userOwnedProductVo = new UserOwnedProductVo();
|
||||
}
|
||||
return leaseUserOwnedProductService.getOwnedList(userOwnedProductVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据id查询当前自身已购商品详情")
|
||||
@PostMapping("/getOwnedById")
|
||||
public Result<UserOwnedProductDto> getOwnedById(@RequestBody BaseVo baseVo) {
|
||||
return leaseUserOwnedProductService.getOwnedById(baseVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询用户店铺支持的支付方式")
|
||||
@PostMapping("/getSupportPayType")
|
||||
public Result<List<PayTypeDto>> getSupportPayType() {
|
||||
return leaseProductService.getSupportPayType();
|
||||
}
|
||||
|
||||
|
||||
//TODO 2025-11-21 查询店铺的矿机列表,不存在商品了
|
||||
|
||||
@ApiOperation("获取店铺商品列表用于新增绑定店铺钱包")
|
||||
@PostMapping("/getProductListForShopWalletConfig")
|
||||
public Result<List<ProductForWalletConfigDto>> getProductListForShopWalletConfig() {
|
||||
return leaseProductService.getProductListForShopWalletConfig();
|
||||
}
|
||||
|
||||
//TODO 2025-11-21 修改这些矿机的价格,并且绑定新钱包
|
||||
|
||||
@ApiOperation("新增绑定店铺钱包并设置店铺下面每个矿机该钱包币种的售价 + 钱包绑定")
|
||||
@PostMapping("/updateProductListForShopWalletConfig")
|
||||
@Decrypt
|
||||
public Result<String> updateProductListForShopWalletConfig(@RequestBody ProductMachineForWalletConfigVo productMachineForWalletConfigVo) {
|
||||
return leaseProductService.updateProductListForShopWalletConfig(productMachineForWalletConfigVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.ProductUpdateMachineDto;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.UserMinerDto;
|
||||
import com.m2pool.lease.service.LeaseProductMachineService;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表对应的物品机器表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "商品矿机控制器(库存控制器)")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/product/machine")
|
||||
public class LeaseProductMachineController {
|
||||
|
||||
|
||||
@Resource
|
||||
private LeaseProductMachineService leaseProductMachineService;
|
||||
|
||||
|
||||
@ApiOperation("根据 登录账户 获取挖矿账户及挖矿币种集合----用于用户为商品添加实际出售机器库存")
|
||||
@PostMapping("/getUserMinersList")
|
||||
public Result<Map<String, List<UserMinerDto>>> getUserMinersList(@RequestBody UserMinerVo userMinerVo) {
|
||||
return leaseProductMachineService.getUserMinersList(userMinerVo);
|
||||
}
|
||||
|
||||
@ApiOperation("根据挖矿账户获取对应的 矿机机器编码集合----用于用户为商品添加实际出售机器库存")
|
||||
@PostMapping("/getUserMachineList")
|
||||
public Result<List<UserMinerDto>> getUserMachineList(@RequestBody UserMinerVo userMinerVo) {
|
||||
return leaseProductMachineService.getUserMachineList(userMinerVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("根据商品id查询商品矿机列表----用于卖方修改矿机信息")
|
||||
@PostMapping("/getMachineListForUpdate")
|
||||
public PageResult<ProductUpdateMachineDto> getMachineListForUpdate(@RequestBody ProductForUpdateMachineVo productForUpdateMachineVo) {
|
||||
return leaseProductMachineService.getMachineListForUpdate(productForUpdateMachineVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("单个新增或批量新增出售机器")
|
||||
@PostMapping("/addSingleOrBatchMachine")
|
||||
public Result<String> addSingleOrBatchMachine(@RequestBody ProductMachineParamsVo productMachineParamsVoList) {
|
||||
return leaseProductMachineService.addSingleOrBatchMachine(productMachineParamsVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("单个/批量 编辑矿机 + 矿机上下架")
|
||||
@PostMapping("/updateMachine")
|
||||
public Result<String> updateMachine(@RequestBody List<ProductUpdateMachineVo> productUpdateMachineVoList) {
|
||||
return leaseProductMachineService.updateMachine(productUpdateMachineVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("根据矿机id 删除商品矿机")
|
||||
@PostMapping("/delete")
|
||||
public Result<String> deleteMachine(@RequestBody BaseVo baseVo) {
|
||||
return leaseProductMachineService.deleteMachine(baseVo);
|
||||
}
|
||||
|
||||
|
||||
//@ApiOperation("价格计算器---添加机器到商品中时需要给一个价格")
|
||||
//@PostMapping("/calculatePrice")
|
||||
//public Result<BigDecimal> calculatePrice(@RequestBody PriceCalculateVo priceCalculateVo) {
|
||||
// return leaseProductMachineService.calculatePrice(priceCalculateVo);
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.dto.v2.MachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.SellerMachineInfoDto;
|
||||
import com.m2pool.lease.dto.v2.ShopInfoDto;
|
||||
import com.m2pool.lease.service.LeaseMachineService;
|
||||
import com.m2pool.lease.vo.*;
|
||||
import com.m2pool.lease.vo.v2.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品表对应的物品机器表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "v2版本--矿机控制器类")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/v2/product/machine")
|
||||
public class LeaseProductMachineV2Controller {
|
||||
|
||||
|
||||
@Resource
|
||||
private LeaseMachineService leaseMachineService;
|
||||
|
||||
@ApiOperation("商城首页---店铺列表")
|
||||
@LoginRequired(value = false)
|
||||
@PostMapping("/getShopList")
|
||||
public PageResult<ShopInfoDto> getShopList(@RequestBody(required = false) ProductPageVo productPageVo) {
|
||||
if(productPageVo == null){
|
||||
productPageVo = new ProductPageVo();
|
||||
}
|
||||
return leaseMachineService.getShopList(productPageVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("商城首页---店铺对应矿机详情列表")
|
||||
@LoginRequired(value = false)
|
||||
@PostMapping("/getShopMachineList")
|
||||
public PageResult<MachineInfoDto> getShopMachineList(@RequestBody ShopMachineVo shopMachineVo) {
|
||||
return leaseMachineService.getShopMachineList(shopMachineVo);
|
||||
}
|
||||
|
||||
@ApiOperation("卖家页面---矿机列表")
|
||||
@PostMapping("/getShopMachineListForSeller")
|
||||
public PageResult<SellerMachineInfoDto> getShopMachineListForSeller(@RequestBody(required = false) SellerMachineVo sellerMachineVo) {
|
||||
if (sellerMachineVo == null) {
|
||||
sellerMachineVo = new SellerMachineVo();
|
||||
}
|
||||
return leaseMachineService.getShopMachineListForSeller(sellerMachineVo);
|
||||
}
|
||||
|
||||
@ApiOperation("卖家页面---新增ASIC矿机")
|
||||
@PostMapping("/addAsicMachine")
|
||||
public Result<String> addAsicMachine(@RequestBody AsicMachineParamsVo asicMachineParamsVo) {
|
||||
return leaseMachineService.addAsicMachine(asicMachineParamsVo);
|
||||
}
|
||||
|
||||
@ApiOperation("卖家页面---修改ASIC矿机")
|
||||
@PostMapping("/updateAsicMachine")
|
||||
public Result<String> updateAsicMachine(@RequestBody AsicMachineParamsVo asicMachineParamsVo) {
|
||||
return leaseMachineService.updateAsicMachine(asicMachineParamsVo);
|
||||
}
|
||||
|
||||
@ApiOperation("卖家页面--- 批量修改GPU矿机 和 批量上下架")
|
||||
@PostMapping("/updateGpuMachine")
|
||||
public Result<String> updateGpuMachine(@RequestBody List<GpuMachineParamsVo> gpuMachineParamsVoList) {
|
||||
return leaseMachineService.updateGpuMachine(gpuMachineParamsVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("卖家页面---GPU/ASIC矿机上下架")
|
||||
@PostMapping("/updateMachineState")
|
||||
public Result<String> updateMachineState(@RequestBody MachineStateVo machineStateVo) {
|
||||
return leaseMachineService.updateMachineState(machineStateVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("卖家页面---根据矿机id删除GPU/ASIC矿机")
|
||||
@PostMapping("/deleteMachine")
|
||||
public Result<String> deleteMachine(@RequestBody BaseVo baseVo) {
|
||||
return leaseMachineService.deleteMachine(baseVo);
|
||||
}
|
||||
|
||||
@ApiOperation("获取租赁系统支持的币种")
|
||||
@GetMapping("/getSupportCoin")
|
||||
public Result<List<String>> getSupportCoin() {
|
||||
return leaseMachineService.getSupportCoin();
|
||||
}
|
||||
|
||||
@ApiOperation("根据币种获取租赁系统支持的算法")
|
||||
@GetMapping("/getSupportAlgo")
|
||||
public Result<List<String>> getSupportAlgo(@RequestParam String coin) {
|
||||
return leaseMachineService.getSupportAlgo(coin);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseShopService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.ShopConfigVo;
|
||||
import com.m2pool.lease.vo.ShopVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Api(tags = "店铺控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/shop")
|
||||
public class LeaseShopController {
|
||||
|
||||
@Resource
|
||||
private LeaseShopService leaseShopService;
|
||||
|
||||
/**
|
||||
* 新增店铺
|
||||
* @param shopVo 店铺信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("新增店铺")
|
||||
@PostMapping("/addShop")
|
||||
public Result<String> addShop(@RequestBody ShopVo shopVo) {
|
||||
|
||||
return leaseShopService.addShop(shopVo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改店铺
|
||||
* @param shopVo 店铺信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("根据店铺id修改店铺")
|
||||
@PostMapping("/updateShop")
|
||||
public Result<String> updateShop(@RequestBody ShopVo shopVo) {
|
||||
return leaseShopService.updateShop(shopVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭/打开店铺
|
||||
* @param baseVo 店铺 ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("根据店铺id关闭店铺")
|
||||
@PostMapping("/closeShop")
|
||||
public Result<String> closeShop(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.closeShop(baseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户邮箱查询店铺
|
||||
* @return 店铺信息
|
||||
*/
|
||||
@ApiOperation("根据用户邮箱查询店铺")
|
||||
@GetMapping("/getShopByUserEmail")
|
||||
public Result<ShopDto> getShopByUserEmail() {
|
||||
return leaseShopService.getShopByUserEmail();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据店铺id查询店铺
|
||||
* @param baseVo 店铺 ID
|
||||
* @return 店铺信息
|
||||
*/
|
||||
@ApiOperation("根据店铺id查询店铺")
|
||||
@PostMapping("/getShopById")
|
||||
public Result<ShopDto> getShopById(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.getShopById(baseVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除店铺(逻辑删除)
|
||||
* @param baseVo 店铺 ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("删除店铺")
|
||||
@PostMapping("/deleteShop")
|
||||
public Result<String> deleteShop(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.deleteShop(baseVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("根据店铺id获取到商品列表")
|
||||
@PostMapping("/getProductListById")
|
||||
public Result<List<ShopNameDto>> getProductListById(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.getProductListById(baseVo);
|
||||
}
|
||||
/**
|
||||
* 根据店铺id 查询配置信息列表
|
||||
* @param baseVo
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("钱包配置----根据店铺id查询收款钱包绑定信息列表")
|
||||
@PostMapping("/getShopConfig")
|
||||
public Result<List<ShopConfigDto>> getShopConfig(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.getShopConfig(baseVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商铺配置 (新增配置时,如果没有指定商品,就默通用配置)
|
||||
* @param shopConfigVo 商铺配置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("钱包配置---新增商铺收款钱包绑定配置(弃用,业务移到/product/updateProductListForShopWalletConfig 接口)")
|
||||
@PostMapping("/addShopConfig")
|
||||
@Deprecated
|
||||
public Result<String> addShopConfig(@RequestBody ShopConfigVo shopConfigVo) {
|
||||
return leaseShopService.addShopConfig(shopConfigVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改配置
|
||||
* @param shopConfigVo 商铺配置信息
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("钱包配置----根据配置id 修改商铺收款钱包配置")
|
||||
@PostMapping("/updateShopConfig")
|
||||
public Result<String> updateShopConfig(@RequestBody ShopConfigVo shopConfigVo) {
|
||||
return leaseShopService.updateShopConfig(shopConfigVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配置(逻辑删除)
|
||||
* @param baseVo 配置 ID
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("钱包配置----根据配置id 删除商铺收款钱包配置")
|
||||
@PostMapping("/deleteShopConfig")
|
||||
public Result<String> deleteShopConfig(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.deleteShopConfig(baseVo);
|
||||
}
|
||||
|
||||
@ApiOperation("钱包配置(用于充值选择链和币种)----获取链(一级)和币(二级) 下拉列表(获取本系统支持的链和币种)")
|
||||
@PostMapping("/getChainAndList")
|
||||
public Result<List<ChainListDto>> getChainAndList(){
|
||||
return leaseShopService.getChainAndList();
|
||||
}
|
||||
|
||||
@ApiOperation("钱包配置(用于下单选择商家支持的链和币种)----获取链(一级)和币(二级) 下拉列表(获取本商家支持的链和币种)")
|
||||
@PostMapping("/getChainAndListForSeller")
|
||||
public Result<List<ChainListDto>> getChainAndListForSeller(@RequestBody BaseVo baseVo){
|
||||
return leaseShopService.getChainAndListForSeller(baseVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("钱包配置(用于修改卖家钱包地址)----获取链(一级)和币(二级) 下拉列表(获取本系统支持的链和币种)")
|
||||
@PostMapping("/getChainAndCoin")
|
||||
public Result<ChainListDto> getChainAndCoin(@RequestBody BaseVo baseVo){
|
||||
return leaseShopService.getChainAndCoin(baseVo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.annotation.LedgerLog;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.v2.PayWithdrawSellerRecordDto;
|
||||
import com.m2pool.lease.dto.v2.ShopWalletInfoDto;
|
||||
import com.m2pool.lease.service.LeaseShopService;
|
||||
import com.m2pool.lease.vo.BalanceVo;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.PageVo;
|
||||
import com.m2pool.lease.vo.v2.ShopWalletInfoVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Api(tags = "v2版本--店铺控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/v2/shop")
|
||||
public class LeaseShopV2Controller {
|
||||
|
||||
@Resource
|
||||
private LeaseShopService leaseShopService;
|
||||
|
||||
/**
|
||||
* 根据店铺id 查询配置信息列表
|
||||
* @param baseVo
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("钱包配置----根据店铺id查询收款钱包绑定信息列表")
|
||||
@PostMapping("/getShopConfigV2")
|
||||
public Result<List<ShopWalletInfoDto>> getShopConfigV2(@RequestBody BaseVo baseVo) {
|
||||
return leaseShopService.getShopConfigV2(baseVo);
|
||||
}
|
||||
|
||||
@LedgerLog(value = "卖家钱包--余额提现申请")
|
||||
@Decrypt
|
||||
@PostMapping("/withdrawBalanceForSeller")
|
||||
@ApiOperation(value = "卖家店铺钱包余额提现")
|
||||
public Result<String> withdrawBalanceForSeller(@RequestBody BalanceVo balanceVo){
|
||||
return leaseShopService.withdrawBalanceForSeller(balanceVo);
|
||||
}
|
||||
|
||||
@ApiOperation("钱包配置----根据配置id 修改商铺收款钱包配置")
|
||||
@PostMapping("/updateShopConfigV2")
|
||||
@Decrypt
|
||||
public Result<String> updateShopConfigV2(@RequestBody ShopWalletInfoVo shopWalletInfoVo) {
|
||||
return leaseShopService.updateShopConfigV2(shopWalletInfoVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/balanceWithdrawList")
|
||||
@ApiOperation(value = "卖家:余额提现记录列表")
|
||||
public PageResult<PayWithdrawSellerRecordDto> balanceWithdrawList(@RequestBody PageVo pageVo){
|
||||
return leaseShopService.balanceWithdrawList(pageVo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.ShopCartDto;
|
||||
import com.m2pool.lease.service.LeaseShoppingCartService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.PageVo;
|
||||
import com.m2pool.lease.vo.ProductAndMachineVo;
|
||||
import com.m2pool.lease.vo.ShoppingCartInfoURDVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "购物车表控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/shopping/cart")
|
||||
public class LeaseShoppingCartController {
|
||||
|
||||
@Resource
|
||||
private LeaseShoppingCartService leaseShoppingCartService;
|
||||
|
||||
@ApiOperation("添加商品到购物车(批量+单个)")
|
||||
@PostMapping("/addGoods")
|
||||
public Result<String> addGoods(@RequestBody List<ShoppingCartInfoURDVo> shoppingCartInfoURDVoList) {
|
||||
return leaseShoppingCartService.addGoods(shoppingCartInfoURDVoList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询购物车中商品列表")
|
||||
@PostMapping("/getGoodsList")
|
||||
public PageResult<ShopCartDto> getGoodsList(@RequestBody(required = false) PageVo pageVo) {
|
||||
if (pageVo == null){
|
||||
pageVo = new PageVo();
|
||||
}
|
||||
return leaseShoppingCartService.getGoodsList(pageVo);
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除购物车中商品")
|
||||
@PostMapping("/deleteBatchGoods")
|
||||
public Result<String> deleteBatchGoods(@RequestBody List<ProductAndMachineVo> baseVoList) {
|
||||
return leaseShoppingCartService.deleteBatchGoods(baseVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("删除购物车中商品")
|
||||
@PostMapping("/deleteGoods")
|
||||
@Deprecated
|
||||
public Result<String> deleteGoods(@RequestBody BaseVo baseVo) {
|
||||
return leaseShoppingCartService.deleteGoods(baseVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量删除购物车中已下架商品")
|
||||
@PostMapping("/deleteBatchGoodsForIsDelete")
|
||||
public Result<String> deleteBatchGoodsForIsDelete() {
|
||||
return leaseShoppingCartService.deleteBatchGoodsForIsDelete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.dto.ShopCartDto;
|
||||
import com.m2pool.lease.dto.v2.ShopCartV2Dto;
|
||||
import com.m2pool.lease.service.LeaseShoppingCartService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.PageVo;
|
||||
import com.m2pool.lease.vo.ProductAndMachineVo;
|
||||
import com.m2pool.lease.vo.ShoppingCartInfoURDVo;
|
||||
import com.m2pool.lease.vo.v2.AddGoodsVo;
|
||||
import com.m2pool.lease.vo.v2.CartInfoVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "v2版本---购物车表控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/v2/shopping/cart")
|
||||
public class LeaseShoppingCartV2Controller {
|
||||
|
||||
@Resource
|
||||
private LeaseShoppingCartService leaseShoppingCartService;
|
||||
|
||||
@ApiOperation("添加商品到购物车(批量+单个)")
|
||||
@PostMapping("/addGoodsV2")
|
||||
public Result<String> addGoodsV2(@RequestBody List<AddGoodsVo> addGoodsVoList) {
|
||||
return leaseShoppingCartService.addGoodsV2(addGoodsVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("查询购物车中商品列表")
|
||||
@PostMapping("/getGoodsListV2")
|
||||
public PageResult<ShopCartV2Dto> getGoodsListV2(@RequestBody(required = false) PageVo pageVo) {
|
||||
if (pageVo == null){
|
||||
pageVo = new PageVo();
|
||||
}
|
||||
return leaseShoppingCartService.getGoodsListV2(pageVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量删除购物车中商品")
|
||||
@PostMapping("/deleteBatchGoodsV2")
|
||||
public Result<String> deleteBatchGoodsV2(@RequestBody List<CartInfoVo> baseVoList) {
|
||||
return leaseShoppingCartService.deleteBatchGoodsV2(baseVoList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量删除购物车中已下架商品")
|
||||
@PostMapping("/deleteBatchGoodsForIsDeleteV2")
|
||||
public Result<String> deleteBatchGoodsForIsDeleteV2() {
|
||||
return leaseShoppingCartService.deleteBatchGoodsForIsDeleteV2();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.annotation.Decrypt;
|
||||
import com.m2pool.lease.annotation.LedgerLog;
|
||||
import com.m2pool.lease.annotation.LoginRequired;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseUserService;
|
||||
import com.m2pool.lease.vo.BalancePageVo;
|
||||
import com.m2pool.lease.vo.BalanceVo;
|
||||
import com.m2pool.lease.vo.ChainAndCoinVo;
|
||||
import com.m2pool.lease.vo.RecordTypePageVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "用户信息控制器")
|
||||
@LoginRequired
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class LeaseUserController {
|
||||
|
||||
@Resource
|
||||
private LeaseUserService leaseUserService;
|
||||
|
||||
|
||||
@PostMapping("/bindWallet")
|
||||
@ApiOperation(value = "买家:充值步骤选择链和钱包后自动绑定钱包")
|
||||
public Result<UserWalletDataDto> bindWallet(@RequestBody ChainAndCoinVo chainAndCoinVo){
|
||||
return leaseUserService.bindWallet(chainAndCoinVo);
|
||||
}
|
||||
|
||||
@PostMapping("/getWalletInfo")
|
||||
@ApiOperation(value = "获取用户相关钱包信息")
|
||||
public Result<List<UserWalletDataDto>> getWalletInfo() {
|
||||
return leaseUserService.getWalletInfo();
|
||||
}
|
||||
|
||||
|
||||
@LedgerLog(value = "买家钱包--余额提现申请")
|
||||
@Decrypt
|
||||
@PostMapping("/withdrawBalance")
|
||||
@ApiOperation(value = "申请余额提现")
|
||||
public Result<String> withdrawBalance(@RequestBody BalanceVo balanceVo){
|
||||
return leaseUserService.withdrawBalance(balanceVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/balanceWithdrawList")
|
||||
@ApiOperation(value = "买家:余额提现记录列表")
|
||||
@Deprecated
|
||||
public PageResult<PayWithdrawMessageDto> balanceWithdrawList(@RequestBody BalancePageVo balancePageVo){
|
||||
return leaseUserService.balanceWithdrawList(balancePageVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/balanceRechargeList")
|
||||
@ApiOperation(value = "买家:余额充值记录列表")
|
||||
@Deprecated
|
||||
public PageResult<PayRechargeMessageDto> balanceRechargeList(@RequestBody BalancePageVo balancePageVo){
|
||||
return leaseUserService.balanceRechargeList(balancePageVo);
|
||||
}
|
||||
|
||||
@PostMapping("/balancePayList")
|
||||
@ApiOperation(value = "卖家:钱包交易(收款)记录列表")
|
||||
public PageResult<PayRecordMessageDto> balancePayList(@RequestBody BalancePageVo balancePageVo){
|
||||
return leaseUserService.balancePayList(balancePageVo);
|
||||
}
|
||||
|
||||
@PostMapping("/transactionRecord")
|
||||
@ApiOperation(value = "买家:交易流水(支付,提现,充值)")
|
||||
public PageResult<TransactionRecordDto> transactionRecord(@RequestBody RecordTypePageVo recordTypePageVo){
|
||||
return leaseUserService.transactionRecord(recordTypePageVo);
|
||||
}
|
||||
|
||||
@PostMapping("/getRecentlyTransaction")
|
||||
@ApiOperation(value = "最近5条交易")
|
||||
public Result<List<RecentlyTransactionDto>> getRecentlyTransaction(){
|
||||
return leaseUserService.getRecentlyTransaction();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getCharge")
|
||||
@ApiOperation(value = "获取系统支持的交易手续费")
|
||||
@Deprecated
|
||||
public Result<List<ChargeDto>> getCharge(){
|
||||
return leaseUserService.getCharge();
|
||||
}
|
||||
|
||||
@GetMapping("/downloadClient")
|
||||
@ApiOperation(value = "卖家:下载客户端")
|
||||
public void downloadClient(@RequestParam String userEmail,@RequestParam String type,HttpServletRequest request, HttpServletResponse response){
|
||||
leaseUserService.downloadClient(userEmail,type,request, response);
|
||||
}
|
||||
|
||||
@GetMapping("/getClientVersion")
|
||||
@ApiOperation(value = "获取客户端版本号")
|
||||
public String getClientVersion(){
|
||||
return leaseUserService.getClientVersion();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 余额提现请求对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ChainAndCoinDto {
|
||||
|
||||
|
||||
private String coin;
|
||||
private String chain;
|
||||
private Long shopId;
|
||||
|
||||
public ChainAndCoinDto( String coin,String chain) {
|
||||
this.chain = chain;
|
||||
this.coin = coin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ChainAndCoinDto that = (ChainAndCoinDto) o;
|
||||
return Objects.equals(coin, that.coin) && Objects.equals(chain, that.chain) && Objects.equals(shopId, that.shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(coin, chain,shopId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ChainAndCoinDto{" +
|
||||
"coin='" + coin + '\'' +
|
||||
", chain='" + chain + '\'' +
|
||||
", shopId='" + shopId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "链(一级) 下拉列表返回对象",value = "ChainListDto")
|
||||
public class ChainListDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "链名value")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "联名标签")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "币(二级) 下拉列表")
|
||||
private List<CoinListDto> children;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币(二级) 下拉列表返回对象",value = "CoinListDto")
|
||||
public static class CoinListDto{
|
||||
@ApiModelProperty(value = "币种value")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "币种label")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "币种是否绑定(只用于卖家钱包绑定页面相关接口) 0 未绑定 1 已绑定")
|
||||
private Integer hasBind;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 余额提现请求对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "交易费接口",value = "ChargeDto")
|
||||
public class ChargeDto {
|
||||
|
||||
@ApiModelProperty(value = "手续费",required = true)
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty(value = "链",required = true)
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "币种",required = true)
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "手续费率",required = true)
|
||||
private BigDecimal feeRate;
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CheckAddressDto {
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String fromAddress;
|
||||
|
||||
private String fromChain;
|
||||
|
||||
private String fromSymbol;
|
||||
/**
|
||||
* 半年内是否有操作
|
||||
*/
|
||||
private String hasOperator;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CoinFullDto {
|
||||
|
||||
private String chainValue;
|
||||
|
||||
private String chainLabel;
|
||||
|
||||
|
||||
private String coinValue;
|
||||
|
||||
private String coinLabel;
|
||||
|
||||
private Integer hasBind;
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付订单返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "已支付和理论支付总金额返回对象",value = "HasPayTotalDto")
|
||||
public class HasPayTotalDto {
|
||||
|
||||
|
||||
/**
|
||||
* 理论支付金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
private BigDecimal totalRealAmount;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HourIncomeDto{
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工编号
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 挖矿收益nexa 币
|
||||
*/
|
||||
private BigDecimal income;
|
||||
|
||||
/**
|
||||
* 挖矿收益 稳定币usdt
|
||||
*/
|
||||
private BigDecimal usdtIncome;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿机售价配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "矿机售价配置返回对象",value = "MachinePayTypeDto" )
|
||||
public class MachinePayTypeDto {
|
||||
@ApiModelProperty(value = "矿机币种售价配置id")
|
||||
private Long payTypeId;
|
||||
|
||||
@ApiModelProperty(value = "矿机id(忽略)")
|
||||
private Long productMachineId;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "售价单位币种")
|
||||
private String coin;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MachinePowerDto{
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 记录时间(每五分钟整点)
|
||||
*/
|
||||
private LocalDateTime date;
|
||||
|
||||
/**
|
||||
* 五分钟一次的矿工矿机算力
|
||||
*/
|
||||
private BigDecimal accepts;
|
||||
|
||||
/**
|
||||
* 矿机在离线状态 离线offline 在线online
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 实际记录时间
|
||||
*/
|
||||
private LocalDateTime lastSubmit;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿机售价配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车矿机总价返回对象",value = "MachineTotalPriceDto" )
|
||||
public class MachineTotalPriceDto {
|
||||
@ApiModelProperty(value = "售价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "售价单位币种")
|
||||
private String coin;
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单详情返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单详情返回对象",value = "OrderInfoDto")
|
||||
public class OrderInfoDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
@ApiModelProperty(value = "订单总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
///**
|
||||
// * 收货地址
|
||||
// */
|
||||
//private String address;
|
||||
|
||||
/**
|
||||
* 订单状态 0待付款 1待发货 2待收货 3待评价 4已完成 5取消订单
|
||||
*/
|
||||
@ApiModelProperty(value = "订单状态 7 订单进行中 8 订单已完成")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "订单完成时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
// ---------------------------------------------- 一个普通订单对应一个支付订单(多个封装下面四个字段为一个对象,并返回list)----------------------------------------------------------------------
|
||||
|
||||
|
||||
@ApiModelProperty(value = "二维码图片")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "需支付总金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty(value = "已支付金额")
|
||||
private String payAmount;
|
||||
|
||||
@ApiModelProperty(value = "未支付金额")
|
||||
private Double noPayAmount;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String shopName;
|
||||
|
||||
//---------------------------------------------- 一个普通订单对应一个支付订单(多个封装下面四个字段为一个对象,并返回list)- ----------------------------------------------------------------------
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ApiModelProperty(value = "订单详情")
|
||||
private List<OrderItemDto> orderItemDtoList;
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单列表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单列表返回对象",value = "LeaseOrderItemDto")
|
||||
public class OrderItemDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品 ID")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 机器id
|
||||
*/
|
||||
@ApiModelProperty(value = "机器id")
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 商品租期天数
|
||||
*/
|
||||
@ApiModelProperty(value = "商品租期天数")
|
||||
private Integer leaseTime;
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
@ApiModelProperty(value = "商品图片路径")
|
||||
private String image;
|
||||
|
||||
|
||||
/**
|
||||
* 收货地址(模拟)
|
||||
*/
|
||||
@ApiModelProperty(value = "收货地址(模拟)")
|
||||
private String address;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "机器单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 支付币种
|
||||
*/
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private String payCoin;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "租赁矿机数量")
|
||||
private Integer numbers;
|
||||
|
||||
@ApiModelProperty(value = "矿机类型 0 ASIC 1 GPU")
|
||||
private Integer type;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单状态修改返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单状态修改返回对象",value = "OrderStatusDto")
|
||||
public class OrderStatusDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "订单主表状态")
|
||||
private Integer orderInfoStatus;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.m2pool.lease.constant.ResponseConstant;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 表格分页数据对象
|
||||
* @Date 2024/6/13 11:59
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "分页返回对象")
|
||||
public class PageResult<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = ResponseConstant.SUCCESS;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = ResponseConstant.FAIL;
|
||||
|
||||
/** 总记录数 */
|
||||
@ApiModelProperty(value = "总记录数", example = "1")
|
||||
private long total;
|
||||
|
||||
/** 总页数 */
|
||||
@ApiModelProperty(value = "总页数", example = "1")
|
||||
private long totalPage;
|
||||
|
||||
/** 列表数据 */
|
||||
@ApiModelProperty(value = "查询结果集合")
|
||||
private List<T> rows;
|
||||
|
||||
/** 消息状态码 */
|
||||
@ApiModelProperty(value = "消息状态码", example = "200")
|
||||
private int code;
|
||||
|
||||
/** 消息内容 */
|
||||
@ApiModelProperty(value = "查询结果描述", example = "成功")
|
||||
private String msg;
|
||||
|
||||
@ApiModelProperty(value = "表头信息")
|
||||
private List<TableHeadersDto> columns;
|
||||
|
||||
public static <T> PageResult<T> success(List<T> data)
|
||||
{
|
||||
return setPageResult(data, SUCCESS, "成功");
|
||||
}
|
||||
|
||||
public static <T> PageResult<T> successColumns(List<T> data) {
|
||||
return setPageResultAndHeader(data, SUCCESS, "成功");
|
||||
}
|
||||
|
||||
public static <T> PageResult<T> fail(List<T> data, String msg)
|
||||
{
|
||||
return setPageResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
private static <T> PageResult<T> setPageResult(List<T> data, int code, String msg)
|
||||
{
|
||||
PageResult<T> rspData = new PageResult<T>();
|
||||
rspData.setCode(SUCCESS);
|
||||
rspData.setRows(data);
|
||||
rspData.setMsg("查询成功");
|
||||
return rspData;
|
||||
}
|
||||
private static <T> PageResult<T> setPageResultAndHeader(List<T> data, int code, String msg) {
|
||||
List<TableHeadersDto> columns = new ArrayList<>();
|
||||
columns.add(TableHeadersDto.builder()
|
||||
.key("model")
|
||||
.label("型号")
|
||||
.type("text")
|
||||
.fixed("left")
|
||||
.width(100)
|
||||
.build());
|
||||
columns.add(TableHeadersDto.builder()
|
||||
.key("price")
|
||||
.label("价格")
|
||||
.type("amount")
|
||||
.width(100)
|
||||
.build());
|
||||
|
||||
columns.add(TableHeadersDto.builder()
|
||||
.key("monthIncome")
|
||||
.label("最大月收益")
|
||||
.type("amount")
|
||||
.currency("USDT")
|
||||
.period("MONTH")
|
||||
.width(110)
|
||||
.build());
|
||||
|
||||
columns.add(TableHeadersDto.builder()
|
||||
.key("maxLeaseDays")
|
||||
.label("最大租赁天数")
|
||||
.type("days")
|
||||
.width(80)
|
||||
.build());
|
||||
|
||||
PageResult<T> rspData = new PageResult<T>();
|
||||
rspData.setColumns(columns);
|
||||
rspData.setCode(SUCCESS);
|
||||
rspData.setRows(data);
|
||||
rspData.setMsg("查询成功");
|
||||
return rspData;
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品收款钱包配置",value = "PayConfigDto")
|
||||
public class PayConfigDto {
|
||||
|
||||
|
||||
/**
|
||||
* nexa rxd dgbo dgbq dgbs alph enx grs mona usdt
|
||||
*/
|
||||
@ApiModelProperty(value = "支持的支付币种")
|
||||
private String payCoin;
|
||||
|
||||
|
||||
/**
|
||||
* 卖方对应收款钱包
|
||||
*/
|
||||
@ApiModelProperty(value = "币种图标")
|
||||
private String payCoinImage;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String payChain;
|
||||
|
||||
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "起付金额")
|
||||
private BigDecimal deductibleAmount;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal fee;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付订单返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付订单返回对象",value = "PayOrderDto")
|
||||
public class PayOrderDto {
|
||||
|
||||
/**
|
||||
* 支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd")
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址")
|
||||
private String payAddress;
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 充值记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "余额充值返回对象",value = "PayRechargeMessageDto" )
|
||||
public class PayRechargeMessageDto {
|
||||
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "充值地址(官方自动生成绑定地址)")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "充值金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@ApiModelProperty(value = "充值到账时间)")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 0 充值失败 1 充值成功 2 充值中
|
||||
*/
|
||||
@ApiModelProperty(value = "充值状态 0 充值失败 1 充值成功 2 充值中 3 校验失败")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付消息记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付返回对象",value = "PayRecordMessageDto" )
|
||||
public class PayRecordMessageDto {
|
||||
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@ApiModelProperty(value = "消息ID")
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 买家充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 卖家地址(卖家自定义地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "收款地址(卖家自定义地址)")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "理论支付支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
*实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)
|
||||
*/
|
||||
@ApiModelProperty(value = "实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)")
|
||||
private BigDecimal realAmount;
|
||||
/**
|
||||
* 卖家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "收款钱包币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 卖家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "收款钱包链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 买家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 买家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "支付成功/失败/证书校验失败时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 等待校验 3 证书校验失败
|
||||
*/
|
||||
@ApiModelProperty(value = "支付状态 0 支付失败 1 支付成功 2 待校验 3 校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 店铺支持的支付方式
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "店铺支持的支付方式",value = "PayTypeDto")
|
||||
public class PayTypeDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id(不展示)")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "支付币种图标")
|
||||
private String image;
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 余额提现返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "余额提现返回对象",value = "PayWithdrawMessageDto" )
|
||||
public class PayWithdrawMessageDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 用户充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "用户充值地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 提现地址(用户自定义)
|
||||
*/
|
||||
@ApiModelProperty(value = "提现地址(用户自定义)")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "提现金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提现时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提现完成时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 支付中
|
||||
*/
|
||||
@ApiModelProperty(value = "记录状态 提现业务: 0 提现失败 1 提现成功 2 提现中 3 校验失败")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付回调结果返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付回调结果返回对象",value = "PaymentCallbackDto")
|
||||
public class PaymentCallbackDto {
|
||||
|
||||
@ApiModelProperty(value = "本次支付是否支付完成 ---- 支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 10支付成功--已支付部分货款 ")
|
||||
private int isPayAll;
|
||||
|
||||
@ApiModelProperty(value = "剩余未支付的金额")
|
||||
private BigDecimal noPayAmount;
|
||||
|
||||
@ApiModelProperty(value = "需要支付的总金额 = payAmount + noPayAmount")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@ApiModelProperty(value = "已支付的金额(从卖方钱包交易记录中获取的)")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@ApiModelProperty(value = "卖方二维码图片(如果支付状态为 1 则不再返回该字段)")
|
||||
private String img;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付记录返回对象",value = "PaymentRecordDto")
|
||||
public class PaymentRecordDto {
|
||||
|
||||
/**
|
||||
* 支付记录 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "支付记录 ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd")
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 支付状态0支付失败 1支付成并验证 2待支付 10表示支付成功未验证
|
||||
*/
|
||||
@ApiModelProperty(value = "支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 6 支付中( 目前只有这三种状态 7 订单进行中 8 订单已完成 9 余额不足,订单已取消) 10支付成功--已支付部分货款")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址(卖方)")
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "二维码图片")
|
||||
private String img;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 价格范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "价格范围返回对象",value = "PriceDto" )
|
||||
public class PriceDto {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer totalMachineNumber;
|
||||
|
||||
@ApiModelProperty(value = "价格最大值")
|
||||
private BigDecimal priceMax;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "价格最小值")
|
||||
private BigDecimal priceMin;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品返回对象",value = "ProductDto" )
|
||||
public class ProductDto {
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
@ApiModelProperty(value = "商品图片路径")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 商品类型,0 挖矿机器套餐,1 算力套餐
|
||||
*/
|
||||
@ApiModelProperty(value = "商品类型,0 挖矿机器套餐,1 算力套餐")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 库存中机器价格范围
|
||||
*/
|
||||
@ApiModelProperty(value = "价格范围")
|
||||
@Deprecated
|
||||
private String priceRange;
|
||||
|
||||
@ApiModelProperty(value = "店铺支持的支付方式")
|
||||
private List<PayTypeDto> payTypes;
|
||||
|
||||
/**
|
||||
* 算法
|
||||
*/
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
@ApiModelProperty(value = "商品描述")
|
||||
private String description;
|
||||
/**
|
||||
* 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
@ApiModelProperty(value = "矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona")
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种全称
|
||||
*/
|
||||
@ApiModelProperty(value = "矿机挖矿币种全称")
|
||||
private String coinFullName;
|
||||
|
||||
|
||||
/**
|
||||
* 销售机器数
|
||||
*/
|
||||
@ApiModelProperty(value = "已售矿机数")
|
||||
private Integer saleNumber;
|
||||
|
||||
/**
|
||||
* 总矿机数
|
||||
*/
|
||||
@ApiModelProperty(value = "总矿机数(已售 + 未售出矿机)")
|
||||
private Integer totalMachineNumber;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "商品对应的出售矿机集合")
|
||||
List<ProductMachineRangeDto> productMachineRangeList;
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 钱包配置修改商品支付方式返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "钱包配置修改商品支付方式返回对象",value = "ProductForWalletConfigDto" )
|
||||
public class ProductForWalletConfigDto {
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
@ApiModelProperty(value = "商品图片路径")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 算法
|
||||
*/
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
@ApiModelProperty(value = "商品描述")
|
||||
private String description;
|
||||
/**
|
||||
* 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
@ApiModelProperty(value = "矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona")
|
||||
private String coin;
|
||||
/**
|
||||
* 总矿机数
|
||||
*/
|
||||
@ApiModelProperty(value = "总矿机数(已售 + 未售出矿机)")
|
||||
private Integer totalMachineNumber;
|
||||
|
||||
@ApiModelProperty(value = "矿机列表")
|
||||
private List<ProductMachineForWalletConfigDto> machineList;
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品对应实际商品返回对象",value = "ProductMachineDto" )
|
||||
public class ProductMachineDto {
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "购物车详情id")
|
||||
private Long cartInfoId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "商品 ID")
|
||||
private Long productId;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器型号")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "3天算力平均大小---实际实时算力(计算得到,商家不能够自己添加和修改)")
|
||||
private BigDecimal computingPower;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "理论算力(卖方手动填写)")
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出 2售出中")
|
||||
private Integer saleState;
|
||||
|
||||
@ApiModelProperty(value = "机器算力最早记录的一次时间(和endTime相减得到商品上实时算力平均值计算的时间段)")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@ApiModelProperty(value = "机器算力最近记录的一次时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单机理论收入(每日) 单位币种")
|
||||
private BigDecimal theoryIncome;
|
||||
|
||||
@ApiModelProperty(value = "单机理论收入(每日) 单位USDT")
|
||||
private BigDecimal theoryUsdtIncome;
|
||||
|
||||
@ApiModelProperty(value = "租赁天数")
|
||||
private Integer leaseTime;
|
||||
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "功耗 单位kw/h",example = "10")
|
||||
private BigDecimal powerDissipation;
|
||||
|
||||
@ApiModelProperty(value = "最大可租借天数(默认七天)",example = "7")
|
||||
private Integer maxLeaseDays;
|
||||
|
||||
@ApiModelProperty(value = "挖矿机器挖矿币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "是否删除 0否 1是")
|
||||
private Integer del;
|
||||
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private String payCoin;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "售价集合")
|
||||
private List<MachinePayTypeDto> priceList;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "钱包配置修改矿机支付方式返回对象",value = "ProductMachineForWalletConfigDto" )
|
||||
public class ProductMachineForWalletConfigDto {
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long productMachineId;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 挖矿机器型号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器型号")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "挖矿币种")
|
||||
private String coin;
|
||||
|
||||
///**
|
||||
// * 实际算力(计算得到,商家不能够自己添加和修改)
|
||||
// */
|
||||
//@ApiModelProperty(value = "3天算力平均大小---实际实时算力(计算得到,商家不能够自己添加和修改)")
|
||||
//private BigDecimal computingPower;
|
||||
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 售出状态 0未售出 1已售出 2售出中
|
||||
*/
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出 2售出中")
|
||||
private Integer saleState;
|
||||
|
||||
/**
|
||||
* 理论算力
|
||||
*/
|
||||
@ApiModelProperty(value = "理论算力(卖方手动填写)")
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
@ApiModelProperty(value = "单机理论收入(每日) 单位币种")
|
||||
private BigDecimal theoryIncome;
|
||||
|
||||
@ApiModelProperty(value = "单机理论收入(每日) 单位USDT")
|
||||
private BigDecimal theoryUsdtIncome;
|
||||
|
||||
@ApiModelProperty(value = "功耗 单位kw/h",example = "10")
|
||||
private BigDecimal powerDissipation;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "支付链")
|
||||
private BigDecimal chain;
|
||||
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private BigDecimal symbol;
|
||||
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.annotation.EncryptedField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "钱包配置修改矿机支付方式请求对象",value = "ProductMachineForWalletConfigVo" )
|
||||
public class ProductMachineForWalletConfigVo {
|
||||
|
||||
@ApiModelProperty(value = "钱包地址")
|
||||
@EncryptedField
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "支付链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "支付币种,可以多个以逗号隔开")
|
||||
private String symbol;
|
||||
|
||||
@ApiModelProperty(value = "价格列表")
|
||||
private List<PriceVo> productMachineForWalletConfigVoList;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币(二级) 下拉列表返回对象",value = "PriceVo")
|
||||
public static class PriceVo{
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long productMachineId;
|
||||
@ApiModelProperty(value = "单价,可以多个以逗号隔开")
|
||||
private String price;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商城商城矿机返回对象",value = "ProductMachineInfoDto" )
|
||||
public class ProductMachineInfoDto {
|
||||
|
||||
@ApiModelProperty(value = "商品支持的支付地址")
|
||||
private List<PayConfigDto> payConfigList;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "矿机范围及矿机详情返回对象")
|
||||
private List<ProductMachineRangeInfoDto> machineRangeInfoList;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeDto" )
|
||||
public class ProductMachineRangeDto {
|
||||
|
||||
@ApiModelProperty(value = "功耗范围")
|
||||
private String powerRange;
|
||||
|
||||
@ApiModelProperty(value = "理论算力范围")
|
||||
private String theoryPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "实际算力范围")
|
||||
private String computingPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "实际单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "商品对应的出售矿机")
|
||||
List<ProductMachineDto> productMachines;
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeGroupDto" )
|
||||
public class ProductMachineRangeGroupDto {
|
||||
|
||||
@ApiModelProperty(value = "唯一标识")
|
||||
private Integer onlyKey;
|
||||
|
||||
@ApiModelProperty(value = "功耗范围")
|
||||
private String powerRange;
|
||||
|
||||
@ApiModelProperty(value = "理论算力范围")
|
||||
private String theoryPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "实际算力范围")
|
||||
private String computingPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "实际单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeInfoDto" )
|
||||
public class ProductMachineRangeInfoDto {
|
||||
|
||||
@ApiModelProperty(value = "商城商品详情---价格分组对象")
|
||||
private ProductMachineRangeGroupDto productMachineRangeGroupDto;
|
||||
|
||||
@ApiModelProperty(value = "价格分组下对应的商品矿机")
|
||||
private List<ProductMachineDto> productMachines;
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品机器修改返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品机器修改返回对象",value = "ProductUpdateMachineDto" )
|
||||
public class ProductUpdateMachineDto {
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 挖矿机器型号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器型号")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@ApiModelProperty(value = "售价集合")
|
||||
private List<MachinePayTypeDto> priceList;
|
||||
|
||||
/**
|
||||
* 实际算力(计算得到,商家不能够自己添加和修改)
|
||||
*/
|
||||
@ApiModelProperty(value = "3天算力平均大小---实际实时算力(计算得到,商家不能够自己添加和修改)")
|
||||
private BigDecimal computingPower;
|
||||
|
||||
/**
|
||||
* 理论算力
|
||||
*/
|
||||
@ApiModelProperty(value = "理论算力(卖方手动填写)")
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 售出状态 0未售出 1已售出 2售出中
|
||||
*/
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出 2售出中")
|
||||
private Integer saleState;
|
||||
|
||||
@ApiModelProperty(value = "最大可租借天数(默认七天)",example = "7")
|
||||
private Integer maxLeaseDays;
|
||||
|
||||
/**
|
||||
* 单机预估实际收入
|
||||
*/
|
||||
//@ApiModelProperty(value = "单机预估实际收入(每日)")
|
||||
//private BigDecimal actualIncome;
|
||||
|
||||
//@ApiModelProperty(value = "算法")
|
||||
//private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "功耗 单位kw/h",example = "10")
|
||||
private BigDecimal powerDissipation;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 二维码
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "二维码",value = "QrCodeDto")
|
||||
public class QrCodeDto {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址(卖方)")
|
||||
private String payAddress;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 最近交易返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "最近交易返回对象",value = "RecentlyTransactionDto" )
|
||||
public class RecentlyTransactionDto {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "交易金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
@ApiModelProperty(value = "交易类型 0 支付 1 充值 2 提现")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 交易完成时间
|
||||
*/
|
||||
@ApiModelProperty(value = "交易完成时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "交易状态 0 失败 1 成功 2 充值/提现/支付中 3校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.constant.ResponseConstant;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 响应对象封装类
|
||||
* @Date 2024/6/11 9:18
|
||||
* @Author yyb
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 3276842119125241681L;
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = ResponseConstant.SUCCESS;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = ResponseConstant.FAIL;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> success()
|
||||
{
|
||||
return restResult(null, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data)
|
||||
{
|
||||
return restResult(data, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data, String msg)
|
||||
{
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail()
|
||||
{
|
||||
return restResult(null, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(String msg)
|
||||
{
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(T data)
|
||||
{
|
||||
return restResult(data, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(T data, String msg)
|
||||
{
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(int code, String msg)
|
||||
{
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> Result<T> restResult(T data, int code, String msg)
|
||||
{
|
||||
Result<T> apiResult = new Result<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车一层列表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车一层商铺列表返回对象",value = "ShopCartDto")
|
||||
public class ShopCartDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "店铺下机器总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "店铺下机器总数")
|
||||
private Integer totalMachine;
|
||||
|
||||
@ApiModelProperty(value = "总价集合")
|
||||
private List<MachineTotalPriceDto> totalPriceList;
|
||||
|
||||
@ApiModelProperty(value = "商品支持的支付地址")
|
||||
private List<PayConfigDto> payConfigList;
|
||||
|
||||
@ApiModelProperty(value = "商品机器列表")
|
||||
List<ProductMachineDto> productMachineDtoList;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺钱包配置返对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺钱包配置返对象",value = "ShopChainAndCoinDto")
|
||||
public class ShopChainAndCoinDto {
|
||||
private Long shopId;
|
||||
private String chain;
|
||||
private String coin;
|
||||
|
||||
|
||||
/**
|
||||
* 用于stream distinct()去重
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ShopChainAndCoinDto that = (ShopChainAndCoinDto) o;
|
||||
return shopId.equals(that.shopId) && coin.equals(that.coin) && chain.equals(that.chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = shopId.hashCode();
|
||||
result = 31 * result + coin.hashCode();
|
||||
result = 31 * result + chain.hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺商品配置返回对象",value = "ShopConfigDelDto")
|
||||
public class ShopConfigDelDto extends BaseVo {
|
||||
|
||||
|
||||
private Long shopId;
|
||||
|
||||
|
||||
private String payAddress;
|
||||
|
||||
private String chain;
|
||||
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺商品配置返回对象",value = "ShopConfigDto")
|
||||
public class ShopConfigDto extends BaseVo {
|
||||
|
||||
|
||||
/**
|
||||
* 商铺ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商铺ID")
|
||||
private Long shopId;
|
||||
|
||||
|
||||
/**
|
||||
* 币种类型 0 虚拟币 1 稳定币
|
||||
*/
|
||||
@ApiModelProperty(value = "币种类型 0 虚拟币 1 稳定币")
|
||||
private Integer payType;
|
||||
|
||||
/**
|
||||
* 卖方对应收款钱包
|
||||
*/
|
||||
@ApiModelProperty(value = "卖方对应收款钱包")
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "币(二级) 下拉列表")
|
||||
private List<ShopConfigDto.CoinDto> children;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币种图片返回对象",value = "CoinDto")
|
||||
public static class CoinDto{
|
||||
@ApiModelProperty(value = "商品支付方式及价格单位 取值 虚拟币( nexa rxd dgbo dgbq dgbs alph enx grs mona) 稳定币(usdt usdc busd)")
|
||||
private String payCoin;
|
||||
|
||||
@ApiModelProperty(value = "币种图片")
|
||||
private String image;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺返回对象",value = "ShopDto")
|
||||
public class ShopDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 店铺图片路径
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺图片路径")
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 店铺描述
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商铺状态 0 待审核 1 审核通过(店铺开启) 2 店铺关闭
|
||||
*/
|
||||
@ApiModelProperty(value = "商铺状态 0 待审核 1 审核通过(店铺开启) 2 店铺关闭")
|
||||
private Integer state;
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
@ApiModelProperty(value = "逻辑删除字段")
|
||||
private Boolean del;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "店铺手续费比例 范围0.01-0.1",example = "0.01")
|
||||
private BigDecimal feeRate;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺配置商品列表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺配置商品列表返回对象",value = "ShopNameDto")
|
||||
public class ShopNameDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String name;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车详情表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车二层商品列表返回对象(不再使用)",value = "ShoppingCartInfoDto" )
|
||||
public class ShoppingCartInfoDto {
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品机器ID
|
||||
*/
|
||||
private Long productMachineId;
|
||||
/**
|
||||
* 租期
|
||||
*/
|
||||
private Integer leaseTime;
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description 表头信息
|
||||
* @Date 2025/11/28 13:31
|
||||
* @Author yyb
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "表头信息",value = "TableHeadersDto" )
|
||||
public class TableHeadersDto {
|
||||
|
||||
/**
|
||||
* 动态列第几列
|
||||
*/
|
||||
@ApiModelProperty(value = "动态列第几列")
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 列名
|
||||
*/
|
||||
@ApiModelProperty(value = "列名")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 类型 text/amount/hashrate/days
|
||||
*/
|
||||
@ApiModelProperty(value = "类型 text/amount/hashrate/days")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 固定列 left/right/不传
|
||||
*/
|
||||
@ApiModelProperty(value = "固定列 left/right/不传")
|
||||
private String fixed;
|
||||
|
||||
@ApiModelProperty(value = "价格单位")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty(value = "时间间隔")
|
||||
private String period;
|
||||
|
||||
/**
|
||||
* 算力单位
|
||||
*/
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
@ApiModelProperty(value = "宽度")
|
||||
private Integer width;
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付消息记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "交易流水返回对象",value = "TransactionRecordDto" )
|
||||
public class TransactionRecordDto {
|
||||
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@ApiModelProperty(value = "消息ID")
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 买家充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "买家充值地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 卖家地址(卖家自定义地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现地址 充值流水:不需要该字段 支付流水:卖家收款地址")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "理论支付支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
*实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)
|
||||
*/
|
||||
@ApiModelProperty(value = "实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)")
|
||||
private BigDecimal realAmount;
|
||||
|
||||
/**
|
||||
* 钱包冻结金额
|
||||
*/
|
||||
@ApiModelProperty(value = "钱包冻结金额")
|
||||
private BigDecimal blockAmount;
|
||||
/**
|
||||
* 卖家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现钱包币种 充值流水:不需要该字段 支付流水:卖家收款钱包币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 卖家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现链链名称 充值流水:不需要该字段 支付流水:卖家收款链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 买家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 买家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@ApiModelProperty(value = "流水建立时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "成功/失败/证书校验失败时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 失败 1 成功 2 等待校验 3 证书校验失败
|
||||
*/
|
||||
@ApiModelProperty(value = " 0 支付/充值/提现失败 1 支付/充值/提现成功 2 支付/充值/提现校验中 3 支付/充值/提现证书校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户返回对象",value = "UserDto" )
|
||||
public class UserDto{
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id(邮箱)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id(邮箱)")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户挖矿账户矿工返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户挖矿账户矿工返回对象",value = "UserMinerDto" )
|
||||
public class UserMinerDto {
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "机器挖矿币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "实时算力(单位MH/S)")
|
||||
private BigDecimal realPower;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户挖矿账户矿工返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户挖矿账户矿工实时算力返回对象",value = "UserMinerPowerDto" )
|
||||
public class UserMinerPowerDto {
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "机器挖矿币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "机器算力")
|
||||
private BigDecimal power;
|
||||
|
||||
@ApiModelProperty(value = "记录开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value="UserOwnedProductDto", description="UserOwnedProductDto")
|
||||
public class UserOwnedProductDto {
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID(暂时使用租赁者钱包地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id(邮箱)")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 商品对应的机器id
|
||||
*/
|
||||
@ApiModelProperty(value = "商品对应的机器id")
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 订单明细 ID,关联订单中的购买记录
|
||||
*/
|
||||
@ApiModelProperty(value = "订单明细 ID,关联订单中的购买记录")
|
||||
private Long orderItemId;
|
||||
|
||||
/**
|
||||
* 商品开始使用时间(购买当天24点生效)
|
||||
*/
|
||||
@ApiModelProperty(value = "商品开始使用时间(购买当天24点生效)")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 商品使用结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "商品使用结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 购买算力的量,当 type 为 1 时有效
|
||||
*/
|
||||
@ApiModelProperty(value = "购买算力的量,当 type 为 1 时有效")
|
||||
private BigDecimal purchasedComputingPower;
|
||||
|
||||
/**
|
||||
* 当前实时算力
|
||||
*/
|
||||
@ApiModelProperty(value = "当前实时算力:单位默认MH/S")
|
||||
private BigDecimal currentComputingPower;
|
||||
|
||||
/**
|
||||
* 商品状态,0 表示运行中,1 表示已过期
|
||||
*/
|
||||
@ApiModelProperty(value = "商品状态,0 表示运行中,1 表示已过期")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商品类型,0 表示挖矿机器,1 表示算力套餐
|
||||
*/
|
||||
@ApiModelProperty(value = "商品类型,0 表示挖矿机器,1 表示算力套餐")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 购买时间
|
||||
*/
|
||||
@ApiModelProperty(value = "购买时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益
|
||||
*/
|
||||
@ApiModelProperty(value = "预估商品结束时的总收益")
|
||||
private BigDecimal estimatedEndIncome;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益 单位usdt
|
||||
*/
|
||||
@ApiModelProperty(value = "预估商品结束时的总收益 单位usdt")
|
||||
private BigDecimal estimatedEndUsdtIncome;
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到)
|
||||
*/
|
||||
@ApiModelProperty(value = "当前收益(根据购买机器到现在的平均算力计算得到)")
|
||||
private BigDecimal currentIncome;
|
||||
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到)单位usdt
|
||||
*/
|
||||
@ApiModelProperty(value = "当前收益(根据购买机器到现在的平均算力计算得到)单位usdt")
|
||||
private BigDecimal currentUsdtIncome;
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户钱包信息表
|
||||
* </p>
|
||||
*
|
||||
* @author 根据实际情况填写
|
||||
* @since 2025-09-08
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户钱包资料信息",value = "UserWalletDataDto")
|
||||
public class UserWalletDataDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "用户钱包信息id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 钱包唯一id(用于充值功能)
|
||||
*/
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 用户id(邮箱)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id(邮箱)")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 钱包地址
|
||||
*/
|
||||
@ApiModelProperty(value = "充值钱包地址(我们提供")
|
||||
private String fromAddress;
|
||||
|
||||
|
||||
/**
|
||||
* 钱包地址
|
||||
*/
|
||||
@ApiModelProperty(value = "收款钱包地址(用户自己填写)")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
@ApiModelProperty(value = "余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty(value = "冻结余额,不能用于提现(用户购买机器完成租约所需金额)")
|
||||
private BigDecimal blockedBalance;
|
||||
|
||||
/**
|
||||
* 支付地址二维码
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址二维码")
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "用户自定义钱包地址的币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "用户自定义钱包地址的链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "官方自动绑定钱包地址的币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "官方自动绑定钱包地址的链名称")
|
||||
private String fromChain;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal charge;
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品列表分页请求对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品对应算法",value = "AlgorithmShopIdMapDto" )
|
||||
public class AlgorithmShopIdMapDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "店铺id",example = "1")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器参数请求对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "asic 矿机新增 算力,币种返回对象",value = "AsicCoinAndAlgoDto" )
|
||||
public class AsicCoinAndAlgoDto {
|
||||
|
||||
@ApiModelProperty(value = "币种算力配置id")
|
||||
private Long coinAndPowerId;
|
||||
|
||||
@ApiModelProperty(value = "矿机id(忽略)")
|
||||
private Long productMachineId;
|
||||
|
||||
@ApiModelProperty(value = "币种(多个逗号隔开)")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "算法(多个逗号隔开)")
|
||||
private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "理论算力)",example = "0.01")
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
@ApiModelProperty(value = "商品机器单机算力单位",example = "TH/S")
|
||||
private String unit;
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车列表返回对象",value = "CartMachineInfoDto" )
|
||||
public class CartMachineInfoDto{
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "购物车详情id")
|
||||
private Long cartInfoId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = " gpu名称型号 或asic 名称型号")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "矿工账号 (gpu)")
|
||||
private String user;
|
||||
|
||||
@ApiModelProperty(value = "矿机型号 0 ASIC 1 GPU")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "矿机编号(gpu)")
|
||||
private String miner;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出")
|
||||
private Integer saleState;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "最大可租借天数(默认七天)",example = "7")
|
||||
private Integer maxLeaseDays;
|
||||
|
||||
@ApiModelProperty(value = "是否删除 0否 1是")
|
||||
private Integer del;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "最大月收益 usdt")
|
||||
private BigDecimal monthIncome;
|
||||
|
||||
@ApiModelProperty(value = "最大收益币种功耗 单位kw/h",example = "10")
|
||||
private BigDecimal powerDissipation;
|
||||
|
||||
@ApiModelProperty(value = "理论算力(卖方手动填写)")
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
@ApiModelProperty(value = "最大收益币种算力单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "最大收益币种算法")
|
||||
private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "最大收益对应币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "租赁天数")
|
||||
private Integer leaseTime;
|
||||
|
||||
private Long configId;
|
||||
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private String payCoin;
|
||||
|
||||
@ApiModelProperty(value = "asic 租赁数量")
|
||||
private Integer numbers;
|
||||
|
||||
@ApiModelProperty(value = "矿机客户端在离线情况 0 离线 1 在线")
|
||||
private Boolean onlineStatus;
|
||||
|
||||
@ApiModelProperty(value = "可售数量")
|
||||
private Integer canSaleNumbers;
|
||||
|
||||
@ApiModelProperty(value = "gpu和asic对应币种算力和月收益信息")
|
||||
private List<PowerIncomeInfoDto> powerIncomeInfoList;
|
||||
|
||||
@ApiModelProperty(value = "店铺售价集合")
|
||||
private List<MachinePayTypeDto> priceList;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CoinAndAlgorithmDto {
|
||||
|
||||
/**
|
||||
* 币种名称
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 算法名称
|
||||
*/
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 矿机id,多个已逗号隔开
|
||||
*/
|
||||
private String machineIds;
|
||||
|
||||
/**
|
||||
* 是否生效
|
||||
*/
|
||||
private Boolean isEffect;
|
||||
|
||||
/**
|
||||
* gpu名称
|
||||
*/
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* gpu 功耗
|
||||
*/
|
||||
private BigDecimal powerDissipation;
|
||||
|
||||
/**
|
||||
* gpu 理论算力
|
||||
*/
|
||||
private BigDecimal hashRate;
|
||||
|
||||
/**
|
||||
* 月收入
|
||||
*/
|
||||
private BigDecimal monthIncome;
|
||||
|
||||
/**
|
||||
* 是否新增 gpu 配置
|
||||
*/
|
||||
private Boolean isAdd;
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "币种算法返回对象",value = "CoinAndAlgorithmListDto")
|
||||
public class CoinAndAlgorithmListDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "币种对应算法返回对象")
|
||||
private List<AlgorithmListDto> algorithmList;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币种对应算法返回对象",value = "AlgorithmListDto")
|
||||
public static class AlgorithmListDto{
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "支持该算法的矿机id集合")
|
||||
private List<Long> machineIds;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class GoogleInfoDto implements Serializable {
|
||||
|
||||
/** 谷歌验证码 */
|
||||
private String secret;
|
||||
|
||||
/** 二维码 */
|
||||
private String img;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "gpu公共配置返回对象",value = "GpuConfigDto" )
|
||||
public class GpuConfigDto {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "gpu名称/型号")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "gpu品牌")
|
||||
private String brand;
|
||||
|
||||
private Integer memory;
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* GPU对应币种挖矿算力(只要gpu类型相同那么就使用这个配置)
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-11-27
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MachineConfigDto {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 机器id
|
||||
*/
|
||||
private Long machineId;
|
||||
|
||||
/**
|
||||
* gpu/asic品牌
|
||||
*/
|
||||
private String brand;
|
||||
|
||||
/**
|
||||
* gpu 名称/型号
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 内存单位M
|
||||
*/
|
||||
private Integer memory;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支持的币种
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 算法
|
||||
*/
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 是否是临时信息
|
||||
*/
|
||||
private Boolean isTemp;
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description 矿机是否能够上架
|
||||
* @Date 2025/12/12 14:41
|
||||
* @Author yyb
|
||||
*/
|
||||
@Data
|
||||
public class MachineEffectDto {
|
||||
private Long machineId;
|
||||
|
||||
private Integer effect;
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品列表分页请求对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MachineHashRateMapDto {
|
||||
private Long machineId;
|
||||
|
||||
private BigDecimal hashRate;
|
||||
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
package com.m2pool.lease.dto.v2;
|
||||
|
||||
import com.m2pool.lease.dto.MachinePayTypeDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "矿机返回对象",value = "MachineInfoDto" )
|
||||
public class MachineInfoDto {
|
||||
|
||||
|
||||
private Integer type;
|
||||
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "gpu名称 或asic 名称")
|
||||
private String model;
|
||||
|
||||
@ApiModelProperty(value = "矿机mac地址")
|
||||
private String hostMac;
|
||||
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty(value = "售出状态 0未售出 1已售出")
|
||||
private Integer saleState;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "最大可租借天数(默认七天)",example = "7")
|
||||
private Integer maxLeaseDays;
|
||||
|
||||
@ApiModelProperty(value = "最大月收益 usdt")
|
||||
private BigDecimal monthIncome;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "最大收益币种算法")
|
||||
private String algorithm;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "最大收益对应币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "矿机客户端在离线情况 0 离线 1 在线")
|
||||
private Boolean onlineStatus;
|
||||
|
||||
@ApiModelProperty(value = "可出售机器数量")
|
||||
private Integer saleNumbers;
|
||||
|
||||
@ApiModelProperty(value = "已售出数量")
|
||||
private Integer saleOutNumbers;
|
||||
|
||||
//动态列名(方便前端显示)
|
||||
private String c1;
|
||||
|
||||
private String c2;
|
||||
|
||||
private String c3;
|
||||
|
||||
private String c4;
|
||||
|
||||
private String c5;
|
||||
|
||||
private String c6;
|
||||
|
||||
private String c7;
|
||||
|
||||
private String c8;
|
||||
|
||||
private String c9;
|
||||
|
||||
private String c10;
|
||||
|
||||
|
||||
|
||||
//@ApiModelProperty(value = "币种动态列集合")
|
||||
//private List<PowerIncomeInfoDto> powerIncomeInfoList;
|
||||
|
||||
@ApiModelProperty(value = "店铺售价集合")
|
||||
private List<MachinePayTypeDto> priceList;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user