Compare commits
45 Commits
main
...
d657598d59
| Author | SHA1 | Date | |
|---|---|---|---|
| d657598d59 | |||
| 10b9a3cc6d | |||
| c659fd4930 | |||
| 9e74f6527b | |||
| be0bf9c800 | |||
| f4872d91a2 | |||
| a22908ba18 | |||
| 12a1ba3445 | |||
| 3c524675fa | |||
| 2db243f1ad | |||
| db5af51af6 | |||
| 33231bed63 | |||
| ad379bfa58 | |||
| b22d73dc1c | |||
| 38f2dbee91 | |||
| c72336de47 | |||
| 2537d0dab4 | |||
| f0f9394807 | |||
| 0e0b1a6cfd | |||
| 5f6524b15e | |||
| 94db6e9d3b | |||
| 6de94fb487 | |||
| 446a8f0dfb | |||
| 261cbe38d2 | |||
| dccbb10512 | |||
| 89bf55b4ce | |||
| 5bd7f61c55 | |||
| c791d4fc17 | |||
| d5af03e5a4 | |||
| 1e7c2099bf | |||
| b210b114d5 | |||
| 379e102ab4 | |||
| 709681d7e5 | |||
| bc2f76662c | |||
| 4e23775014 | |||
| f1896bc1ae | |||
| 6250442c77 | |||
| 6983e8657b | |||
| cdc0cc8212 | |||
| 7cd19a2338 | |||
| a7a2b73d00 | |||
| 9c0cc31a64 | |||
| 20fcfa778e | |||
| 0fff57492e | |||
| 0dfc209485 |
438
lease_v1.0.0.sql
Normal file
438
lease_v1.0.0.sql
Normal file
@@ -0,0 +1,438 @@
|
||||
-- 第一版租赁系统 只支持自营矿池挖矿
|
||||
|
||||
-- -- 创建用户表,存储用户基本信息
|
||||
-- CREATE TABLE IF NOT EXISTS `lease_user` (
|
||||
-- `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
-- `user_id` VARCHAR(50) NOT NULL UNIQUE COMMENT '用户id(邮箱)',
|
||||
-- `password` VARCHAR(64) NOT NULL COMMENT '密码',
|
||||
-- `address` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '钱包地址',
|
||||
-- `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
-- `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
|
||||
--
|
||||
--
|
||||
|
||||
-- 创建店铺表
|
||||
CREATE TABLE IF NOT EXISTS `lease_shop` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '店铺ID',
|
||||
`user_email` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '店铺拥有者邮箱',
|
||||
`name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '店铺名称',
|
||||
`image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '店铺图片路径',
|
||||
`state` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '商铺状态 0 待审核 1 审核通过(店铺开启) 2 店铺关闭',
|
||||
`description` TEXT COMMENT '店铺描述',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段',
|
||||
UNIQUE INDEX idx_email (user_email)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='店铺表';
|
||||
|
||||
-- 创建店铺--店铺支持收款地址配置表
|
||||
CREATE TABLE IF NOT EXISTS `lease_shop_config` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '配置ID',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`product_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品 ID (商品id为0代表适用于店铺中所有商品) ------- 该字段删除',
|
||||
`pay_coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd',
|
||||
`chain` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖家地址链名称',
|
||||
`pay_coin_image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '支付币种图标',
|
||||
`pay_type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '币种类型 0 虚拟币 1 稳定币',
|
||||
`pay_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖方对应收款钱包',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`qrcode` LONGTEXT COMMENT '卖方对应收款钱包二维码',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='店铺支持收款地址配置表';
|
||||
|
||||
|
||||
-- 用于店铺收款钱包配置 时下拉选择链和币
|
||||
CREATE TABLE IF NOT EXISTS `lease_chain_coin_config` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '配置ID',
|
||||
`coin_full` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种全称',
|
||||
`coin_image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '支付币种图标',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd',
|
||||
`chain` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '链名称'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='店铺支持收款地址配置表(店铺钱包)';
|
||||
|
||||
|
||||
-- 创建商品表,存储挖矿机器和算力套餐信息
|
||||
CREATE TABLE IF NOT EXISTS `lease_product` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '商品 ID',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商品名称',
|
||||
`image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品图片路径',
|
||||
`algorithm` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '算法',
|
||||
`sale_number` INT NOT NULL DEFAULT 0 COMMENT '销售机器数(租赁出一次算一个销售数)',
|
||||
`total_machine_number` INT NOT NULL DEFAULT 0 COMMENT '当前总矿机数(包含已售出矿机数)',
|
||||
`max_price` DECIMAL(30, 18) NOT NULL DEFAULT 0.000000 COMMENT '商品下机器最大价格',
|
||||
`min_price` DECIMAL(30, 18) NOT NULL DEFAULT 0.000000 COMMENT '商品下机器最小价格',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT ' 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona',
|
||||
`coin_full_name` VARCHAR(32) NOT NULL DEFAULT '' COMMENT ' 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona',
|
||||
`type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '商品类型,0 矿机 1 算力 ',
|
||||
`state` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '上下架状态,0 上架,1 下架',
|
||||
`description` TEXT COMMENT '商品描述',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `lease_product_machine` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`product_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品 ID',
|
||||
`user` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器 对应的矿工账号',
|
||||
`type` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '矿机型号',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT ' 矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona',
|
||||
`miner` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器编号',
|
||||
`theory_power` DECIMAL(32, 6) NOT NULL DEFAULT 0.000000 COMMENT '商品机器单机算力(卖方手动填写)理论算力 (如果实时变化可不要这个字段)',
|
||||
`computing_power` DECIMAL(32, 6) NOT NULL DEFAULT 0.000000 COMMENT '实际算力(计算得到,商家不能够自己添加和修改) (如果实时变化可不要这个字段)',
|
||||
`theory_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.00 COMMENT '单机理论收益:单位usdt(每日:根据添加机器时,实时计算的收益值)',
|
||||
-- `actual_income` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '单机预估实际收益(每日)',
|
||||
`unit` VARCHAR(16) NOT NULL DEFAULT '' COMMENT '算力单位 GH/s TH/s PH/s',
|
||||
-- `electricity_bill` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '电费 单位 $/度 (该字段目前未使用,可删除)',
|
||||
`max_lease_days` INT NOT NULL DEFAULT 7 COMMENT '矿机租售天数',
|
||||
`power_dissipation` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '功耗 单位kw/h',
|
||||
`income_rate` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 DEFAULT 0.00 COMMENT '收益率',
|
||||
`cost` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '默认单价单位$ [ 功耗 * 电费 * 24 * (1 + 收益率) ]',
|
||||
`price` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '实际单价',
|
||||
`sale_state` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '售出状态 0未售出 1已售出 2售出中(已下单情况该状态已不存在)',
|
||||
`state` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '上下架状态,0 上架,1 下架',
|
||||
`del` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除字段',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
KEY `idx_user_coin_miner` (`user`, `coin`, `miner`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表对应的物品机器表';
|
||||
|
||||
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `lease_product_machine_price` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
|
||||
`product_machine_id` BIGINT NOT NULL DEFAULT 0 COMMENT '矿机id',
|
||||
`price` DECIMAL(30, 18) NOT NULL DEFAULT 0.00 COMMENT '实际单价',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '价值单位',
|
||||
`chain` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '链',
|
||||
`del` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品表对应的物品机器表';
|
||||
|
||||
|
||||
-- 创建已购机器表(租赁表)
|
||||
CREATE TABLE IF NOT EXISTS `lease_user_owned_product` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`user_id` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '用户id(邮箱)',
|
||||
`product_machine_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品对应的机器id',
|
||||
`user` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器 对应的矿工账号',
|
||||
`order_id` BIGINT NOT NULL DEFAULT 0 COMMENT '订单 ID',
|
||||
`miner` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器编号',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona',
|
||||
`estimated_end_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '预估商品结束时的总收益',
|
||||
`estimated_end_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '预估商品结束时的总收益 单价usdt',
|
||||
`current_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '当前收益(根据购买机器到现在的平均算力计算得到)单位 币种',
|
||||
`current_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '当前收益(根据购买机器到现在的平均算力计算得到----非实时)单位usdt',
|
||||
`settle_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '待结算收益(用于存储某天还未支付情况下的收益)',
|
||||
`settle_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '待结算收益 (用于存储某天还未支付情况下的收益----非实时)单位usdt',
|
||||
`order_item_id` BIGINT NOT NULL DEFAULT 0 COMMENT '订单明细 ID,关联订单中的购买记录',
|
||||
`address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖方对应收款钱包',
|
||||
`start_time` DATETIME NOT NULL COMMENT '商品开始使用时间(购买当天24点生效)',
|
||||
`end_time` DATETIME NOT NULL COMMENT '商品使用结束时间',
|
||||
`purchased_computing_power` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '购买算力时实时算力,当 type 为 1 时有效',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '商品状态,0 表示运行中,1 表示已过期 ',
|
||||
`type` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '商品类型,0 表示挖矿机器,1 表示算力套餐',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '购买时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户拥有商品详情表';
|
||||
|
||||
|
||||
-- 创建购物车表,存储用户添加到购物车的商品信息
|
||||
CREATE TABLE IF NOT EXISTS `lease_shopping_cart` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '购物车 ID',
|
||||
`user_id` varchar(64) NOT NULL DEFAULT '' COMMENT '用户 ID(邮箱)',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='购物车表';
|
||||
|
||||
|
||||
-- 创建购物车详情表
|
||||
CREATE TABLE IF NOT EXISTS `lease_shopping_cart_info` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`cart_id` BIGINT NOT NULL DEFAULT 0 COMMENT '购物车ID',
|
||||
`product_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品 ID',
|
||||
`product_machine_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品机器ID',
|
||||
`lease_time` int NOT NULL DEFAULT 1 COMMENT '租赁天数',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='购物车详情表';
|
||||
|
||||
-- 创建订单表,存储订单基本信息
|
||||
CREATE TABLE IF NOT EXISTS `lease_order_info` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '订单 ID',
|
||||
`order_number` VARCHAR(50) NOT NULL DEFAULT '' UNIQUE COMMENT '订单号',
|
||||
`user_id` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '用户id(邮箱)',
|
||||
`total_price` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '订单总价',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 7 COMMENT '订单状态,0 表示待支付,1 表示(全部)已支付,2 表示已取消 3售后状态 4已退款 5 支付已超时 6 支付中 ( 目前只有这三种状态 7 订单进行中 8 订单已完成 9 余额不足,订单已取消) 10 部分已支付',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '下单时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
|
||||
|
||||
|
||||
|
||||
-- 创建订单明细表,存储订单中的商品明细
|
||||
CREATE TABLE IF NOT EXISTS `lease_order_item` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '订单明细 ID',
|
||||
`order_id` BIGINT NOT NULL DEFAULT 0 COMMENT '订单 ID',
|
||||
`user_id` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '用户id(邮箱)',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`product_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品 ID',
|
||||
`product_machine_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商品对应的机器id',
|
||||
`user` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器 对应的矿工账号',
|
||||
`miner` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '挖矿机器编号',
|
||||
`name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商品名称',
|
||||
`theory_income` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '单机理论收益',
|
||||
`lease_time` INT NOT NULL DEFAULT 0 COMMENT '租赁天数',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '0 租约已过期 1 租约生效中 2 等待租约生效 ',
|
||||
`pay_coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd',
|
||||
`coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '矿机挖矿币种 nexa rxd dgbo dgbq dgbs alph enx grs mona',
|
||||
`address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖方对应收款钱包',
|
||||
`chain` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖家地址链名称',
|
||||
`symbol` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖家地址支付币种',
|
||||
`from_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '买方对应收款钱包(删除,支付时用户必定存在和卖家收款地址相同币种和链的地址,代码中已做处理)',
|
||||
`from_chain` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '买方地址链名称(删除)',
|
||||
`from_symbol` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '买方地址支付币种(删除)',
|
||||
`image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品图片路径',
|
||||
`quantity` INT NOT NULL DEFAULT 1 COMMENT '商品数量(弃用)',
|
||||
`price` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '商品价格',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单明细表';
|
||||
|
||||
|
||||
|
||||
|
||||
-- 创建支付记录表,模拟支付信息
|
||||
CREATE TABLE IF NOT EXISTS `lease_payment_record` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '支付记录 ID',
|
||||
`order_id` BIGINT NOT NULL DEFAULT 0 UNIQUE COMMENT '订单 ID',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`product_id` BIGINT COMMENT '商品 ID(后续删除)',
|
||||
`pay_coin` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd',
|
||||
`amount` DECIMAL(40, 6) NOT NULL DEFAULT 0.000000 COMMENT '需支付总金额',
|
||||
`pay_amount` DECIMAL(40, 6) NOT NULL DEFAULT 0.000000 COMMENT '已支付金额',
|
||||
`status` TINYINT(1) NOT NULL DEFAULT 7 COMMENT '支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 6 支付中( 目前只有这三种状态 7 订单进行中 8 订单已完成 9 余额不足,订单已取消) 10支付成功--已支付部分货款 ',
|
||||
`from` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '买家钱包',
|
||||
`hash` VARCHAR(256) NOT NULL DEFAULT '' COMMENT '交易id 交易成功后生成',
|
||||
`pay_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖方对应收款钱包',
|
||||
`qrcode` LONGTEXT COMMENT '支付地址二维码',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '支付时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
KEY `orderid_shopid` (`order_id`,`shop_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付记录表';
|
||||
|
||||
|
||||
|
||||
-- -- 创建商品收益表,存储每个商品对应的收益信息
|
||||
-- CREATE TABLE IF NOT EXISTS `lease_product_income` (
|
||||
-- `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '收益记录 ID',
|
||||
-- `user_owned_product_id` BIGINT NOT NULL DEFAULT 0 COMMENT '用户拥有商品详情 ID,关联 lease_user_owned_product 表',
|
||||
-- `estimated_end_income` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '预估商品结束时的总收益',
|
||||
-- `current_actual_income` DECIMAL(18, 2) NOT NULL DEFAULT 0.00 COMMENT '当前实际总收益',
|
||||
-- `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间',
|
||||
-- `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录更新时间'
|
||||
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品收益表';
|
||||
--
|
||||
--
|
||||
-- -- 删除
|
||||
-- CREATE TABLE IF NOT EXISTS `lease_shop_address_config` (
|
||||
-- `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
-- `user_id` varchar(64) NOT NULL COMMENT '买方账号id(邮箱)',
|
||||
-- `address` VARCHAR(512) NOT NULL DEFAULT '' COMMENT '卖方收款钱包 每个买方对应一个地址(自动生成匹配)',
|
||||
-- `shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
-- UNIQUE KEY `idx_user_address_shop` (`user_id`,`address`,shop_id)
|
||||
-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='矿池nexa机器实时平均算力';
|
||||
|
||||
|
||||
-- 官方自动生成地址存储表
|
||||
CREATE TABLE IF NOT EXISTS `lease_auto_address` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`address` VARCHAR(512) NOT NULL DEFAULT '' COMMENT '钱包地址',
|
||||
`from_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`from_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 未使用 1 已使用 2 钱包已过期',
|
||||
`bind_user` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '绑定者邮箱',
|
||||
UNIQUE INDEX `idx_address_from_symbol_from_chain` (`address`, `from_symbol`, `from_chain`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='官方自动生成地址表';
|
||||
|
||||
|
||||
-- 个人钱包资料表
|
||||
CREATE TABLE IF NOT EXISTS `lease_user_wallet_data` (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`user_id` VARCHAR(50) NOT NULL UNIQUE COMMENT '用户id(邮箱)',
|
||||
`queue_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '钱包唯一id(用于充值功能)',
|
||||
`from_address` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '充值钱包地址(我们提供)',
|
||||
`balance` DECIMAL(40, 6) NOT NULL DEFAULT 0.000000 COMMENT '余额',
|
||||
`blocked_balance` DECIMAL(40, 6) NOT NULL DEFAULT 0.000000 COMMENT '冻结余额(用户购买机器完成租约所需金额)',
|
||||
`to_address` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '收款钱包地址(用户自己填写)',
|
||||
`from_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`from_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`to_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`to_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`qrcode` LONGTEXT COMMENT '支付地址二维码',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段' ,
|
||||
UNIQUE INDEX `idx_user_from_info` (`user_id`, `from_address`,`from_symbol`, `from_chain`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户钱包信息表(个人钱包)';
|
||||
|
||||
|
||||
|
||||
-- 支付记录表
|
||||
CREATE TABLE IF NOT EXISTS lease_pay_record_message (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`queue_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '消息ID',
|
||||
`from_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '买家充值地址',
|
||||
`to_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖家充值地址',
|
||||
`order_number` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '订单号(方便查询,基本未使用)',
|
||||
`order_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '订单号',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`user_id` VARCHAR(50) NOT NULL COMMENT '买方邮箱',
|
||||
`block_amount`DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '买方钱包冻结金额',
|
||||
`amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '理论支付金额',
|
||||
`real_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际支付金额',
|
||||
`need_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际应支付金额(支付是一天一次,根据一天内预估算力和实际算力差值计算得来)',
|
||||
`block_height` BIGINT NOT NULL DEFAULT 0 COMMENT '报块高度',
|
||||
`from_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`from_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`to_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`to_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`tx_hash` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '交易id',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '支付时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 2 COMMENT '0 支付失败 1 支付成功 2 支付中 3 校验失败 4 发送支付消息失败',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付记录表';
|
||||
|
||||
|
||||
CREATE TABLE IF NOT EXISTS lease_pay_record_message_info (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`queue_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '消息ID',
|
||||
`from_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '买家充值地址',
|
||||
`to_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '卖家充值地址',
|
||||
`order_number` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '订单号(方便查询,基本未使用)',
|
||||
`order_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '订单号',
|
||||
`shop_id` BIGINT NOT NULL DEFAULT 0 COMMENT '商铺ID',
|
||||
`user_id` VARCHAR(50) NOT NULL COMMENT '买方邮箱',
|
||||
`block_amount`DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '买方钱包冻结金额',
|
||||
`amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '理论支付金额',
|
||||
`real_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际支付金额',
|
||||
`need_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际应支付金额(支付是一天一次,根据一天内预估算力和实际算力差值计算得来)',
|
||||
`block_height` BIGINT NOT NULL DEFAULT 0 COMMENT '报块高度',
|
||||
`from_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`from_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`to_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`to_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`tx_hash` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '交易id',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '支付时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 2 COMMENT '0 支付失败 1 支付成功 2 支付中 3 校验失败 4 发送支付消息失败',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付记录详情表(订单对应每日应支付金额)';
|
||||
|
||||
|
||||
-- 充值记录返回表
|
||||
CREATE TABLE IF NOT EXISTS lease_pay_recharge_message (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`queue_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '消息ID',
|
||||
`address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '充值地址',
|
||||
`amount` DECIMAL(40, 6) NOT NULL DEFAULT 0.00000000 COMMENT '支付金额',
|
||||
`chain` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`symbol` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '币种',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0 充值失败 1 充值成功 2 充值中',
|
||||
`tx_hash` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '交易id',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段' ,
|
||||
UNIQUE INDEX `tx_hash_key` (`tx_hash`);
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值记录表';
|
||||
|
||||
-- 提现记录表
|
||||
CREATE TABLE IF NOT EXISTS lease_pay_withdraw_message (
|
||||
`id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
|
||||
`queue_id` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '消息ID',
|
||||
`from_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '用户充值地址',
|
||||
`to_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '提现地址(用户自定义)',
|
||||
`amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '提现金额',
|
||||
`from_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`from_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`to_symbol` VARCHAR(32) NOT NULL DEFAULT '' COMMENT '币种名称',
|
||||
`service_charge` DECIMAL(40, 6) NOT NULL DEFAULT 0.000000 COMMENT '提现费用',
|
||||
`to_chain` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '链名称',
|
||||
`create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间',
|
||||
`update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`status` tinyint(1) NOT NULL DEFAULT 2 COMMENT '0 提现失败 1 提现成功 2 提现中',
|
||||
`tx_hash` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '交易id',
|
||||
`del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除字段'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='提现记录表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `nexa_real_power` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user` varchar(64) NOT NULL COMMENT "挖矿账户",
|
||||
`miner` varchar(64) NOT NULL COMMENT "矿工编号",
|
||||
`date` datetime NOT NULL,
|
||||
`power` decimal(32,6) NOT NULL COMMENT "实时算力单位 MH/S",
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `user_miner` (`user`,`miner`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='矿机实时算力';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `grs_real_power` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user` varchar(64) NOT NULL COMMENT "挖矿账户",
|
||||
`miner` varchar(64) NOT NULL COMMENT "矿工编号",
|
||||
`date` datetime NOT NULL,
|
||||
`power` decimal(32,6) NOT NULL COMMENT "实时算力单位 MH/S",
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `user_miner` (`user`,`miner`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='矿机实时算力';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `mona_real_power` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user` varchar(64) NOT NULL COMMENT "挖矿账户",
|
||||
`miner` varchar(64) NOT NULL COMMENT "矿工编号",
|
||||
`date` datetime NOT NULL,
|
||||
`power` decimal(32,6) NOT NULL COMMENT "实时算力单位 MH/S",
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `user_miner` (`user`,`miner`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='矿机实时算力';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `rxd_real_power` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user` varchar(64) NOT NULL COMMENT "挖矿账户",
|
||||
`miner` varchar(64) NOT NULL COMMENT "矿工编号",
|
||||
`date` datetime NOT NULL,
|
||||
`power` decimal(32,6) NOT NULL COMMENT "实时算力单位 MH/S",
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `user_miner` (`user`,`miner`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='矿机实时算力';
|
||||
|
||||
|
||||
ALTER TABLE lease_product MODIFY COLUMN `max_price` DECIMAL(30, 18) NOT NULL DEFAULT 0.000000 COMMENT '商品下机器最大价格';
|
||||
ALTER TABLE lease_product MODIFY COLUMN `min_price` DECIMAL(30, 18) NOT NULL DEFAULT 0.000000 COMMENT '商品下机器最小价格';
|
||||
ALTER TABLE lease_product_machine MODIFY COLUMN `theory_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '单机理论收益:单位usdt(每日:根据添加机器时,实时计算的收益值)';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `estimated_end_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '预估商品结束时的总收益';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `estimated_end_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '预估商品结束时的总收益 单价usdt';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `current_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '当前收益(根据购买机器到现在的平均算力计算得到)单位 币种';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `current_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '当前收益(根据购买机器到现在的平均算力计算得到----非实时)单位usdt';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `settle_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '待结算收益(用于存储某天还未支付情况下的收益)';
|
||||
ALTER TABLE lease_user_owned_product MODIFY COLUMN `settle_usdt_income` DECIMAL(32, 18) NOT NULL DEFAULT 0.000000 COMMENT '待结算收益 (用于存储某天还未支付情况下的收益----非实时)单位usdt';
|
||||
ALTER TABLE lease_pay_record_message MODIFY COLUMN `block_amount`DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '买方钱包冻结金额';
|
||||
ALTER TABLE lease_pay_record_message MODIFY COLUMN `amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '理论支付金额';
|
||||
ALTER TABLE lease_pay_record_message MODIFY COLUMN `real_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际支付金额';
|
||||
ALTER TABLE lease_pay_record_message MODIFY COLUMN `need_amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.000000 COMMENT '实际应支付金额(支付是一天一次,根据一天内预估算力和实际算力差值计算得来)';
|
||||
ALTER TABLE lease_pay_withdraw_message MODIFY COLUMN `amount` DECIMAL(40, 18) NOT NULL DEFAULT 0.00000000 COMMENT '提现金额';
|
||||
ALTER TABLE lease_pay_recharge_message ADD COLUMN `block_height` BIGINT NOT NULL DEFAULT 0 COMMENT '报块高度';
|
||||
ALTER TABLE lease_pay_recharge_message ADD COLUMN `from_address` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '充值来源地址(用户自己的钱包)';
|
||||
ALTER TABLE lease_pay_withdraw_message ADD COLUMN `block_height` BIGINT NOT NULL DEFAULT 0 COMMENT '报块高度';
|
||||
ALTER TABLE lease_order_item ADD COLUMN `already_pay_amount` DECIMAL(32, 18) NOT NULL DEFAULT 0.00 COMMENT '已支付总金额(每天加一)';
|
||||
ALTER TABLE lease_order_item ADD COLUMN `already_pay_real_amount` DECIMAL(32, 18) NOT NULL DEFAULT 0.00 COMMENT '已支付实际总金额';
|
||||
ALTER TABLE lease_order_item ADD COLUMN `settle_pay_real_amount` DECIMAL(32, 18) NOT NULL DEFAULT 0.00 COMMENT '当日待确认支付金额';
|
||||
ALTER TABLE lease_order_info ADD COLUMN `fee` DECIMAL(32, 8) NOT NULL DEFAULT 0.00 COMMENT '订单手续费';
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.m2pool.system.api;
|
||||
|
||||
|
||||
import com.m2pool.common.core.Result.R;
|
||||
import com.m2pool.common.core.constant.SecurityConstants;
|
||||
import com.m2pool.common.core.constant.ServiceNameConstants;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.factory.RemotePoolFallbackFactory;
|
||||
import com.m2pool.system.api.factory.RemoteUserFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
|
||||
/**
|
||||
* @Description 矿池服务
|
||||
* @Date 2026/1/5 10:15
|
||||
* @Author yyb
|
||||
*/
|
||||
@FeignClient(contextId = "remotePoolService",value = ServiceNameConstants.POOL_SERVICE,fallbackFactory = RemotePoolFallbackFactory.class)
|
||||
public interface RemotePoolService {
|
||||
|
||||
@PostMapping("/user/deleteUserDataAndPutTemporaryTable")
|
||||
R<Boolean> deleteUserDataAndPutTemporaryTable(@RequestBody SysUser sysUser,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.m2pool.system.api;
|
||||
import com.m2pool.common.core.Result.R;
|
||||
import com.m2pool.common.core.constant.SecurityConstants;
|
||||
import com.m2pool.common.core.constant.ServiceNameConstants;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.entity.SysUserLeveDate;
|
||||
import com.m2pool.system.api.factory.RemoteUserFallbackFactory;
|
||||
@@ -82,7 +83,7 @@ public interface RemoteUserService {
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/user/profile/checkGoogleCode")
|
||||
public R<Boolean> checkGoogleCode(@RequestBody Long code, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
public R<Boolean> checkGoogleCode(@RequestBody CloseAccountVo closeAccountVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
/**
|
||||
* 获取客服列表
|
||||
@@ -92,4 +93,12 @@ public interface RemoteUserService {
|
||||
@GetMapping("/user/getCSList")
|
||||
public R<List<SysUser>> getCSList();
|
||||
|
||||
/**
|
||||
* 关闭
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/user/closeAccount")
|
||||
R<Boolean> closeAccount(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.m2pool.system.api.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CloseAccountVo {
|
||||
|
||||
@Email
|
||||
private String userEmail;
|
||||
|
||||
/**
|
||||
* 谷歌验证器验证码
|
||||
*/
|
||||
@ApiModelProperty(value = "谷歌验证码",required = true)
|
||||
public long gCode;
|
||||
|
||||
/**
|
||||
* 邮箱验证码
|
||||
*/
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "邮箱验证码",required = true)
|
||||
public String eCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.m2pool.system.api.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 用户矿机在离线的数量
|
||||
* @Date 2024/6/12 16:13
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EmailTemplateEntity implements Serializable {
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 主题 */
|
||||
private String subject;
|
||||
|
||||
/** 模版名称 */
|
||||
private String templateName;
|
||||
|
||||
/** 填充到模版的数据 */
|
||||
private Map<String,Object> data;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.m2pool.system.api.factory;
|
||||
|
||||
import com.m2pool.common.core.Result.R;
|
||||
import com.m2pool.system.api.RemotePoolService;
|
||||
import com.m2pool.system.api.RemoteUserService;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.entity.SysUserLeveDate;
|
||||
import com.m2pool.system.api.model.LoginUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 矿池服务
|
||||
* @Date 2026/1/5 10:17
|
||||
* @Author yyb
|
||||
*/
|
||||
@Component
|
||||
public class RemotePoolFallbackFactory implements FallbackFactory<RemotePoolService> {
|
||||
private static final Logger log = LoggerFactory.getLogger(RemotePoolFallbackFactory.class);
|
||||
|
||||
@Override
|
||||
public RemotePoolService create(Throwable cause) {
|
||||
log.error("矿池服务调用失败:{}",cause.getMessage());
|
||||
return new RemotePoolService(){
|
||||
@Override
|
||||
public R<Boolean> deleteUserDataAndPutTemporaryTable(SysUser sysUser,String source) {
|
||||
return R.fail("注销账户失败," + cause.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.m2pool.system.api.factory;
|
||||
|
||||
import com.m2pool.common.core.Result.R;
|
||||
import com.m2pool.system.api.RemoteUserService;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.entity.SysUserLeveDate;
|
||||
import com.m2pool.system.api.model.LoginUser;
|
||||
@@ -60,7 +61,7 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Boolean> checkGoogleCode(Long code, String source) {
|
||||
public R<Boolean> checkGoogleCode(CloseAccountVo closeAccountVo, String source) {
|
||||
return R.fail("谷歌验证器校验失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@@ -69,6 +70,11 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||
return R.fail("客服列表获取失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Boolean> closeAccount(SysUser sysUser, String source) {
|
||||
return R.fail("注销用户失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
<artifactId>m2pool-auth</artifactId>
|
||||
|
||||
<description>认证模块:登录认证、权限鉴定等</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
@@ -71,6 +70,19 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.m2pool.auth;
|
||||
|
||||
import com.m2pool.common.security.annotation.EnableCustomConfig;
|
||||
import com.m2pool.common.security.annotation.EnableM2PoolFeignClients;
|
||||
import com.m2pool.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableM2PoolFeignClients
|
||||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
public class M2PoolAuthApplication{
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.common.security.auth.AuthUtil;
|
||||
import com.m2pool.common.security.service.TokenService;
|
||||
import com.m2pool.common.security.utils.SecurityUtils;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.EmailTemplateEntity;
|
||||
import com.m2pool.system.api.model.LoginUser;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -86,6 +87,10 @@ public class TokenController {
|
||||
return maliService.resetPwdCode(entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("updatePwdCode")
|
||||
public R<?> updatePwdCode()
|
||||
{
|
||||
@@ -93,6 +98,30 @@ public class TokenController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注销账户
|
||||
* @param closeAccountVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/closeAccount")
|
||||
@ApiOperation(value = "用户注销")
|
||||
@RequiresLogin
|
||||
public R<?> closeAccount(@RequestBody @Valid CloseAccountVo closeAccountVo){
|
||||
return sysLoginService.closeAccount(closeAccountVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送注销账户邮件
|
||||
* @param emailCodeVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sendCloseAccount")
|
||||
@ApiOperation(value = "发送注销用户邮箱验证码")
|
||||
public R<?> sendCloseAccount(@RequestBody @Valid GetLoginEmailCodeEntity emailCodeVo){
|
||||
return maliService.sendCloseAccount(emailCodeVo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("hello")
|
||||
public R<?> hello()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.m2pool.auth.entity.GetEmailCodeEntity;
|
||||
import com.m2pool.auth.entity.GetLoginEmailCodeEntity;
|
||||
import com.m2pool.common.core.Result.R;
|
||||
import com.m2pool.system.api.entity.EmailTemplateEntity;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
@@ -73,4 +76,19 @@ public interface MailService {
|
||||
|
||||
public R<?> updatePwdCode();
|
||||
|
||||
|
||||
/**
|
||||
* 账号注销验证码
|
||||
* @param emailCodeVo
|
||||
* @return
|
||||
*/
|
||||
R<?> sendCloseAccount(GetLoginEmailCodeEntity emailCodeVo);
|
||||
|
||||
|
||||
/**
|
||||
* 账号注销邮箱验证码 消息格式设置
|
||||
* @param to
|
||||
* @param code
|
||||
*/
|
||||
void sendCloseAccountMailMessage(String to, String code);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.m2pool.auth.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import com.m2pool.auth.entity.*;
|
||||
import com.m2pool.common.core.RedisTransKey;
|
||||
import com.m2pool.common.core.Result.R;
|
||||
@@ -11,9 +10,7 @@ import com.m2pool.common.core.constant.UserConstants;
|
||||
import com.m2pool.common.core.enums.UserStatus;
|
||||
import com.m2pool.common.core.exception.ServiceException;
|
||||
import com.m2pool.common.core.text.Convert;
|
||||
import com.m2pool.common.core.utils.DateUtils;
|
||||
import com.m2pool.common.core.utils.ServletUtils;
|
||||
import com.m2pool.common.core.utils.StringUtils;
|
||||
import com.m2pool.common.core.utils.*;
|
||||
import com.m2pool.common.core.utils.ip.IpUtils;
|
||||
import com.m2pool.common.core.utils.sign.RsaUtils;
|
||||
import com.m2pool.common.core.web.Result.AjaxResult;
|
||||
@@ -22,20 +19,21 @@ import com.m2pool.common.security.service.TokenService;
|
||||
import com.m2pool.common.security.utils.SecurityUtils;
|
||||
import com.m2pool.system.api.RemoteLogService;
|
||||
import com.m2pool.system.api.RemoteUserService;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.SysLogininfor;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.m2pool.common.core.RedisTransKey.getTokenKey;
|
||||
|
||||
|
||||
/**
|
||||
* @Description 登录校验方法
|
||||
@@ -59,7 +57,7 @@ public class SysLoginService {
|
||||
private RedisService redisService;
|
||||
|
||||
//public static String PWD_REGEX="^(?![A-Za-z0-9]+$)(?![a-z0-9\\W]+$)(?![A-Za-z\\W]+$)(?![A-Z0-9\\W]+$)[a-zA-Z0-9\\W]{8,32}$";
|
||||
public static String PWD_REGEX="^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[!@#$%^&*()./_])[A-Za-z\\d!@#$%^&*()./_]{8,32}$";
|
||||
public static String PWD_REGEX="^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\\W_])(?!.*[\\u4e00-\\u9fa5])(?!.*\\s).{8,32}$";
|
||||
|
||||
public static String EMAIL_REGEX="^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
|
||||
/**
|
||||
@@ -562,5 +560,58 @@ public class SysLoginService {
|
||||
remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
|
||||
}
|
||||
|
||||
public R<?> closeAccount(CloseAccountVo closeAccountVo){
|
||||
String email = closeAccountVo.getUserEmail();
|
||||
String emailCode = closeAccountVo.getECode();
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isBlank(email))
|
||||
{
|
||||
recordLogininfor(email, Constants.LOGIN_FAIL, "邮箱必须填写");
|
||||
throw new ServiceException("邮箱必须填写");
|
||||
}
|
||||
if(!StringUtils.isBlank(email)){
|
||||
if(!email.matches(EMAIL_REGEX)){
|
||||
throw new ServiceException("邮箱格式错误");
|
||||
}
|
||||
}else {
|
||||
throw new ServiceException("邮箱为必填项");
|
||||
}
|
||||
String closeAccountKey = RedisTransKey.getCloseAccountKey(email);
|
||||
//校验谷歌验证码和邮箱验证码
|
||||
if(redisService.hasKey(closeAccountKey)){
|
||||
Object o = redisService.getCacheObject(closeAccountKey);//user:emailCode:email
|
||||
EmailCodeEntity emailCodeEntity = JSON.parseObject(JSON.toJSONString(o), EmailCodeEntity.class);
|
||||
//验证验证码
|
||||
if(emailCode.equals(emailCodeEntity.getEmailCode())){
|
||||
//不做处理 进入后续登录流程
|
||||
}else {
|
||||
throw new ServiceException("验证码错误");
|
||||
}
|
||||
}else {
|
||||
throw new ServiceException("验证码未获取或已过期,请重新获取验证码");
|
||||
}
|
||||
R<Boolean> booleanR1 = remoteUserService.checkGoogleCode(closeAccountVo, SecurityConstants.INNER);
|
||||
if(booleanR1 == null || !booleanR1.getData()){
|
||||
throw new ServiceException("谷歌验证码错误");
|
||||
}
|
||||
|
||||
R<LoginUser> userInfo = remoteUserService.getUserInfo(SecurityUtils.getUsername(), SecurityConstants.INNER);
|
||||
if (R.FAIL == userInfo.getCode()) {
|
||||
throw new ServiceException("服务器请求失败请稍后再试");
|
||||
}
|
||||
|
||||
LoginUser loginUser = userInfo.getData();
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
sysUser.setDelFlag("2");
|
||||
|
||||
R<Boolean> booleanR = remoteUserService.closeAccount(sysUser, SecurityConstants.INNER);
|
||||
System.out.println("用户邮箱"+booleanR.getData()+"---" + booleanR.getMsg()+"--"+booleanR.getCode() );
|
||||
if (R.FAIL == booleanR.getCode()) {
|
||||
throw new ServiceException("服务器请求失败请稍后再试");
|
||||
}
|
||||
String userKey = getTokenKey(loginUser.getToken());
|
||||
redisService.deleteObject(userKey);
|
||||
return booleanR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -556,4 +556,62 @@ public class MaliServiceImpl implements MailService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public R<?> sendCloseAccount(GetLoginEmailCodeEntity emailCodeVo) {
|
||||
String email = SecurityUtils.getUsername();
|
||||
if(StringUtils.isBlank(email)){
|
||||
return R.fail("token解析失败");
|
||||
}
|
||||
//通过邮箱获取用户
|
||||
R<LoginUser> userByEmail = remoteUserService.getUserInfo(email, SecurityConstants.INNER);
|
||||
|
||||
if(StringUtils.isNull(userByEmail.getData())){
|
||||
return R.fail("token解析异常");
|
||||
}
|
||||
|
||||
//判断用户是不是恶意刷邮箱,在规定时间内进行的
|
||||
String closeAccountKey = RedisTransKey.getCloseAccountKey(email);
|
||||
System.out.println("redis 的 key"+closeAccountKey);
|
||||
if (redisService.hasKey(closeAccountKey)) {
|
||||
|
||||
Object o = redisService.getCacheObject(closeAccountKey);//user:updatePwdCode:email
|
||||
|
||||
EmailCodeEntity emailCodeEntity = JSON.parseObject(JSON.toJSONString(o), EmailCodeEntity.class);
|
||||
if (emailCodeEntity.getTimes() >= 5) {
|
||||
return R.fail("请求次数过多,请10分钟后再试");
|
||||
} else {
|
||||
//这里就不去判断两次绑定的邮箱是不是一样的了,不排除第一次输入错了邮箱的情况
|
||||
String emailCode = CodeUtils.creatCode(6);
|
||||
emailCodeEntity.setEmailCode(emailCode);
|
||||
emailCodeEntity.setTimes(emailCodeEntity.getTimes() + 1);
|
||||
long overTime = redisService.getExpire(closeAccountKey);
|
||||
redisService.setCacheObject(closeAccountKey, emailCodeEntity, overTime, TimeUnit.SECONDS
|
||||
);
|
||||
sendCloseAccountMailMessage(email, emailCodeEntity.getEmailCode());
|
||||
}
|
||||
} else {
|
||||
String emailCode = CodeUtils.creatCode(6);
|
||||
// 最多允许用户在10分钟内发送2次的邮箱验证
|
||||
// 0s倒计时后用户可以再发送验证码,但是间隔在10分钟内只能再发送1次
|
||||
EmailCodeEntity emailCodeEntity = new EmailCodeEntity(
|
||||
email, emailCode,1
|
||||
);
|
||||
//设置失效时间10分钟
|
||||
redisService.setCacheObject(closeAccountKey, emailCodeEntity,
|
||||
10L, TimeUnit.MINUTES
|
||||
);
|
||||
sendCloseAccountMailMessage(email, emailCodeEntity.getEmailCode());
|
||||
}
|
||||
return R.success("请求成功,注销账户邮箱验证码发送成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendCloseAccountMailMessage(String to, String code) {
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("code",code);
|
||||
content.put("text","You are logging out of the user account. If this is not done by you, please ignore it. The verification code is valid for 10 minutes.");
|
||||
EmailTemplateEntity entity = new EmailTemplateEntity(to,"Change password, email verification code","emailCode-en",content);
|
||||
sendHtmlMailMessage(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@ server:
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
mvc:
|
||||
pathmatch:
|
||||
matching-strategy: ant-path-matcher
|
||||
#邮箱基本配置
|
||||
mail:
|
||||
# 配置在limit_time内,用户可以发送limit次验证码
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
style="position:relative; display:inline-flex; align-items:center; justify-content:center; margin-top:2vh; width:80%; max-width:300px; height:50px; border-radius:12px; background:#ffffff; border:3px solid #651EFE;">
|
||||
<!-- 合并 th:style 属性 -->
|
||||
<span class="code-text js-code-text" data-default-code="4MKM6AX" th:text="${code}"
|
||||
style="font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-weight:800; font-size:24px; letter-spacing:0.18em; color:#111827;"></span>
|
||||
style="font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-weight:800; font-size:24px; letter-spacing:0.18em; color:#111827;margin:auto;"></span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ public class RedisTransKey {
|
||||
public static final String RedisAddCreditEmailCodeName="addCreditEmailCode";
|
||||
public static final String RedisResetPwdCodeName="restPwdCode";
|
||||
public static final String RedisUpdatePwdCodeName="updatePwdCode";
|
||||
public static final String RedisCloseAccountName="closeAccount";
|
||||
|
||||
public static String setEmailKey(String key){
|
||||
return RedisNameSpace+":"+RedisEmailCodeName+":"+key;
|
||||
@@ -39,6 +40,10 @@ public class RedisTransKey {
|
||||
return RedisNameSpace+":"+RedisAddCreditEmailCodeName+":"+key;
|
||||
}
|
||||
|
||||
public static String setCloseAccountKey(String key){
|
||||
return RedisNameSpace+":"+RedisCloseAccountName+":"+key;
|
||||
}
|
||||
|
||||
public static String getEmailKey(String key){return setEmailKey(key);}
|
||||
public static String getRootKey(String key){return setRootKey(key);}
|
||||
public static String getTokenKey(String key){return setTokenKey(key);}
|
||||
@@ -47,4 +52,8 @@ public class RedisTransKey {
|
||||
public static String getUpdatePwdKey(String key){return setUpdatePwdKey(key);}
|
||||
public static String getAddCreditEmailKey(String key){return setAddCreditEmailKey(key);}
|
||||
|
||||
public static String getCloseAccountKey(String key){return setCloseAccountKey(key);}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.m2pool.common.datasource.annotation;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 矿池数据库(只读)
|
||||
*/
|
||||
@Target({ ElementType.TYPE, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@DS("mining")
|
||||
public @interface MiningDB {
|
||||
}
|
||||
@@ -5,11 +5,19 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cache.annotation.CachingConfigurerSupport;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.script.DefaultRedisScript;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
@@ -49,7 +57,6 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||
template.afterPropertiesSet();
|
||||
return template;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DefaultRedisScript<Long> limitScript()
|
||||
{
|
||||
@@ -62,6 +69,8 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||
return redisScript;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 限流脚本
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.m2pool.common.redis.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.data.redis.core.BoundSetOperations;
|
||||
import org.springframework.data.redis.core.HashOperations;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
@@ -21,8 +22,10 @@ import java.util.concurrent.TimeUnit;
|
||||
public class RedisService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("redisTemplate")
|
||||
private RedisTemplate redisTemplate;
|
||||
|
||||
|
||||
/**
|
||||
* 缓存基本的对象,Integer、String、实体类等
|
||||
*
|
||||
@@ -34,6 +37,7 @@ public class RedisService {
|
||||
redisTemplate.opsForValue().set(key, value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 缓存基本的对象,Integer、String、实体类等
|
||||
*
|
||||
@@ -47,6 +51,8 @@ public class RedisService {
|
||||
redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置有效时间
|
||||
*
|
||||
@@ -118,6 +124,7 @@ public class RedisService {
|
||||
return operation.get(key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 所有数字类型转换为BigDecimal
|
||||
* @param key 缓存键值
|
||||
@@ -153,6 +160,7 @@ public class RedisService {
|
||||
return redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除集合对象
|
||||
*
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.m2pool.common.security.interceptor;
|
||||
|
||||
import javax.servlet.ReadListener;
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class AuthRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private String body;
|
||||
|
||||
public AuthRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
try(BufferedReader reader = request.getReader()){
|
||||
body= reader.lines().collect(Collectors.joining());
|
||||
}catch (Exception e){
|
||||
System.out.println("!!-- read request from requestbody error"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getReader() {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
final ByteArrayInputStream byteArrayIns = new ByteArrayInputStream(body.getBytes());
|
||||
ServletInputStream servletIns = new ServletInputStream() {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() {
|
||||
return byteArrayIns.read();
|
||||
}
|
||||
};
|
||||
return servletIns;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.m2pool.common.security.interceptor;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
||||
@Component
|
||||
public class CoinInterceptor implements HandlerInterceptor {
|
||||
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
System.out.println("调用Coin拦截器1:" + request);
|
||||
|
||||
// 仅处理 POST、PUT 等有请求体的请求方法
|
||||
if ("POST".equalsIgnoreCase(request.getMethod()) || "PUT".equalsIgnoreCase(request.getMethod())) {
|
||||
try {
|
||||
// 读取请求体内容
|
||||
if (request instanceof AuthRequestWrapper){
|
||||
//BufferedReader reader = request.getReader();
|
||||
//System.out.println("调用Coin拦截器2:" + reader);
|
||||
//
|
||||
//if (!requestBody.isEmpty()) {
|
||||
// // 反序列化请求体为 RequestObject 对象
|
||||
// RequestObject requestObject = objectMapper.readValue(requestBody, RequestObject.class);
|
||||
// System.out.println("调用Coin拦截器3:" + requestObject.toString());
|
||||
// String coin = requestObject.getCoin();
|
||||
// System.out.println("调用Coin拦截器4:" + coin);
|
||||
// if ("enx".equals(coin)) {
|
||||
// response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
// response.getWriter().write("enx币种已下架");
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// 处理反序列化异常
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.getWriter().write("请求体解析失败");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取请求体内容
|
||||
*/
|
||||
private String readRequestBody(HttpServletRequest request) throws IOException {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
try (BufferedReader reader = request.getReader()) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
stringBuilder.append(line);
|
||||
}
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor {
|
||||
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request,SecurityConstants.USER_KEY));
|
||||
|
||||
//开发环境
|
||||
String authorization = request.getHeader("Authorization");
|
||||
String userName = JwtUtils.getUserName(authorization);
|
||||
SecurityContextHolder.setUserName(userName);
|
||||
//String authorization = request.getHeader("Authorization");
|
||||
//String userName = JwtUtils.getUserName(authorization);
|
||||
//SecurityContextHolder.setUserName(userName);
|
||||
|
||||
String token = SecurityUtils.getToken();
|
||||
if(StringUtils.isNotEmpty(token)){
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.m2pool.common.security.interceptor;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
import org.springframework.web.util.ContentCachingRequestWrapper;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebFilter;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
@Component
|
||||
@WebFilter("/*")
|
||||
public class RequestBodyFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
||||
|
||||
request = new AuthRequestWrapper(request);
|
||||
filterChain.doFilter(request,response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.m2pool.common.security.interceptor;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class RequestObject {
|
||||
private String coin;
|
||||
|
||||
// 添加 getter 和 setter 方法
|
||||
public String getCoin() {
|
||||
return coin;
|
||||
}
|
||||
|
||||
public void setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
}
|
||||
}
|
||||
47
m2pool-gateway/src/main/resources/bootstrap-dev.yml
Normal file
47
m2pool-gateway/src/main/resources/bootstrap-dev.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
server:
|
||||
port: 8878
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: m2pool-gateway
|
||||
main:
|
||||
allow-circular-references: true
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: m2_dev
|
||||
group: m2_dev_group
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
namespace: m2_dev
|
||||
group: m2_dev_group
|
||||
sentinel:
|
||||
# 取消控制台懒加载
|
||||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:8718
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
dataId: sentinel-m2pool-gateway
|
||||
groupId: m2_dev_group
|
||||
data-type: json
|
||||
rule-type: flow
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 2MB
|
||||
max-request-size: 8MB
|
||||
@@ -78,7 +78,7 @@ public class WebsocketChannelInterceptor implements ChannelInterceptor {
|
||||
//获取链接建立时的请求头信息
|
||||
StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
|
||||
if (accessor.getCommand() == StompCommand.CONNECT ) {
|
||||
System.out.println("yyb-开始链接"+new Date());
|
||||
System.out.println("开始链接"+new Date());
|
||||
StompHeaderAccessor mha = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
|
||||
if(mha == null){
|
||||
throw new MessageDeliveryException(ExceptionEnum.fromCode(ExceptionEnum.SET_PRINCIPAL_FAIL));
|
||||
@@ -92,7 +92,7 @@ public class WebsocketChannelInterceptor implements ChannelInterceptor {
|
||||
ipLimit(accessor,type,email);
|
||||
//链接请求头中用户信息存入stomp中
|
||||
mha.setUser(new StompPrincipal(email,type,true));
|
||||
System.out.println("yyb-链接成功"+new Date());
|
||||
System.out.println("链接成功"+new Date());
|
||||
}
|
||||
if (accessor.getCommand() == StompCommand.SUBSCRIBE) {
|
||||
LOGGER.info("------------websocket subscribe message");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.m2pool.chat.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@@ -64,7 +65,6 @@ public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoom> i
|
||||
//1.查找当前客服对应的聊天室
|
||||
roomList = chatRoomMapper.findRoomList(ids,roomPageVo.getSendDateTime());
|
||||
|
||||
|
||||
// if (roomList.isEmpty()){
|
||||
// TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
// tableDataInfo.setCode(HttpStatus.ERROR);
|
||||
@@ -92,7 +92,6 @@ public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoom> i
|
||||
//1.查询当前用户与对应用户是否已存在创建的聊天室
|
||||
String userEmail = roomVo.getEmail();
|
||||
ChatRoomDto roomByUserEmail = chatRoomMapper.findRoomByUserEmail(userEmail);
|
||||
System.out.println("bby-用户邮箱"+roomByUserEmail);
|
||||
//获取nacos中配置的客服邮箱列表,这个列表中的邮箱实际可能不是客服角色,但能够行驶客服角色功能
|
||||
List<String> customerEmails = new ArrayList<>(Arrays.asList(webSocketConfig.getDefaultCustomerEmail().split(",")));
|
||||
int i = random.nextInt(customerEmails.size());
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -47,6 +48,7 @@ public class ChatTask {
|
||||
|
||||
// @Scheduled(cron = "0 0/1 * * * ?")
|
||||
@Scheduled(cron = "0 15 1 * * ?")
|
||||
@Transactional
|
||||
public void chatMessageDataSeparatedForHotAndCold(){
|
||||
if(!enable){
|
||||
System.out.println("ChatTask 定时任务已关闭,请在nacos修改配置");
|
||||
|
||||
@@ -34,11 +34,8 @@
|
||||
GROUP BY send_email
|
||||
</select>
|
||||
<select id="findRoomIdsByCustomerEmail" resultType="java.lang.Long">
|
||||
select room_id from chat_message where send_email = #{userEmail} group by room_id
|
||||
select room_id from chat_message group by room_id
|
||||
UNION
|
||||
select room_id from chat_message_history where send_email = #{userEmail} group by room_id
|
||||
UNION
|
||||
select id as room_id from chat_room where user_two_email = #{userEmail}
|
||||
select room_id from chat_message_history group by room_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</where>
|
||||
ORDER BY
|
||||
flag DESC,
|
||||
service_read_num DESC,
|
||||
GREATEST( last_user_send_time, last_customer_send_time ) DESC
|
||||
LIMIT 20
|
||||
</select>
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.m2pool.file.service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
* 接口
|
||||
*
|
||||
* @author dy
|
||||
*/
|
||||
|
||||
@@ -1,225 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>m2pool-modules</artifactId>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<version>3.5.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>m2pool-lease</artifactId>
|
||||
<dependencies>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-maven-plugin</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– Mybatis-Plus –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baomidou</groupId>-->
|
||||
<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
|
||||
<!-- <exclusions>-->
|
||||
<!-- <exclusion>-->
|
||||
<!-- <artifactId>jsqlparser</artifactId>-->
|
||||
<!-- <groupId>com.github.jsqlparser</groupId>-->
|
||||
<!-- </exclusion>-->
|
||||
<!--<!– <exclusion>–>-->
|
||||
<!--<!– <artifactId>mybatis</artifactId>–>-->
|
||||
<!--<!– <groupId>org.mybatis</groupId>–>-->
|
||||
<!--<!– </exclusion>–>-->
|
||||
<!-- </exclusions>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- M2Pool Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-datasource</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- M2Pool Common security -->
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-security</artifactId>
|
||||
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.m2pool</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- WebSocket-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.java-websocket</groupId>
|
||||
<artifactId>Java-WebSocket</artifactId>
|
||||
<version>1.3.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<!--google两步认证相关-->
|
||||
<dependency>
|
||||
<groupId>de.taimos</groupId>
|
||||
<artifactId>totp</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>javase</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>5.12.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pt.kcry</groupId>
|
||||
<artifactId>blake3_3</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<!-- 本地环境 -->
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
<spring.profile>dev</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<!-- 是否默认激活 -->
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- 测试环境 -->
|
||||
<id>test</id>
|
||||
<properties>
|
||||
<spring.profile>test</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- 生产环境 -->
|
||||
<id>prod</id>
|
||||
<properties>
|
||||
<spring.profile>prod</spring.profile>
|
||||
<nacos.server.address>127.0.0.1:8808</nacos.server.address>
|
||||
</properties>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.m2pool.lease;
|
||||
|
||||
import com.m2pool.common.security.annotation.EnableCustomConfig;
|
||||
import com.m2pool.common.security.annotation.EnableM2PoolFeignClients;
|
||||
import com.m2pool.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
//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();
|
||||
// }
|
||||
//}
|
||||
@@ -1,16 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
|
||||
public class JacksonMessageConverter extends Jackson2JsonMessageConverter {
|
||||
public JacksonMessageConverter() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object fromMessage(Message message) {
|
||||
message.getMessageProperties().setContentType("application/json");
|
||||
return super.fromMessage(message);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.m2pool.lease.config;//package com.m2pool.lease.config;
|
||||
//
|
||||
//import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import springfox.documentation.builders.ApiInfoBuilder;
|
||||
//import springfox.documentation.builders.PathSelectors;
|
||||
//import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
//import springfox.documentation.service.ApiInfo;
|
||||
//import springfox.documentation.spi.DocumentationType;
|
||||
//import springfox.documentation.spring.web.plugins.Docket;
|
||||
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
//
|
||||
//@Configuration
|
||||
//@EnableSwagger2
|
||||
//@EnableKnife4j
|
||||
//public class Knife4jConfiguration {
|
||||
//
|
||||
// @Bean
|
||||
// public Docket createRestApi() {
|
||||
// return new Docket(DocumentationType.SWAGGER_2)
|
||||
// .useDefaultResponseMessages(false)
|
||||
// .apiInfo(apiInfo())
|
||||
// .select()
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.m2pool.lease.controller"))
|
||||
// .paths(PathSelectors.any())
|
||||
// .build();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private ApiInfo apiInfo() {
|
||||
// return new ApiInfoBuilder()
|
||||
// .description("Kinfe4j 集成测试文档")
|
||||
// .version("v1.0.0")
|
||||
// .title("API测试文档")
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
//}
|
||||
//
|
||||
@@ -1,289 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
|
||||
import org.springframework.amqp.core.*;
|
||||
import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.m2pool.lease.constant.RabbitmqConstant.*;
|
||||
|
||||
@Configuration
|
||||
public class RabbitMQConfig {
|
||||
|
||||
@Bean
|
||||
public MessageConverter jackson2JsonMessageConverter() {
|
||||
//自动生成消息唯一id
|
||||
//jackson2JsonMessageConverter.setCreateMessageIds(true);
|
||||
return new JacksonMessageConverter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
|
||||
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
|
||||
rabbitTemplate.setMessageConverter(jackson2JsonMessageConverter());
|
||||
|
||||
//// 自定义 MessagePostProcessor 来设置 content-type
|
||||
//rabbitTemplate.setBeforePublishPostProcessors(new MessagePostProcessor() {
|
||||
// @Override
|
||||
// public Message postProcessMessage(Message message) {
|
||||
// // 设置 content-type 为 application/json
|
||||
// message.getMessageProperties().setContentType("application/json");
|
||||
// return message;
|
||||
// }
|
||||
//});
|
||||
// 开启发布确认模式
|
||||
rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> {
|
||||
if (ack) {
|
||||
System.out.println("消息发送成功,correlationData: " + correlationData);
|
||||
} else {
|
||||
System.out.println("消息发送失败,原因: " + cause);
|
||||
// 这里可以添加将失败消息存储到数据库的逻辑
|
||||
}
|
||||
});
|
||||
rabbitTemplate.setMandatory(true);
|
||||
return rabbitTemplate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public SimpleRabbitListenerContainerFactory rabbitListenerContainerFactory(ConnectionFactory connectionFactory) {
|
||||
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||
factory.setConnectionFactory(connectionFactory);
|
||||
//消费者序列化
|
||||
factory.setMessageConverter(jackson2JsonMessageConverter());
|
||||
factory.setConcurrentConsumers(3); // 设置初始消费者数量
|
||||
factory.setMaxConcurrentConsumers(5); // 设置最大消费者数量
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 矿池代理队列
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue poolProxyQueue() {
|
||||
// durable 设置为 true 表示队列持久化
|
||||
return new Queue(POOL_PROXY_QUEUE_NAME, true);
|
||||
}
|
||||
|
||||
//----------------定义订单延迟队列------------------------
|
||||
|
||||
/**
|
||||
* 死信 交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange deadLetterExchange() {
|
||||
return new DirectExchange(DEAD_LETTER_EXCHANGE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 死信 队列
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue deadLetterQueue() {
|
||||
return new Queue(DEAD_LETTER_QUEUE_NAME, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 死信 队列绑定死信交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding deadLetterBinding() {
|
||||
return BindingBuilder.bind(deadLetterQueue()).to(deadLetterExchange()).with(DEAD_LETTER_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange orderOvertimeExchange() {
|
||||
return new DirectExchange(ORDER_OVERTIME_EXCHANGE_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 队列 (死信交换机达成延迟队列功能)
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Queue orderOvertimeQueue() {
|
||||
Map<String, Object> args = new HashMap<>();
|
||||
// 设置死信交换机
|
||||
args.put("x-dead-letter-exchange", DEAD_LETTER_EXCHANGE_NAME);
|
||||
// 设置死信路由键
|
||||
args.put("x-dead-letter-routing-key", DEAD_LETTER_ROUTING_KEY);
|
||||
// 设置队列中消息的 TTL(单位:毫秒)
|
||||
args.put("x-message-ttl", 900000);
|
||||
return new Queue(ORDER_OVERTIME_QUEUE_NAME, true, false, false, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单超时消息 队列绑定普通交换机
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding orderOvertimeBinding() {
|
||||
return BindingBuilder.bind(orderOvertimeQueue()).to(orderOvertimeExchange()).with(ORDER_OVERTIME_ROUTING_KEY);
|
||||
}
|
||||
|
||||
//----------------定义订单延迟队列------------------------
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
/**
|
||||
* 声明 Topic 类型的交换机
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange payExchange() {
|
||||
return new DirectExchange(PAY_EXCHANGE);
|
||||
}
|
||||
|
||||
// 支付相关队列声明
|
||||
/**
|
||||
* 声明支付消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payAutoQueue() {
|
||||
return new Queue(PAY_AUTO_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明支付返回消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payAutoReturnQueue() {
|
||||
return new Queue(PAY_AUTO_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 余额充值相关队列声明
|
||||
/**
|
||||
* 声明余额充值消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payRechargeQueue() {
|
||||
return new Queue(PAY_RECHARGE_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明余额充值返回信息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payRechargeReturnQueue() {
|
||||
return new Queue(PAY_RECHARGE_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 余额提现相关队列声明
|
||||
/**
|
||||
* 声明余额提现消息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payWithdrawQueue() {
|
||||
return new Queue(PAY_WITHDRAW_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 声明余额提现返回信息队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue payWithdrawReturnQueue() {
|
||||
return new Queue(PAY_WITHDRAW_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
// 支付相关绑定
|
||||
/**
|
||||
* 将支付消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payAutoBinding() {
|
||||
return BindingBuilder.bind(payAutoQueue()).to(payExchange()).with(PAY_AUTO_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将支付返回消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payAutoReturnBinding() {
|
||||
return BindingBuilder.bind(payAutoReturnQueue()).to(payExchange()).with(PAY_AUTO_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
// 余额充值相关绑定
|
||||
/**
|
||||
* 将余额充值消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payRechargeBinding() {
|
||||
return BindingBuilder.bind(payRechargeQueue()).to(payExchange()).with(PAY_RECHARGE_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将余额充值返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payRechargeReturnBinding() {
|
||||
return BindingBuilder.bind(payRechargeReturnQueue()).to(payExchange()).with(PAY_RECHARGE_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
// 余额提现相关绑定
|
||||
/**
|
||||
* 将余额提现消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payWithdrawBinding() {
|
||||
return BindingBuilder.bind(payWithdrawQueue()).to(payExchange()).with(PAY_WITHDRAW_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将余额提现返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding payWithdrawReturnBinding() {
|
||||
return BindingBuilder.bind(payWithdrawReturnQueue()).to(payExchange()).with(PAY_WITHDRAW_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//钱包删除 提现相关绑定
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue deleteWalletReturnQueue() {
|
||||
return new Queue(DELETE_WALLET_RETURN_QUEUE, true);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue deleteWalletQueue() {
|
||||
return new Queue(DELETE_WALLET_QUEUE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将钱包删除消息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding deleteWalletBinding() {
|
||||
return BindingBuilder.bind(deleteWalletQueue()).to(payExchange()).with(DELETE_WALLET_ROUTING_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将钱包删除返回信息队列绑定到交换机
|
||||
*/
|
||||
@Bean
|
||||
public Binding deleteWalletReturnBinding() {
|
||||
return BindingBuilder.bind(deleteWalletReturnQueue()).to(payExchange()).with(DELETE_WALLET_RETURN_ROUTING_KEY);
|
||||
}
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.m2pool.lease.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean(name = "customThreadPool")
|
||||
public ThreadPoolTaskExecutor customTaskThreadPool() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程数
|
||||
executor.setCorePoolSize(5);
|
||||
// 最大线程数
|
||||
executor.setMaxPoolSize(10);
|
||||
// 队列容量
|
||||
executor.setQueueCapacity(50);
|
||||
// 线程空闲时间(秒)
|
||||
executor.setKeepAliveSeconds(30);
|
||||
// 线程名前缀
|
||||
executor.setThreadNamePrefix("custom-task-thread-");
|
||||
// 拒绝策略
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
//package com.m2pool.lease.config;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.web.servlet.config.annotation.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相关路径
|
||||
// }
|
||||
//}
|
||||
@@ -1,106 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import com.m2pool.common.core.utils.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 币种算法
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class Algorithm {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 出块间隔数
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class BlockInterval {
|
||||
// GRS 出块间隔时间单位s
|
||||
public static final BigDecimal GRS_BLOCK_INTERVAL = BigDecimal.valueOf(60);
|
||||
// Mona 出块间隔时间单位s
|
||||
public static final BigDecimal MONA_BLOCK_INTERVAL = BigDecimal.valueOf(90);
|
||||
// NEXA 出块间隔时间单位s
|
||||
public static final BigDecimal NEXA_BLOCK_INTERVAL = BigDecimal.valueOf(120);
|
||||
// RXD 出块间隔时间单位s
|
||||
public static final BigDecimal RXD_BLOCK_INTERVAL= BigDecimal.valueOf(300);
|
||||
|
||||
private static final Map<String, BigDecimal> BLOCK_MAP;
|
||||
|
||||
static {
|
||||
HashMap<String, BigDecimal> map = new HashMap<>();
|
||||
map.put("grs", GRS_BLOCK_INTERVAL);
|
||||
map.put("mona", MONA_BLOCK_INTERVAL);
|
||||
map.put("nexa", NEXA_BLOCK_INTERVAL);
|
||||
map.put("rxd", RXD_BLOCK_INTERVAL);
|
||||
BLOCK_MAP = Collections.unmodifiableMap(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名称获取对应的每日理论出块数
|
||||
* @param coinName 币种名称,不区分大小写
|
||||
* @return 对应的每日理论出块数,如果未找到则返回 null
|
||||
*/
|
||||
public static BigDecimal getBlockCountByCoinName(String coinName) {
|
||||
if (coinName == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return BLOCK_MAP.get(coinName.toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DailyBlockOutputConstant {
|
||||
// GRS 每日理论出块数常量
|
||||
public static final BigDecimal GRS_BLOCK = BigDecimal.valueOf(1440);
|
||||
// Mona 每日理论出块数常量
|
||||
public static final BigDecimal MONA_BLOCK = BigDecimal.valueOf(960);
|
||||
// DGBS 每日理论出块数常量
|
||||
public static final BigDecimal DGBS_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGBQ 每日理论出块数常量
|
||||
public static final BigDecimal DGBQ_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGBO 每日理论出块数常量
|
||||
public static final BigDecimal DGBO_BLOCK = BigDecimal.valueOf(1180);
|
||||
// DGB2_ODO 每日理论出块数常量
|
||||
public static final BigDecimal DGB2_ODO_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_QUBIT_A10 每日理论出块数常量
|
||||
public static final BigDecimal DGB_QUBIT_A10_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_SKEIN_A10 每日理论出块数常量
|
||||
public static final BigDecimal DGB_SKEIN_A10_BLOCK = BigDecimal.valueOf(720);
|
||||
// DGB_ODO_B20 每日理论出块数常量
|
||||
public static final BigDecimal DGB_ODO_B20_BLOCK = BigDecimal.valueOf(720);
|
||||
// NEXA 每日理论出块数常量
|
||||
public static final BigDecimal NEXA_BLOCK = BigDecimal.valueOf(720);
|
||||
// RXD 每日理论出块数常量
|
||||
public static final BigDecimal RXD_BLOCK = BigDecimal.valueOf(288);
|
||||
// ALPH 每日理论出块数常量
|
||||
public static final BigDecimal ALPH_BLOCK = BigDecimal.valueOf(5400);
|
||||
// ENX 每日理论出块数常量
|
||||
public static final BigDecimal ENX_BLOCK = BigDecimal.valueOf(86400);
|
||||
|
||||
private static final Map<String, BigDecimal> BLOCK_MAP;
|
||||
|
||||
static {
|
||||
BLOCK_MAP = new HashMap<>();
|
||||
BLOCK_MAP.put("grs", GRS_BLOCK);
|
||||
BLOCK_MAP.put("mona", MONA_BLOCK);
|
||||
BLOCK_MAP.put("dgbs", DGBS_BLOCK);
|
||||
BLOCK_MAP.put("dgbq", DGBQ_BLOCK);
|
||||
BLOCK_MAP.put("dgbo", DGBO_BLOCK);
|
||||
BLOCK_MAP.put("dgb2_odo", DGB2_ODO_BLOCK);
|
||||
BLOCK_MAP.put("dgb_qubit_a10", DGB_QUBIT_A10_BLOCK);
|
||||
BLOCK_MAP.put("dgb_skein_a10", DGB_SKEIN_A10_BLOCK);
|
||||
BLOCK_MAP.put("dgb_odo_b20", DGB_ODO_B20_BLOCK);
|
||||
BLOCK_MAP.put("nexa", NEXA_BLOCK);
|
||||
BLOCK_MAP.put("rxd", RXD_BLOCK);
|
||||
BLOCK_MAP.put("alph", ALPH_BLOCK);
|
||||
BLOCK_MAP.put("enx", ENX_BLOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据币种名称获取对应的每日理论出块数
|
||||
* @param coinName 币种名称,不区分大小写
|
||||
* @return 对应的每日理论出块数,如果未找到则返回 null
|
||||
*/
|
||||
public static BigDecimal getBlockCountByCoinName(String coinName) {
|
||||
if (coinName == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return BLOCK_MAP.get(coinName.toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 普通订单状态
|
||||
* @Date 2025/9/3 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public enum OrderStatus {
|
||||
PENDING_PAYMENT(0, "待支付"),
|
||||
FULLY_PAID(1, "(全部)已支付"),
|
||||
CANCELLED(2, "已取消"),
|
||||
AFTER_SALES(3, "售后状态"),
|
||||
REFUNDED(4, "已退款"),
|
||||
PAYMENT_TIMEOUT(5, "支付已超时"),
|
||||
PAYMENT_IN_PROGRESS(6, "支付中"),
|
||||
PARTIALLY_PAID(10, "部分已支付");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
OrderStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态编码
|
||||
* @return 订单状态编码
|
||||
*/
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单状态描述
|
||||
* @return 订单状态描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码获取对应的订单状态枚举
|
||||
* @param code 订单状态编码
|
||||
* @return 订单状态枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static OrderStatus getByCode(int code) {
|
||||
for (OrderStatus status : OrderStatus.values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 支付订单状态
|
||||
* @Date 2025/9/3 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public enum PaymentStatus {
|
||||
PAYMENT_FAILED(0, "支付失败"),
|
||||
PAYMENT_SUCCESS_FULL(1, "支付成功--全部货款已支付"),
|
||||
PENDING_PAYMENT(2, "待支付"),
|
||||
PAYMENT_TIMEOUT(5, "支付已超时"),
|
||||
PAYMENT_IN_PROGRESS(6, "支付中"),
|
||||
PAYMENT_SUCCESS_PARTIAL(10, "支付成功--已支付部分货款");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
PaymentStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付状态编码
|
||||
* @return 支付状态编码
|
||||
*/
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付状态描述
|
||||
* @return 支付状态描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码获取对应的支付状态枚举
|
||||
* @param code 支付状态编码
|
||||
* @return 支付状态枚举,如果未找到则返回 null
|
||||
*/
|
||||
public static PaymentStatus getByCode(int code) {
|
||||
for (PaymentStatus status : PaymentStatus.values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description 单位换算
|
||||
* @Date 2025/8/18 16:19
|
||||
* @Author yyb
|
||||
*/
|
||||
public class PowerUnit {
|
||||
|
||||
public static final String KH_UNIT = "KH/S";
|
||||
|
||||
public static final String MH_UNIT = "MH/S";
|
||||
|
||||
public static final String GH_UNIT = "GH/S";
|
||||
|
||||
public static final String TH_UNIT = "TH/S";
|
||||
|
||||
public static final String PH_UNIT = "PH/S";
|
||||
|
||||
private static final Map<String, BigDecimal> UNIT_MAP;
|
||||
|
||||
static {
|
||||
HashMap<String, BigDecimal> map = new HashMap<>();
|
||||
map.put(KH_UNIT, BigDecimal.valueOf(1000));
|
||||
map.put(MH_UNIT, BigDecimal.valueOf(1000 * 1000));
|
||||
map.put(GH_UNIT, BigDecimal.valueOf(1000L * 1000 * 1000 * 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);
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 常量信息
|
||||
* @Date 2024/6/11 18:13
|
||||
* @Author dy
|
||||
*/
|
||||
public class RabbitmqConstant {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 矿池代理消息队列
|
||||
*/
|
||||
public static final String POOL_PROXY_QUEUE_NAME = "pool.proxy.queue";
|
||||
|
||||
/**
|
||||
* 矿池代理消息correlationData(用于生成者手动ack)
|
||||
*/
|
||||
public static final String POOL_PROXY_CORRELATION = "pool.proxy.message";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 订单超时消息 交换机
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_EXCHANGE_NAME = "order.overtime.exchange";
|
||||
|
||||
/**
|
||||
* 订单超时消息 路由键
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_ROUTING_KEY = "order.overtime.routing.key";
|
||||
/**
|
||||
*
|
||||
* 订单超时消息 队列
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_QUEUE_NAME = "order.overtime.queue";
|
||||
/**
|
||||
* 订单超时消息correlationData(用于生成者手动ack)
|
||||
*/
|
||||
public static final String ORDER_OVERTIME_CORRELATION= "order.overtime.message";
|
||||
|
||||
/**
|
||||
* 死信 队列
|
||||
*/
|
||||
public static final String DEAD_LETTER_QUEUE_NAME = "dead.letter.queue";
|
||||
/**
|
||||
* 死信 交换机
|
||||
*/
|
||||
public static final String DEAD_LETTER_EXCHANGE_NAME = "dead.letter.exchange";
|
||||
/**
|
||||
* 死信 路由键
|
||||
*/
|
||||
public static final String DEAD_LETTER_ROUTING_KEY = "dead.letter.routing.key";
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
|
||||
/**
|
||||
* 支付模块 交换机
|
||||
*/
|
||||
public static final String PAY_EXCHANGE = "pay.exchange";
|
||||
|
||||
|
||||
/**
|
||||
* 支付 消息队列
|
||||
*/
|
||||
public static final String PAY_AUTO_QUEUE = "pay.auto.queue";
|
||||
|
||||
/**
|
||||
* 支付 路由键
|
||||
*/
|
||||
public static final String PAY_AUTO_ROUTING_KEY = "pay.auto.routing.key";
|
||||
|
||||
/**
|
||||
* 支付 返回消息消息队列
|
||||
*/
|
||||
public static final String PAY_AUTO_RETURN_QUEUE = "pay.auto.return.queue";
|
||||
|
||||
/**
|
||||
* 支付 返回消息路由键
|
||||
*/
|
||||
public static final String PAY_AUTO_RETURN_ROUTING_KEY = "pay.auto.return.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 余额充值 消息队列
|
||||
*/
|
||||
public static final String PAY_RECHARGE_QUEUE = "pay.recharge.queue";
|
||||
|
||||
/**
|
||||
* 余额充值 路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_RECHARGE_ROUTING_KEY = "pay.recharge.routing.key";
|
||||
|
||||
/**
|
||||
* 余额充值 返回信息消息队列
|
||||
*/
|
||||
public static final String PAY_RECHARGE_RETURN_QUEUE = "pay.recharge.return.queue";
|
||||
|
||||
/**
|
||||
* 余额充值 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_RECHARGE_RETURN_ROUTING_KEY = "pay.recharge.return.routing.key";
|
||||
/**
|
||||
* 余额提现 消息队列
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_QUEUE = "pay.withdraw.queue";
|
||||
|
||||
/**
|
||||
* 余额提现 路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_ROUTING_KEY = "pay.withdraw.routing.key";
|
||||
|
||||
/**
|
||||
* 余额提现 返回信息消息队列
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_RETURN_QUEUE = "pay.withdraw.return.queue";
|
||||
/**
|
||||
* 余额提现 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String PAY_WITHDRAW_RETURN_ROUTING_KEY = "pay.withdraw.return.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 钱包删除 信息消息队列
|
||||
*/
|
||||
public static final String DELETE_WALLET_QUEUE = "pay.remove.queue";
|
||||
/**
|
||||
* 钱包删除 信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String DELETE_WALLET_ROUTING_KEY = "pay.remove.routing.key";
|
||||
|
||||
|
||||
/**
|
||||
* 钱包删除 返回信息消息队列
|
||||
*/
|
||||
public static final String DELETE_WALLET_RETURN_QUEUE = "pay.remove.return.queue";
|
||||
/**
|
||||
* 钱包删除 返回信息路由键
|
||||
*
|
||||
*/
|
||||
public static final String DELETE_WALLET_RETURN_ROUTING_KEY = "pay.remove.return.routing.key";
|
||||
|
||||
|
||||
//----------------定义支付相关队列------------------------
|
||||
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.m2pool.lease.constant;
|
||||
|
||||
/**
|
||||
* @Description 常量信息
|
||||
* @Date 2024/6/11 18:13
|
||||
* @Author dy
|
||||
*/
|
||||
public class ResponseConstant {
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
public static final Integer SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
public static final Integer FAIL = 500;
|
||||
|
||||
/**
|
||||
* 登录成功状态
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS_STATUS = "0";
|
||||
|
||||
/**
|
||||
* 登录失败状态
|
||||
*/
|
||||
public static final String LOGIN_FAIL_STATUS = "1";
|
||||
|
||||
/**
|
||||
* 登录成功
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS = "Success";
|
||||
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public static final String LOGOUT = "Logout";
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public static final String REGISTER = "Register";
|
||||
|
||||
/**
|
||||
* 登录失败
|
||||
*/
|
||||
public static final String LOGIN_FAIL = "Error";
|
||||
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 验证码 redis key
|
||||
*/
|
||||
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
||||
|
||||
/**
|
||||
* 验证码有效期(分钟)
|
||||
*/
|
||||
public static final long CAPTCHA_EXPIRATION = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 参数管理 cache key
|
||||
*/
|
||||
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
public static final String RESOURCE_PREFIX = "/profile";
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
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 {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
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 {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.m2pool.lease.controller;
|
||||
|
||||
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.lease.dto.PaymentCallbackDto;
|
||||
import com.m2pool.lease.dto.PaymentRecordDto;
|
||||
import com.m2pool.lease.dto.Result;
|
||||
import com.m2pool.lease.service.LeasePaymentRecordService;
|
||||
import com.m2pool.lease.vo.CheckPayStatusVo;
|
||||
import com.m2pool.lease.vo.OrderVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Api(tags = "支付记录控制器")
|
||||
@RestController
|
||||
@RequestMapping("/payment/record")
|
||||
public class LeasePaymentRecordController {
|
||||
|
||||
@Resource
|
||||
private LeasePaymentRecordService leasePaymentRecordService;
|
||||
|
||||
@ApiOperation("根据订单详情信息生成 支付订单 + 根据返回的集合生成多个支付二维码")
|
||||
@PostMapping("/addPayOrder")
|
||||
@Deprecated
|
||||
public Result<List<PaymentRecordDto>> addPayOrder(@RequestBody OrderVo orderVo) {
|
||||
return leasePaymentRecordService.addPayOrder(orderVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据订单id找到支付订单")
|
||||
@PostMapping("/getPayOrderByOrderId")
|
||||
public Result<List<PaymentRecordDto>> getPayOrderByOrderId(@RequestBody OrderVo orderVo) {
|
||||
return leasePaymentRecordService.getPayOrderByOrderId(orderVo);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("支付回调结果---根据订单id批量校验本次支付是否成功")
|
||||
@PostMapping("/paymentCallbackBatch")
|
||||
@Deprecated
|
||||
public Result<List<PaymentCallbackDto>> paymentCallbackBatch(@RequestBody List<CheckPayStatusVo> checkPayStatusVoList) {
|
||||
return leasePaymentRecordService.paymentCallbackBatch(checkPayStatusVoList);
|
||||
}
|
||||
|
||||
@ApiOperation("支付回调结果----根据支付id校验支付是否成功")
|
||||
@PostMapping("/paymentCallbackByPayId")
|
||||
@Deprecated
|
||||
public Result<PaymentCallbackDto> paymentCallbackByPayId(@RequestBody CheckPayStatusVo checkPayStatusVo) {
|
||||
return leasePaymentRecordService.paymentCallbackByPayId(checkPayStatusVo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
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);
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(description = "链(一级) 下拉列表返回对象",value = "ChainListDto")
|
||||
public class ChainListDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "链名value")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "地址")
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = "联名标签")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "币(二级) 下拉列表")
|
||||
private List<CoinListDto> children;
|
||||
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币(二级) 下拉列表返回对象",value = "CoinListDto")
|
||||
public static class CoinListDto{
|
||||
@ApiModelProperty(value = "币种value")
|
||||
private String value;
|
||||
|
||||
@ApiModelProperty(value = "币种label")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "币种是否绑定(只用于卖家钱包绑定页面相关接口) 0 未绑定 1 已绑定")
|
||||
private Integer hasBind;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.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;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CheckAddressDto {
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String fromAddress;
|
||||
|
||||
private String fromChain;
|
||||
|
||||
private String fromSymbol;
|
||||
/**
|
||||
* 半年内是否有操作
|
||||
*/
|
||||
private String hasOperator;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CoinFullDto {
|
||||
|
||||
private String chainValue;
|
||||
|
||||
private String chainLabel;
|
||||
|
||||
|
||||
private String coinValue;
|
||||
|
||||
private String coinLabel;
|
||||
|
||||
private Integer hasBind;
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付订单返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "已支付和理论支付总金额返回对象",value = "HasPayTotalDto")
|
||||
public class HasPayTotalDto {
|
||||
|
||||
|
||||
/**
|
||||
* 理论支付金额
|
||||
*/
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
private BigDecimal totalRealAmount;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description 币种实时收益实体类
|
||||
* @Date 2024/6/14 15:57
|
||||
* @Author dy
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HourIncomeDto{
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工编号
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 挖矿收益nexa 币
|
||||
*/
|
||||
private BigDecimal income;
|
||||
|
||||
/**
|
||||
* 挖矿收益 稳定币usdt
|
||||
*/
|
||||
private BigDecimal usdtIncome;
|
||||
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 已售商品矿工实时算力表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-25
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MachinePowerDto{
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 挖矿账户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 矿工
|
||||
*/
|
||||
private String miner;
|
||||
|
||||
/**
|
||||
* 记录时间(每五分钟整点)
|
||||
*/
|
||||
private LocalDateTime date;
|
||||
|
||||
/**
|
||||
* 五分钟一次的矿工矿机算力
|
||||
*/
|
||||
private BigDecimal accepts;
|
||||
|
||||
/**
|
||||
* 矿机在离线状态 离线offline 在线online
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 实际记录时间
|
||||
*/
|
||||
private LocalDateTime lastSubmit;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单详情返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单详情返回对象",value = "OrderInfoDto")
|
||||
public class OrderInfoDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
/**
|
||||
* 订单总价
|
||||
*/
|
||||
@ApiModelProperty(value = "订单总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
///**
|
||||
// * 收货地址
|
||||
// */
|
||||
//private String address;
|
||||
|
||||
/**
|
||||
* 订单状态 0待付款 1待发货 2待收货 3待评价 4已完成 5取消订单
|
||||
*/
|
||||
@ApiModelProperty(value = "订单状态 7 订单进行中 8 订单已完成")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
// ---------------------------------------------- 一个普通订单对应一个支付订单(多个封装下面四个字段为一个对象,并返回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;
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单列表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单列表返回对象",value = "LeaseOrderItemDto")
|
||||
public class OrderItemDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品 ID")
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 机器id
|
||||
*/
|
||||
@ApiModelProperty(value = "机器id")
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 商品租期天数
|
||||
*/
|
||||
@ApiModelProperty(value = "商品租期天数")
|
||||
private Integer leaseTime;
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String name;
|
||||
/**
|
||||
* 商品图片路径
|
||||
*/
|
||||
@ApiModelProperty(value = "商品图片路径")
|
||||
private String image;
|
||||
|
||||
|
||||
/**
|
||||
* 收货地址(模拟)
|
||||
*/
|
||||
@ApiModelProperty(value = "收货地址(模拟)")
|
||||
private String address;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "机器单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 支付币种
|
||||
*/
|
||||
@ApiModelProperty(value = "支付币种")
|
||||
private String payCoin;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 订单状态修改返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "订单状态修改返回对象",value = "OrderStatusDto")
|
||||
public class OrderStatusDto {
|
||||
|
||||
/**
|
||||
* 订单 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单 ID")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "订单主表状态")
|
||||
private Integer orderInfoStatus;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.m2pool.lease.constant.ResponseConstant;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.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;
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付订单返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付订单返回对象",value = "PayOrderDto")
|
||||
public class PayOrderDto {
|
||||
|
||||
/**
|
||||
* 支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd")
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址")
|
||||
private String payAddress;
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 充值记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "余额充值返回对象",value = "PayRechargeMessageDto" )
|
||||
public class PayRechargeMessageDto {
|
||||
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "充值地址(官方自动生成绑定地址)")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "充值金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@ApiModelProperty(value = "充值到账时间)")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 0 充值失败 1 充值成功 2 充值中
|
||||
*/
|
||||
@ApiModelProperty(value = "充值状态 0 充值失败 1 充值成功 2 充值中 3 校验失败")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付消息记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付返回对象",value = "PayRecordMessageDto" )
|
||||
public class PayRecordMessageDto {
|
||||
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@ApiModelProperty(value = "消息ID")
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 买家充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 卖家地址(卖家自定义地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "收款地址(卖家自定义地址)")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "理论支付支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
*实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)
|
||||
*/
|
||||
@ApiModelProperty(value = "实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)")
|
||||
private BigDecimal realAmount;
|
||||
/**
|
||||
* 卖家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "收款钱包币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 卖家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "收款钱包链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 买家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 买家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "支付成功/失败/证书校验失败时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 等待校验 3 证书校验失败
|
||||
*/
|
||||
@ApiModelProperty(value = "支付状态 0 支付失败 1 支付成功 2 待校验 3 校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 余额提现返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "余额提现返回对象",value = "PayWithdrawMessageDto" )
|
||||
public class PayWithdrawMessageDto {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 用户充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "用户充值地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 提现地址(用户自定义)
|
||||
*/
|
||||
@ApiModelProperty(value = "提现地址(用户自定义)")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "提现金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 币种
|
||||
*/
|
||||
@ApiModelProperty(value = "币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 充值时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提现时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "提现完成时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 支付失败 1 支付成功 2 支付中
|
||||
*/
|
||||
@ApiModelProperty(value = "记录状态 提现业务: 0 提现失败 1 提现成功 2 提现中 3 校验失败")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付回调结果返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付回调结果返回对象",value = "PaymentCallbackDto")
|
||||
public class PaymentCallbackDto {
|
||||
|
||||
@ApiModelProperty(value = "本次支付是否支付完成 ---- 支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 10支付成功--已支付部分货款 ")
|
||||
private int isPayAll;
|
||||
|
||||
@ApiModelProperty(value = "剩余未支付的金额")
|
||||
private BigDecimal noPayAmount;
|
||||
|
||||
@ApiModelProperty(value = "需要支付的总金额 = payAmount + noPayAmount")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@ApiModelProperty(value = "已支付的金额(从卖方钱包交易记录中获取的)")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@ApiModelProperty(value = "卖方二维码图片(如果支付状态为 1 则不再返回该字段)")
|
||||
private String img;
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付记录返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "支付记录返回对象",value = "PaymentRecordDto")
|
||||
public class PaymentRecordDto {
|
||||
|
||||
/**
|
||||
* 支付记录 ID
|
||||
*/
|
||||
@ApiModelProperty(value = "支付记录 ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd
|
||||
*/
|
||||
@ApiModelProperty(value = "支付方式,nexa rxd dgbo dgbq dgbs alph enx grs mona usdt usdc busd")
|
||||
private String payCoin;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 支付状态0支付失败 1支付成并验证 2待支付 10表示支付成功未验证
|
||||
*/
|
||||
@ApiModelProperty(value = "支付状态0支付失败 1支付成功--全部货款已支付 2待支付 5支付已超时 6 支付中( 目前只有这三种状态 7 订单进行中 8 订单已完成 9 余额不足,订单已取消) 10支付成功--已支付部分货款")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址(卖方)")
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "二维码图片")
|
||||
private String img;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 价格范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "价格范围返回对象",value = "PriceDto" )
|
||||
public class PriceDto {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer totalMachineNumber;
|
||||
|
||||
@ApiModelProperty(value = "价格最大值")
|
||||
private BigDecimal priceMax;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "价格最小值")
|
||||
private BigDecimal priceMin;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品返回对象",value = "ProductDto" )
|
||||
public class ProductDto {
|
||||
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String 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;
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商品对应实际商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商品对应实际商品返回对象",value = "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;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "商城商城矿机返回对象",value = "ProductMachineInfoDto" )
|
||||
public class ProductMachineInfoDto {
|
||||
|
||||
@ApiModelProperty(value = "商品支持的支付地址")
|
||||
private List<PayConfigDto> payConfigList;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "矿机范围及矿机详情返回对象")
|
||||
private List<ProductMachineRangeInfoDto> machineRangeInfoList;
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeDto" )
|
||||
public class ProductMachineRangeDto {
|
||||
|
||||
@ApiModelProperty(value = "功耗范围")
|
||||
private String powerRange;
|
||||
|
||||
@ApiModelProperty(value = "理论算力范围")
|
||||
private String theoryPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "实际算力范围")
|
||||
private String computingPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "实际单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "商品对应的出售矿机")
|
||||
List<ProductMachineDto> productMachines;
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeGroupDto" )
|
||||
public class ProductMachineRangeGroupDto {
|
||||
|
||||
@ApiModelProperty(value = "唯一标识")
|
||||
private Integer onlyKey;
|
||||
|
||||
@ApiModelProperty(value = "功耗范围")
|
||||
private String powerRange;
|
||||
|
||||
@ApiModelProperty(value = "理论算力范围")
|
||||
private String theoryPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "实际算力范围")
|
||||
private String computingPowerRange;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private Integer number;
|
||||
|
||||
@ApiModelProperty(value = "实际单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "算力单位")
|
||||
private String unit;
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 机器范围返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "机器范围返回对象",value = "ProductMachineRangeInfoDto" )
|
||||
public class ProductMachineRangeInfoDto {
|
||||
|
||||
@ApiModelProperty(value = "商城商品详情---价格分组对象")
|
||||
private ProductMachineRangeGroupDto productMachineRangeGroupDto;
|
||||
|
||||
@ApiModelProperty(value = "价格分组下对应的商品矿机")
|
||||
private List<ProductMachineDto> productMachines;
|
||||
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 二维码
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "二维码",value = "QrCodeDto")
|
||||
public class QrCodeDto {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 支付地址
|
||||
*/
|
||||
@ApiModelProperty(value = "支付地址(卖方)")
|
||||
private String payAddress;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 最近交易返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "最近交易返回对象",value = "RecentlyTransactionDto" )
|
||||
public class RecentlyTransactionDto {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "交易金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
@ApiModelProperty(value = "交易类型 0 支付 1 充值 2 提现")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 交易完成时间
|
||||
*/
|
||||
@ApiModelProperty(value = "交易完成时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "交易状态 0 失败 1 成功 2 充值/提现/支付中 3校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.constant.ResponseConstant;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 响应对象封装类
|
||||
* @Date 2024/6/11 9:18
|
||||
* @Author yyb
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 3276842119125241681L;
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = ResponseConstant.SUCCESS;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = ResponseConstant.FAIL;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> success()
|
||||
{
|
||||
return restResult(null, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data)
|
||||
{
|
||||
return restResult(data, SUCCESS, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data, String msg)
|
||||
{
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail()
|
||||
{
|
||||
return restResult(null, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(String msg)
|
||||
{
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(T data)
|
||||
{
|
||||
return restResult(data, FAIL, null);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(T data, String msg)
|
||||
{
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> fail(int code, String msg)
|
||||
{
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> Result<T> restResult(T data, int code, String msg)
|
||||
{
|
||||
Result<T> apiResult = new Result<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车一层列表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车一层商铺列表返回对象",value = "ShopCartDto")
|
||||
public class ShopCartDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long id;
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "店铺下机器总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "店铺下机器总数")
|
||||
private Integer totalMachine;
|
||||
|
||||
@ApiModelProperty(value = "商品支持的支付地址")
|
||||
private List<PayConfigDto> payConfigList;
|
||||
|
||||
//@ApiModelProperty(value = "购物车二层商品列表返回对象")
|
||||
//List<ShoppingCartInfoDto> shoppingCartInfoDtoList;
|
||||
|
||||
@ApiModelProperty(value = "商品机器列表")
|
||||
List<ProductMachineDto> productMachineDtoList;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺钱包配置返对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺钱包配置返对象",value = "ShopChainAndCoinDto")
|
||||
public class ShopChainAndCoinDto {
|
||||
private Long shopId;
|
||||
private String chain;
|
||||
private String coin;
|
||||
|
||||
|
||||
/**
|
||||
* 用于stream distinct()去重
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ShopChainAndCoinDto that = (ShopChainAndCoinDto) o;
|
||||
return shopId.equals(that.shopId) && coin.equals(that.coin) && chain.equals(that.chain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = shopId.hashCode();
|
||||
result = 31 * result + coin.hashCode();
|
||||
result = 31 * result + chain.hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺商品配置返回对象",value = "ShopConfigDelDto")
|
||||
public class ShopConfigDelDto extends BaseVo {
|
||||
|
||||
|
||||
private Long shopId;
|
||||
|
||||
|
||||
private String payAddress;
|
||||
|
||||
private String chain;
|
||||
|
||||
private Boolean del;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺商品配置返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺商品配置返回对象",value = "ShopConfigDto")
|
||||
public class ShopConfigDto extends BaseVo {
|
||||
|
||||
|
||||
/**
|
||||
* 商铺ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商铺ID")
|
||||
private Long shopId;
|
||||
|
||||
|
||||
/**
|
||||
* 币种类型 0 虚拟币 1 稳定币
|
||||
*/
|
||||
@ApiModelProperty(value = "币种类型 0 虚拟币 1 稳定币")
|
||||
private Integer payType;
|
||||
|
||||
/**
|
||||
* 卖方对应收款钱包
|
||||
*/
|
||||
@ApiModelProperty(value = "卖方对应收款钱包")
|
||||
private String payAddress;
|
||||
|
||||
@ApiModelProperty(value = "链")
|
||||
private String chain;
|
||||
|
||||
@ApiModelProperty(value = "币(二级) 下拉列表")
|
||||
private List<ShopConfigDto.CoinDto> children;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "币种图片返回对象",value = "CoinDto")
|
||||
public static class CoinDto{
|
||||
@ApiModelProperty(value = "商品支付方式及价格单位 取值 虚拟币( nexa rxd dgbo dgbq dgbs alph enx grs mona) 稳定币(usdt usdc busd)")
|
||||
private String payCoin;
|
||||
|
||||
@ApiModelProperty(value = "币种图片")
|
||||
private String image;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import com.m2pool.lease.vo.BaseVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <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;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 店铺配置商品列表返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-08-05
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "店铺配置商品列表返回对象",value = "ShopNameDto")
|
||||
public class ShopNameDto {
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String name;
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 购物车详情表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "购物车二层商品列表返回对象",value = "ShoppingCartInfoDto" )
|
||||
public class ShoppingCartInfoDto {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
//@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;
|
||||
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 支付消息记录表
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-09-10
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "交易流水返回对象",value = "TransactionRecordDto" )
|
||||
public class TransactionRecordDto {
|
||||
|
||||
|
||||
/**
|
||||
* 消息ID
|
||||
*/
|
||||
@ApiModelProperty(value = "消息ID")
|
||||
private String queueId;
|
||||
|
||||
/**
|
||||
* 买家充值地址
|
||||
*/
|
||||
@ApiModelProperty(value = "买家充值地址")
|
||||
private String fromAddress;
|
||||
|
||||
/**
|
||||
* 卖家地址(卖家自定义地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现地址 充值流水:不需要该字段 支付流水:卖家收款地址")
|
||||
private String toAddress;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "理论支付支付金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
*实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)
|
||||
*/
|
||||
@ApiModelProperty(value = "实际支付金额(根据一天内预估算力和实际算力差值计算得来,并且已经真实支付成功的金额)")
|
||||
private BigDecimal realAmount;
|
||||
|
||||
/**
|
||||
* 钱包冻结金额
|
||||
*/
|
||||
@ApiModelProperty(value = "钱包冻结金额")
|
||||
private BigDecimal blockAmount;
|
||||
/**
|
||||
* 卖家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现钱包币种 充值流水:不需要该字段 支付流水:卖家收款钱包币种")
|
||||
private String toSymbol;
|
||||
|
||||
/**
|
||||
* 卖家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "提现流水:用户提现链链名称 充值流水:不需要该字段 支付流水:卖家收款链名称")
|
||||
private String toChain;
|
||||
|
||||
|
||||
/**
|
||||
* 买家钱包币种
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包币种")
|
||||
private String fromSymbol;
|
||||
|
||||
/**
|
||||
* 买家钱包链名称
|
||||
*/
|
||||
@ApiModelProperty(value = "买家钱包链名称")
|
||||
private String fromChain;
|
||||
|
||||
/**
|
||||
* 交易hash
|
||||
*/
|
||||
@ApiModelProperty(value = "交易hash")
|
||||
private String txHash;
|
||||
|
||||
/**
|
||||
* 订单号
|
||||
*/
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@ApiModelProperty(value = "流水建立时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "成功/失败/证书校验失败时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0 失败 1 成功 2 等待校验 3 证书校验失败
|
||||
*/
|
||||
@ApiModelProperty(value = " 0 支付/充值/提现失败 1 支付/充值/提现成功 2 支付/充值/提现校验中 3 支付/充值/提现证书校验失败")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户返回对象",value = "UserDto" )
|
||||
public class UserDto{
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id(邮箱)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id(邮箱)")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户挖矿账户矿工返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户挖矿账户矿工返回对象",value = "UserMinerDto" )
|
||||
public class UserMinerDto {
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "机器挖矿币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "实时算力(单位MH/S)")
|
||||
private BigDecimal realPower;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户挖矿账户矿工返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(description = "用户挖矿账户矿工实时算力返回对象",value = "UserMinerPowerDto" )
|
||||
public class UserMinerPowerDto {
|
||||
/**
|
||||
* 挖矿机器 对应的矿工账号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器 对应的矿工账号")
|
||||
private String user;
|
||||
/**
|
||||
* 挖矿机器编号
|
||||
*/
|
||||
@ApiModelProperty(value = "挖矿机器编号")
|
||||
private String miner;
|
||||
|
||||
@ApiModelProperty(value = "机器挖矿币种")
|
||||
private String coin;
|
||||
|
||||
@ApiModelProperty(value = "机器算力")
|
||||
private BigDecimal power;
|
||||
|
||||
@ApiModelProperty(value = "记录开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
package com.m2pool.lease.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户拥有商品返回对象
|
||||
* </p>
|
||||
*
|
||||
* @author yyb
|
||||
* @since 2025-07-23
|
||||
*/
|
||||
@Builder
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value="UserOwnedProductDto", description="UserOwnedProductDto")
|
||||
public class UserOwnedProductDto {
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID(暂时使用租赁者钱包地址)
|
||||
*/
|
||||
@ApiModelProperty(value = "用户id(邮箱)")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 商品对应的机器id
|
||||
*/
|
||||
@ApiModelProperty(value = "商品对应的机器id")
|
||||
private Long productMachineId;
|
||||
|
||||
/**
|
||||
* 订单明细 ID,关联订单中的购买记录
|
||||
*/
|
||||
@ApiModelProperty(value = "订单明细 ID,关联订单中的购买记录")
|
||||
private Long orderItemId;
|
||||
|
||||
/**
|
||||
* 商品开始使用时间(购买当天24点生效)
|
||||
*/
|
||||
@ApiModelProperty(value = "商品开始使用时间(购买当天24点生效)")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 商品使用结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "商品使用结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 购买算力的量,当 type 为 1 时有效
|
||||
*/
|
||||
@ApiModelProperty(value = "购买算力的量,当 type 为 1 时有效")
|
||||
private BigDecimal purchasedComputingPower;
|
||||
|
||||
/**
|
||||
* 当前实时算力
|
||||
*/
|
||||
@ApiModelProperty(value = "当前实时算力:单位默认MH/S")
|
||||
private BigDecimal currentComputingPower;
|
||||
|
||||
/**
|
||||
* 商品状态,0 表示运行中,1 表示已过期
|
||||
*/
|
||||
@ApiModelProperty(value = "商品状态,0 表示运行中,1 表示已过期")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 商品类型,0 表示挖矿机器,1 表示算力套餐
|
||||
*/
|
||||
@ApiModelProperty(value = "商品类型,0 表示挖矿机器,1 表示算力套餐")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 购买时间
|
||||
*/
|
||||
@ApiModelProperty(value = "购买时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益
|
||||
*/
|
||||
@ApiModelProperty(value = "预估商品结束时的总收益")
|
||||
private BigDecimal estimatedEndIncome;
|
||||
|
||||
|
||||
/**
|
||||
* 预估商品结束时的总收益 单位usdt
|
||||
*/
|
||||
@ApiModelProperty(value = "预估商品结束时的总收益 单位usdt")
|
||||
private BigDecimal estimatedEndUsdtIncome;
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到)
|
||||
*/
|
||||
@ApiModelProperty(value = "当前收益(根据购买机器到现在的平均算力计算得到)")
|
||||
private BigDecimal currentIncome;
|
||||
|
||||
/**
|
||||
* 当前收益(根据购买机器到现在的平均算力计算得到)单位usdt
|
||||
*/
|
||||
@ApiModelProperty(value = "当前收益(根据购买机器到现在的平均算力计算得到)单位usdt")
|
||||
private BigDecimal currentUsdtIncome;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user