update 新增eth 币价定时任务
This commit is contained in:
225
m2pool-modules/m2pool-lease/pom.xml
Normal file
225
m2pool-modules/m2pool-lease/pom.xml
Normal file
@@ -0,0 +1,225 @@
|
||||
<?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>
|
||||
|
||||
|
||||
</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>
|
||||
@@ -0,0 +1,21 @@
|
||||
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 org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableM2PoolFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan({"com.m2pool.lease.mapper"})
|
||||
public class M2poolLeaseApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(M2poolLeaseApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//package com.m2pool.lease.config;
|
||||
//
|
||||
//import com.m2pool.common.core.constant.SecurityConstants;
|
||||
//import com.m2pool.common.core.context.SecurityContextHolder;
|
||||
//import com.m2pool.common.core.utils.JwtUtils;
|
||||
//import com.m2pool.common.core.utils.ServletUtils;
|
||||
//import com.m2pool.common.security.utils.SecurityUtils;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//import org.springframework.web.servlet.HandlerInterceptor;
|
||||
//
|
||||
//import javax.servlet.http.HttpServletRequest;
|
||||
//import javax.servlet.http.HttpServletResponse;
|
||||
//
|
||||
////生产环境
|
||||
//@Component
|
||||
//public class AuthInterceptor implements HandlerInterceptor {
|
||||
//
|
||||
// @Override
|
||||
// public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
// // 获取请求头中的 Authorization 字段
|
||||
//
|
||||
// //System.out.println("获取到的Authorization:"+authorization + "666"+ SecurityUtils.getToken());
|
||||
// //if (authorization != null) {
|
||||
// // // 将 Authorization 值存入 ThreadLocal
|
||||
// //
|
||||
// //}
|
||||
// String authorization = request.getHeader("Authorization");
|
||||
//
|
||||
// String userName = JwtUtils.getUserName(authorization);
|
||||
// SecurityContextHolder.setUserName("liuyiqing0119@gmail.com");
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
||||
// // 请求完成后清除 ThreadLocal 中的值,避免内存泄漏
|
||||
// SecurityContextHolder.remove();
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/api/**")
|
||||
.allowedOrigins("*") // 允许跨域
|
||||
.allowedMethods("GET", "POST")
|
||||
.allowedHeaders("Content-Type")
|
||||
.allowCredentials(true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
@@ -0,0 +1,289 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//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.InterceptorRegistry;
|
||||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
//
|
||||
//@Configuration
|
||||
//public class WebMvcConfig implements WebMvcConfigurer {
|
||||
//
|
||||
// @Autowired
|
||||
// private AuthInterceptor authInterceptor;
|
||||
//
|
||||
// @Override
|
||||
// public void addInterceptors(InterceptorRegistry registry) {
|
||||
// // 注册拦截器并指定拦截路径
|
||||
// registry.addInterceptor(authInterceptor)
|
||||
// .addPathPatterns("/**") // 拦截所有请求
|
||||
// .excludePathPatterns("/login", "/register") // 可选:排除不需要拦截的路径
|
||||
// .excludePathPatterns("/swagger-ui.html", "/webjars/**", "/v2/api-docs", "/swagger-resources/**"); // 可选:排除Swagger相关路径
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,106 @@
|
||||
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 {
|
||||
// GRS 出块间隔时间单位s
|
||||
public static final String GRS_ALGORITHM= "groestl";
|
||||
// Mona 出块间隔时间单位s
|
||||
public static final String MONA_ALGORITHM= "Lyra2REv2";
|
||||
// NEXA 出块间隔时间单位s
|
||||
public static final String NEXA_ALGORITHM= "NexaPow";
|
||||
// RXD 出块间隔时间单位s
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import com.m2pool.lease.dto.ChargeDto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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)),
|
||||
TRON_USDT("TRON","USDT", BigDecimal.valueOf(1)),
|
||||
TRON_NEXA("TRON","NEXA", BigDecimal.valueOf(1000));
|
||||
|
||||
private final String chain;
|
||||
/** 币种参数名 */
|
||||
private final String coin;
|
||||
/** 手续费 */
|
||||
private final BigDecimal amount;
|
||||
|
||||
|
||||
CoinCharge(String chain, String coin, BigDecimal amount) {
|
||||
this.chain = chain;
|
||||
this.coin = coin;
|
||||
this.amount = amount;
|
||||
}
|
||||
/**
|
||||
* 根据 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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取枚举类中所有枚举,并封装成 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
|
||||
));
|
||||
}
|
||||
return chargeDtoList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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 * 1000));
|
||||
map.put(TH_UNIT, BigDecimal.valueOf(1000L * 1000 * 1000 * 1000 * 1000));
|
||||
map.put(PH_UNIT, BigDecimal.valueOf(1000L * 1000 * 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
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";
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description redis key
|
||||
* @Date 2025/8/18 09:49
|
||||
* @Author yyb
|
||||
*/
|
||||
public class RedisKey {
|
||||
// 静态不可变的 Map,存储币种名和对应价格标识
|
||||
private static final Map<String, String> COIN_PRICE_MAP;
|
||||
|
||||
private static final Map<String, String> COIN_MHS_MAP;
|
||||
|
||||
private static final Map<String, String> COIN_REWARD_MAP;
|
||||
static {
|
||||
|
||||
Map<String, String> mapPrice = new HashMap<>();
|
||||
mapPrice.put("nexa", "nexa:price");
|
||||
mapPrice.put("mona", "mona:price");
|
||||
mapPrice.put("rxd", "rxd:price");
|
||||
mapPrice.put("grs", "grs:price");
|
||||
mapPrice.put("dgbs","dgb:price");
|
||||
mapPrice.put("dgbq","dgb:price");
|
||||
mapPrice.put("dgbo","dgb:price");
|
||||
mapPrice.put("alph","alph:price");
|
||||
mapPrice.put("eth","eth:price");
|
||||
|
||||
Map<String, String> mapMhs = new HashMap<>();
|
||||
mapMhs.put("nexa", "nexa:mhs");
|
||||
mapMhs.put("mona", "mona:mhs");
|
||||
mapMhs.put("rxd", "rxd:mhs");
|
||||
mapMhs.put("grs", "grs:mhs");
|
||||
mapMhs.put("dgbo","dgbo:mhs");
|
||||
mapMhs.put("dgbq","dgbq:mhs");
|
||||
mapMhs.put("dgbs","dgbs:mhs");
|
||||
mapMhs.put("alph","alph:mhs");
|
||||
|
||||
|
||||
Map<String, String> mapReward = new HashMap<>();
|
||||
mapReward.put("nexa", "nexa:reward");
|
||||
mapReward.put("mona", "mona:reward");
|
||||
mapReward.put("rxd", "rxd:reward");
|
||||
mapReward.put("grs", "grs:reward");
|
||||
mapReward.put("dgbs","dgb:reward");
|
||||
mapReward.put("dgbq","dgb:reward");
|
||||
mapReward.put("dgbo","dgb:reward");
|
||||
mapReward.put("alph","alph:reward");
|
||||
COIN_PRICE_MAP = Collections.unmodifiableMap(mapPrice);
|
||||
COIN_MHS_MAP = Collections.unmodifiableMap(mapMhs);
|
||||
COIN_REWARD_MAP = Collections.unmodifiableMap(mapReward);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名获取对应的价格标识
|
||||
* @param coinName 币种名
|
||||
* @return 对应的价格标识,若不存在则返回 null
|
||||
*/
|
||||
public static String getPiceKey(String coinName) {
|
||||
return COIN_PRICE_MAP.get(coinName);
|
||||
}
|
||||
|
||||
public static String getMhsKey(String coinName) {
|
||||
return COIN_MHS_MAP.get(coinName);
|
||||
}
|
||||
public static String getRewardKey(String coinName) {
|
||||
return COIN_REWARD_MAP.get(coinName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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";
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/machine/avg/power")
|
||||
public class LeaseMachineAvgPowerController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/machine/power")
|
||||
public class LeaseMachinePowerController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
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 = "订单控制器")
|
||||
@RestController
|
||||
@RequestMapping("/order/info")
|
||||
public class LeaseOrderInfoController {
|
||||
|
||||
|
||||
@Resource
|
||||
private LeaseOrderInfoService leaseOrderInfoService;
|
||||
|
||||
@ApiOperation("创建订单及订单详情 + 支付订单(返回二维码内容)")
|
||||
@PostMapping("/addOrders")
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseProductService;
|
||||
import com.m2pool.lease.service.LeaseUserOwnedProductService;
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import com.m2pool.lease.vo.ProductPageVo;
|
||||
import com.m2pool.lease.vo.ProductURDVo;
|
||||
import com.m2pool.lease.vo.UserOwnedProductVo;
|
||||
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;
|
||||
|
||||
/**
|
||||
* <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 Result<ProductMachineInfoDto> getProductMachineInfo(@RequestBody BaseVo BaseVo) {
|
||||
return leaseProductService.getProductMachineInfo(BaseVo.getId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.dto.*;
|
||||
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 = "商品矿机控制器(库存控制器)")
|
||||
@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);
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
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 = "店铺控制器")
|
||||
@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("钱包配置---新增商铺收款钱包绑定配置")
|
||||
@PostMapping("/addShopConfig")
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
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 = "购物车表控制器")
|
||||
@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("/deleteGoods")
|
||||
@Deprecated
|
||||
public Result<String> deleteGoods(@RequestBody BaseVo baseVo) {
|
||||
return leaseShoppingCartService.deleteGoods(baseVo);
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除购物车中商品")
|
||||
@PostMapping("/deleteBatchGoods")
|
||||
public Result<String> deleteBatchGoods(@RequestBody List<ProductAndMachineVo> baseVoList) {
|
||||
return leaseShoppingCartService.deleteBatchGoods(baseVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除购物车中已下架商品")
|
||||
@PostMapping("/deleteBatchGoodsForIsDelete")
|
||||
public Result<String> deleteBatchGoodsForIsDelete() {
|
||||
return leaseShoppingCartService.deleteBatchGoodsForIsDelete();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.dto.*;
|
||||
import com.m2pool.lease.service.LeaseUserService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "用户控制器")
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class LeaseUserController {
|
||||
|
||||
@Resource
|
||||
private LeaseUserService leaseUserService;
|
||||
@PostMapping("/login")
|
||||
@ApiOperation(value = "用户登录/注册")
|
||||
@Deprecated
|
||||
public Result<UserDto> login(@RequestBody UserURDVo userURDVo){
|
||||
return leaseUserService.login(userURDVo);
|
||||
}
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
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;
|
||||
|
||||
|
||||
// ---------------------------------------------- 一个普通订单对应一个支付订单(多个封装下面四个字段为一个对象,并返回list)----------------------------------------------------------------------
|
||||
|
||||
|
||||
@ApiModelProperty(value = "二维码图片")
|
||||
private String img;
|
||||
|
||||
@ApiModelProperty(value = "需支付总金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty(value = "已支付金额")
|
||||
private String payAmount;
|
||||
|
||||
@ApiModelProperty(value = "未支付金额")
|
||||
private Double noPayAmount;
|
||||
|
||||
//---------------------------------------------- 一个普通订单对应一个支付订单(多个封装下面四个字段为一个对象,并返回list)- ----------------------------------------------------------------------
|
||||
/**
|
||||
* 订单详情
|
||||
*/
|
||||
@ApiModelProperty(value = "订单详情")
|
||||
private List<OrderItemDto> orderItemDtoList;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
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.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;
|
||||
|
||||
public static <T> PageResult<T> success(List<T> data)
|
||||
{
|
||||
return setPageResult(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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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 = "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;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
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 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 = "商品机器单机理论算力(卖方手动填写)")
|
||||
//private BigDecimal power;
|
||||
|
||||
|
||||
/**
|
||||
* 库存中机器价格范围
|
||||
*/
|
||||
@ApiModelProperty(value = "价格范围")
|
||||
private String priceRange;
|
||||
|
||||
/**
|
||||
* 算法
|
||||
*/
|
||||
@ApiModelProperty(value = "算法")
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
@ApiModelProperty(value = "商品描述")
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* 功耗 单位kw/h
|
||||
*/
|
||||
//@ApiModelProperty(value = "功耗 单位kw/h")
|
||||
//private BigDecimal powerDissipation;
|
||||
|
||||
|
||||
/**
|
||||
* 电费 单位 $/度
|
||||
*/
|
||||
//@ApiModelProperty(value = "电费 单位 $/度")
|
||||
//private BigDecimal electricityBill;
|
||||
|
||||
/**
|
||||
* 收益率 单位 %
|
||||
*/
|
||||
//@ApiModelProperty(value = "收益率 单位 %")
|
||||
//private BigDecimal incomeRate;
|
||||
|
||||
|
||||
/**
|
||||
* 机器成本价格单位$ [ 功耗 * 电费 * 24 * (1 + 收益率) ]
|
||||
*/
|
||||
//@ApiModelProperty(value = "机器成本价格单位$ [ 功耗 * 电费 * 24 * (1 + 收益率) ]")
|
||||
// private BigDecimal cost;
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种 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;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
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 = "ProductMachineDto" )
|
||||
public class ProductMachineDto {
|
||||
|
||||
@ApiModelProperty(value = "矿机ID")
|
||||
private Long id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
@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;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "上下架状态,0 上架,1 下架")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 售出状态 0未售出 1已售出 2售出中
|
||||
*/
|
||||
@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 BigDecimal actualIncome;
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
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 = "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 BigDecimal price;
|
||||
|
||||
/**
|
||||
* 实际算力(计算得到,商家不能够自己添加和修改)
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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<PayConfigDto> payConfigList;
|
||||
|
||||
//@ApiModelProperty(value = "购物车二层商品列表返回对象")
|
||||
//List<ShoppingCartInfoDto> shoppingCartInfoDtoList;
|
||||
|
||||
@ApiModelProperty(value = "商品机器列表")
|
||||
List<ProductMachineDto> productMachineDtoList;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
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
|
||||
*/
|
||||
//@ApiModelProperty(value = "购物车详情ID")
|
||||
//private Long id;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "店铺ID",example = "8")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品 ID")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品机器ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品机器ID")
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品上下架状态,0 上架,1 下架
|
||||
*/
|
||||
@ApiModelProperty(value = "商品上下架状态,0 上架,1 下架")
|
||||
private Integer productState;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona",example = "nexa")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "商品图片路径")
|
||||
private String image;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "商品机器列表")
|
||||
List<ProductMachineDto> productMachineDtoList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Description 文件
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GoogleInfo implements Serializable {
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 谷歌验证码 */
|
||||
private String secret;
|
||||
|
||||
/** 谷歌验证码 */
|
||||
private int status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.m2pool.lease.dto.PageResult;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力 - 自动钱包地址表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-04
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseAutoAddress implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 钱包地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String fromChain;
|
||||
/**
|
||||
* 0 未使用 1 已使用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 绑定用户用户邮箱
|
||||
*/
|
||||
private String bindUser;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-29
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseNexaMachineAvgPower implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 记录开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 记录结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 实时平均算力
|
||||
*/
|
||||
private BigDecimal realAvgPower;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseNexaMachinePower implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 记录时间(每五分钟整点)
|
||||
*/
|
||||
private LocalDateTime date;
|
||||
|
||||
/**
|
||||
* 五分钟一次的矿工矿机算力
|
||||
*/
|
||||
private BigDecimal accepts;
|
||||
|
||||
/**
|
||||
* 矿机在离线状态 离线offline 在线online
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 实际记录时间
|
||||
*/
|
||||
private LocalDateTime lastSubmit;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseOrderInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 用户 ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 订单状态,0 表示待支付,1 表示(全部)已支付,2 表示已取消 3售后状态 4已退款 5已超时 10 部分已支付
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 下单时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单明细表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseOrderItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 订单明细 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺 ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 用户 ID(邮箱)
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 机器id
|
||||
*/
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 矿工账号
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿机编号
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private Integer quantity;
|
||||
|
||||
/**
|
||||
* 收货地址(模拟)
|
||||
*/
|
||||
private String address;
|
||||
|
||||
|
||||
/**
|
||||
*卖家地址链名称
|
||||
*/
|
||||
private String chain;
|
||||
|
||||
/**
|
||||
* 卖家地址支付币种
|
||||
*/
|
||||
private String symbol;
|
||||
|
||||
private String fromAddress;
|
||||
|
||||
private String fromChain;
|
||||
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 租期
|
||||
*/
|
||||
private Integer leaseTime;
|
||||
|
||||
/**
|
||||
* 支付币种
|
||||
*/
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 商品单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 单机理论收益
|
||||
*/
|
||||
private BigDecimal theoryIncome;
|
||||
|
||||
/**
|
||||
* 单机预估实际收益
|
||||
*/
|
||||
//private BigDecimal actualIncome;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 0 租约已过期 1 租约生效中
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 商品类型 0 矿机 1 算力
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeasePayRechargeMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*消息ID
|
||||
*/
|
||||
private String queueId;
|
||||
|
||||
|
||||
/**
|
||||
* 充值地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String symbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String chain;
|
||||
|
||||
//
|
||||
///**
|
||||
// * 币种
|
||||
// */
|
||||
//private String fromSymbol;
|
||||
//
|
||||
///**
|
||||
// * 链名称
|
||||
// */
|
||||
//private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 0 充值失败 1 充值成功 2 充值中
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeasePayRecordMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 买家充值地址
|
||||
*/
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 卖家充值地址
|
||||
*/
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 理论支付金额(根据商家定价)
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
*真实支付金额
|
||||
*/
|
||||
private BigDecimal realAmount;
|
||||
|
||||
/**
|
||||
* 实际应支付金额(根据一天内预估算力和实际算力差值计算得来)
|
||||
*/
|
||||
private BigDecimal needAmount;
|
||||
|
||||
/**
|
||||
* 钱包冻结金额
|
||||
*/
|
||||
private BigDecimal blockAmount;
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
private String txHash;
|
||||
|
||||
private Long blockHeight;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 等待校验
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private boolean del;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeasePayWithdrawMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 用户充值地址
|
||||
*/
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 提现地址(用户自定义)
|
||||
*/
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 手续费
|
||||
*/
|
||||
private BigDecimal serviceCharge;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 支付中
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeasePaymentRecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 支付记录 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 店铺 ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd
|
||||
*/
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 已支付金额
|
||||
*/
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/**
|
||||
* 支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 10支付成功--已支付部分货款
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
private String payAddress;
|
||||
|
||||
/**
|
||||
* 交易hash(交易成功后会生成)
|
||||
*/
|
||||
private String hash;
|
||||
|
||||
|
||||
/**
|
||||
* 买家钱包地址
|
||||
*/
|
||||
|
||||
@TableField("`from`")
|
||||
private String from;
|
||||
|
||||
/**
|
||||
* 支付二维码
|
||||
*/
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseProduct implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 商品类型,0 挖矿机器套餐,1 算力套餐
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
/**
|
||||
* 最低价格
|
||||
*/
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种全称
|
||||
*/
|
||||
private String coinFullName;
|
||||
|
||||
/**
|
||||
* 算法
|
||||
*/
|
||||
private String algorithm;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 销售机器数
|
||||
*/
|
||||
private Integer saleNumber;
|
||||
|
||||
/**
|
||||
* 总矿机数
|
||||
*/
|
||||
private Integer totalMachineNumber;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品收益表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseProductIncome implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 收益记录 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户拥有商品详情 ID,关联 lease_user_owned_product 表
|
||||
*/
|
||||
private Long userOwnedProductId;
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益
|
||||
*/
|
||||
private BigDecimal estimatedEndIncome;
|
||||
|
||||
/**
|
||||
* 当前实际总收益
|
||||
*/
|
||||
private BigDecimal currentActualIncome;
|
||||
|
||||
/**
|
||||
* 记录创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 记录更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseProductMachine implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 单机理论收入(每日)
|
||||
*/
|
||||
private BigDecimal theoryIncome;
|
||||
|
||||
/**
|
||||
* 单机预估实际收入(每日)
|
||||
*/
|
||||
//private BigDecimal actualIncome;
|
||||
|
||||
/**
|
||||
* 矿机型号
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 实际价格单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 算力大小(计算得到,商家不能够自己添加和修改)
|
||||
*/
|
||||
private BigDecimal computingPower;
|
||||
|
||||
/**
|
||||
* 上下架状态,0 上架,1 下架
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 售出状态 0未售出 1已售出 2售出中
|
||||
*/
|
||||
private Integer saleState;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
/**
|
||||
* 商品机器单机理论算力(卖方手动填写)
|
||||
*/
|
||||
private BigDecimal theoryPower;
|
||||
|
||||
/**
|
||||
* 商品机器单机算力单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
|
||||
/**
|
||||
* 功耗 单位kw/h
|
||||
*/
|
||||
private BigDecimal powerDissipation;
|
||||
|
||||
/**
|
||||
* 默认价格$ [ 功耗 * 电费 * 24 * (1 + 收益率) ]
|
||||
*/
|
||||
private BigDecimal cost;
|
||||
|
||||
|
||||
/**
|
||||
* 电费 单位 $/度
|
||||
*/
|
||||
//private BigDecimal electricityBill;
|
||||
|
||||
/**
|
||||
* 收益率 单位 %
|
||||
*/
|
||||
private BigDecimal incomeRate;
|
||||
|
||||
private Integer maxLeaseDays;
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseShop implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 店铺ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺拥有者邮箱
|
||||
*/
|
||||
private String userEmail;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 店铺图片路径
|
||||
*/
|
||||
private String image;
|
||||
|
||||
/**
|
||||
* 店铺描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 商铺状态 0 待审核 1 审核通过(店铺开启) 2 店铺关闭 10 店铺开启
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力 - 商铺地址配置表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-04
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseShopAddressConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 买方账号id(邮箱)
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 卖方收款钱包 每个买方对应一个地址(自动生成匹配)
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 商铺收款钱包二维码
|
||||
*/
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
* 商铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseShopConfig implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 配置ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商铺ID
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID (商品id为0代表适用于店铺中所有商品)
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String chain;
|
||||
|
||||
/**
|
||||
* nexa rxd dgbo dgbq dgbs alph enx grs mona usdt
|
||||
*/
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 币种图标
|
||||
*/
|
||||
private String payCoinImage;
|
||||
|
||||
/**
|
||||
* 币种类型 0 虚拟币 1 稳定币
|
||||
*/
|
||||
private Integer payType;
|
||||
|
||||
/**
|
||||
* 卖方对应收款钱包
|
||||
*/
|
||||
private String payAddress;
|
||||
|
||||
/**
|
||||
* 支付二维码
|
||||
*/
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
@TableField(exist = false)
|
||||
private BigDecimal price;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseShoppingCart implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 购物车 ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户 ID(邮箱)
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车详情表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseShoppingCartInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 购物车ID
|
||||
*/
|
||||
private Long cartId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品机器ID
|
||||
*/
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 租期
|
||||
*/
|
||||
private Integer leaseTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseUser implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID(邮箱)
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有商品详情表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseUserOwnedProduct implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID(暂时使用租赁者钱包地址)
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
|
||||
/**
|
||||
* 商品对应的机器id
|
||||
*/
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 订单明细 ID,关联订单中的购买记录
|
||||
*/
|
||||
private Long orderItemId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品开始使用时间(购买当天24点生效)
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 商品使用结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona
|
||||
*/
|
||||
private String coin;
|
||||
|
||||
/**
|
||||
* 购买算力的量,当 type 为 1 时有效
|
||||
*/
|
||||
private BigDecimal purchasedComputingPower;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益 单位币种
|
||||
*/
|
||||
private BigDecimal estimatedEndIncome;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益 单位usdt
|
||||
*/
|
||||
private BigDecimal estimatedEndUsdtIncome;
|
||||
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到) 单位币种
|
||||
*/
|
||||
private BigDecimal currentIncome;
|
||||
|
||||
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到)单位usdt
|
||||
*/
|
||||
private BigDecimal currentUsdtIncome;
|
||||
|
||||
private BigDecimal settleIncome ;
|
||||
|
||||
private BigDecimal settleUsdtIncome ;
|
||||
|
||||
/**
|
||||
* 商品状态,0 表示运行中,1 表示已过期
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商品类型,0 表示挖矿机器,1 表示算力套餐
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 卖方钱包地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 购买时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 逻辑删除字段
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.m2pool.lease.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
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
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class LeaseUserWalletData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 钱包唯一id(用于充值功能)
|
||||
*/
|
||||
private String queueId;
|
||||
/**
|
||||
* 用户id(邮箱)
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 充值钱包地址(我们提供)
|
||||
*/
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 收款钱包地址(用户自己填写)
|
||||
*/
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 冻结余额(用户购买机器完成租约所需金额)
|
||||
*/
|
||||
private BigDecimal blockedBalance;
|
||||
|
||||
/**
|
||||
* 支付地址二维码
|
||||
*/
|
||||
private String qrcode;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private Boolean del;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long shopId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.m2pool.lease.exception;
|
||||
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
/**
|
||||
* 全局异常处理器,用于捕获并处理应用中抛出的异常。
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
/**
|
||||
* 处理商品已出售异常,返回统一的错误结果。
|
||||
*
|
||||
* @param e 商品已出售异常对象
|
||||
* @return 包含错误信息的统一结果对象
|
||||
*/
|
||||
@ExceptionHandler(ProductSoldOutException.class)
|
||||
public Result<String> handleProductSoldOutException(ProductSoldOutException e) {
|
||||
return Result.fail(e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(PaymentException.class)
|
||||
public Result<String> handlePaymentException(PaymentException e) {
|
||||
return Result.fail(e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(OrderException.class)
|
||||
public Result<String> handleOrderException(OrderException e) {
|
||||
return Result.fail(e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(PayRechargeException.class)
|
||||
public Result<String> handleOrderException(PayRechargeException e) {
|
||||
return Result.fail(e.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理其他未明确捕获的异常,返回统一的错误结果。
|
||||
*
|
||||
* @param e 异常对象
|
||||
* @return 包含错误信息的统一结果对象
|
||||
*/
|
||||
@ExceptionHandler(Exception.class)
|
||||
public Result<String> handleException(Exception e) {
|
||||
return Result.fail("系统异常,请稍后再试: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.m2pool.lease.exception;
|
||||
|
||||
/**
|
||||
* 订单异常
|
||||
*/
|
||||
public class OrderException extends RuntimeException {
|
||||
public OrderException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.m2pool.lease.exception;
|
||||
|
||||
/**
|
||||
* 支付异常
|
||||
*/
|
||||
public class PayRechargeException extends RuntimeException {
|
||||
public PayRechargeException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.m2pool.lease.exception;
|
||||
|
||||
/**
|
||||
* 支付异常
|
||||
*/
|
||||
public class PaymentException extends RuntimeException {
|
||||
public PaymentException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.m2pool.lease.exception;
|
||||
|
||||
/**
|
||||
* 商品已出售异常类,用于表示在添加订单时商品已被出售的异常情况。
|
||||
*/
|
||||
public class ProductSoldOutException extends RuntimeException {
|
||||
public ProductSoldOutException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.UserWalletDataDto;
|
||||
import com.m2pool.lease.entity.LeaseAutoAddress;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface LeaseAutoAddressMapper extends BaseMapper<LeaseAutoAddress> {
|
||||
/**
|
||||
* 获取一个未使用的地址
|
||||
* @return
|
||||
*/
|
||||
LeaseAutoAddress getOneStatusIsNoUse();
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有有效的地址
|
||||
* @return
|
||||
*/
|
||||
List<UserWalletDataDto> getValidAddress();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.lease.dto.UserMinerDto;
|
||||
import com.m2pool.lease.entity.LeaseNexaMachineAvgPower;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 矿池nexa机器实时平均算力 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseNexaMachineAvgPowerMapper extends BaseMapper<LeaseNexaMachineAvgPower> {
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
*
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
boolean insertBatchDatas(@Param("list") List<LeaseNexaMachineAvgPower> list);
|
||||
|
||||
/**
|
||||
* 根据用户和矿工查询数据
|
||||
*
|
||||
* @param userMinerList
|
||||
* @return
|
||||
*/
|
||||
List<LeaseNexaMachineAvgPower> selectListByUserAndMiner(@Param("list") List<UserMinerDto> userMinerList);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.common.datasource.annotation.HashRateDB;
|
||||
import com.m2pool.lease.dto.ProductMachineDto;
|
||||
import com.m2pool.lease.entity.LeaseNexaMachinePower;
|
||||
import com.m2pool.lease.entity.LeaseProductMachine;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseNexaMachinePowerMapper extends BaseMapper<LeaseNexaMachinePower> {
|
||||
|
||||
/**
|
||||
* 获取指定时间段内指定表内指定矿工的实时算力
|
||||
* @param leaseProductMachines
|
||||
* @param pointDate
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
@HashRateDB
|
||||
List<LeaseNexaMachinePower> getMachinePowerInHashRateById(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("pointDate")Date pointDate, @Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
* 获取3天内算力总和
|
||||
* @param leaseProductMachines
|
||||
* @param coin
|
||||
* @return
|
||||
*/
|
||||
@HashRateDB
|
||||
List<ProductMachineDto> getMachineThreePower(@Param("leaseProductMachines") List<LeaseProductMachine> leaseProductMachines, @Param("coin") String coin);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.m2pool.lease.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.m2pool.common.datasource.annotation.Pool2DB;
|
||||
import com.m2pool.lease.dto.OrderInfoDto;
|
||||
import com.m2pool.lease.entity.LeaseOrderInfo;
|
||||
import com.m2pool.lease.entity.LeaseUserOwnedProduct;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Mapper
|
||||
public interface LeaseOrderInfoMapper extends BaseMapper<LeaseOrderInfo> {
|
||||
|
||||
/**
|
||||
* 根据订单状态查询订单(买家)
|
||||
*
|
||||
* @param status 订单状态
|
||||
* @return 订单列表
|
||||
*/
|
||||
List<OrderInfoDto> getOrdersByStatus(@Param("userId") String userId, @Param("status") Integer status);
|
||||
|
||||
|
||||
/**
|
||||
* 根据订单状态查询订单(卖家)
|
||||
*
|
||||
* @param status 订单状态
|
||||
* @param ids 订单id集合
|
||||
* @return 订单列表
|
||||
*/
|
||||
List<OrderInfoDto> getOrdersByStatusForSeller( @Param("status") Integer status,@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据机器id集合查看订单详情信息
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
List<LeaseUserOwnedProduct> getOrderItemsByMachineId(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取需要付款的订单列表 状态为7 订单进行中的订单
|
||||
* @return
|
||||
*/
|
||||
List<LeaseOrderInfo> getNeedPayOrderList();
|
||||
|
||||
@Pool2DB
|
||||
BigDecimal getCoinPrice(@Param("coin") String coin);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user