| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.dapp.dto.TransferDto; |
| | | import cc.mrbird.febs.dapp.mapper.DappAchieveMemberTreeDao; |
| | | import cc.mrbird.febs.dapp.service.DappSystemService; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.tree.MatrixTree; |
| | | import cc.mrbird.febs.tree.MemberNode; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.RandomUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | } |
| | | System.out.println(System.currentTimeMillis()); |
| | | } |
| | | |
| | | @Autowired |
| | | private DappSystemService dappSystemService; |
| | | |
| | | @Autowired |
| | | private DappWalletService dappWalletService; |
| | | |
| | | @Autowired |
| | | private DappAchieveMemberTreeDao dappAchieveMemberTreeDao; |
| | | |
| | | /** |
| | | * |
| | | * // 第一次{amount: val, fee: 0, txHash: '', type: 1, buyType: 2} |
| | | * // 成功{type: 1, txHash: result.transactionHash, id: res.data, flag: 'success', buyType: 2} |
| | | * // 失败{type: 1, id: res.data, flag: 'fail', buyType: 2} |
| | | */ |
| | | @Test |
| | | public void testTransfer(){ |
| | | //第一次 |
| | | TransferDto transferDto = new TransferDto(); |
| | | transferDto.setAmount(new BigDecimal(1.05)); |
| | | transferDto.setFee(BigDecimal.ZERO); |
| | | transferDto.setType(1); |
| | | transferDto.setBuyType(2); |
| | | transferDto.setMemberId(119L); |
| | | Long transfer = dappWalletService.transfer(transferDto); |
| | | transferDto.setTxHash("ceshi"+ DateUtil.now()); |
| | | transferDto.setId(transfer); |
| | | transferDto.setFlag("success"); |
| | | dappWalletService.transfer(transferDto); |
| | | } |
| | | @Test |
| | | public void testTransfer2(){ |
| | | //成功 |
| | | TransferDto transferDto = new TransferDto(); |
| | | transferDto.setType(1); |
| | | transferDto.setTxHash("ceshi"+ DateUtil.now()); |
| | | transferDto.setId(422L); |
| | | transferDto.setFlag("success"); |
| | | transferDto.setBuyType(2); |
| | | transferDto.setAmount(new BigDecimal(1.05)); |
| | | transferDto.setFee(BigDecimal.ZERO); |
| | | transferDto.setMemberId(111L); |
| | | dappWalletService.transfer(transferDto); |
| | | } |
| | | |
| | | @Test |
| | | public void resetMatrix() { |
| | | dappSystemService.levelProfit(9L); |
| | | dappSystemService.memberOut(9L); |
| | | } |
| | | |
| | | @Test |
| | | public void limitResetProfitTest() { |
| | | dappSystemService.putIntoProfit(59L, 1); |
| | | } |
| | | } |