6 files modified
1 files added
| | |
| | | * @param map 对应多个键值 |
| | | * @return true 成功 false 失败 |
| | | */ |
| | | public boolean hmset(String key, Map<String, Object> map) { |
| | | public boolean hmset(String key, Map<Object, Object> map) { |
| | | try { |
| | | redisTemplate.opsForHash().putAll(key, map); |
| | | return true; |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.dapp.dto.RecordInPageDto; |
| | | import cc.mrbird.febs.dapp.dto.TransferDto; |
| | | import cc.mrbird.febs.dapp.dto.WalletOperateDto; |
| | | import cc.mrbird.febs.dapp.service.DappWalletService; |
| | | import cc.mrbird.febs.dapp.vo.WalletInfoVo; |
| | |
| | | // dappWalletService.change(walletOperateDto); |
| | | // return new FebsResponse().success().message("兑换成功"); |
| | | // } |
| | | // |
| | | |
| | | // @ApiOperation(value = "提现接口", notes = "提现接口") |
| | | // @PostMapping(value = "/withdraw") |
| | | // public FebsResponse withdraw(@RequestBody WalletOperateDto walletOperateDto) { |
| | |
| | | // return new FebsResponse().success().message("申请成功, 等待审核"); |
| | | // } |
| | | |
| | | @ApiOperation(value = "转账", notes = "转账") |
| | | @PostMapping(value = "/transfer") |
| | | public FebsResponse transfer(@RequestBody TransferDto transferDto) { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "记录列表", notes = "记录列表") |
| | | @PostMapping(value = "/recordInPage") |
| | | public FebsResponse recordInPage(@RequestBody RecordInPageDto recordInPageDto) { |
New file |
| | |
| | | package cc.mrbird.febs.dapp.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2022-05-27 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "TransferDto", description = "转账接口参数类") |
| | | public class TransferDto { |
| | | |
| | | @ApiModelProperty(value = "1-买入 2-卖出", example = "1") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "交易hash", example = "123") |
| | | private String txHash; |
| | | |
| | | @ApiModelProperty(value = "地址", example = "0x123") |
| | | private String address; |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.dapp.dto.RecordInPageDto; |
| | | import cc.mrbird.febs.dapp.dto.TransferDto; |
| | | import cc.mrbird.febs.dapp.dto.WalletOperateDto; |
| | | import cc.mrbird.febs.dapp.entity.DappAccountMoneyChangeEntity; |
| | | import cc.mrbird.febs.dapp.entity.DappFundFlowEntity; |
| | |
| | | IPage<DappWalletMineEntity> walletMineInPage(DappWalletMineEntity walletMine, QueryRequest request); |
| | | |
| | | IPage<DappAccountMoneyChangeEntity> accountMoneyChangeInPage(DappAccountMoneyChangeEntity change, QueryRequest request); |
| | | |
| | | |
| | | void transfer(TransferDto transferDto); |
| | | } |
| | |
| | | fromMember = dappMemberService.insertMember(e.from, null); |
| | | } |
| | | |
| | | BigInteger tokens = e.tokens; |
| | | |
| | | BigDecimal amount = BigDecimal.valueOf(tokens.intValue()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN); |
| | | |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity(fromMember.getId(), amount, 2, null, null, e.log.getTransactionHash()); |
| | | dappFundFlowDao.insert(fundFlow); |
| | | |
| | | // TODO price |
| | | BigDecimal newPrice = BigDecimal.valueOf(1); |
| | | |
| | | BigDecimal transferAmount = amount.multiply(newPrice); |
| | | String hash = ChainService.getInstance(ChainEnum.BSC_TFC.name()).transfer(e.from, transferAmount); |
| | | fundFlow.setToHash(hash); |
| | | dappFundFlowDao.updateById(fundFlow); |
| | | // BigInteger tokens = e.tokens; |
| | | // BigDecimal amount = BigDecimal.valueOf(tokens.intValue()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN); |
| | | // |
| | | // DappFundFlowEntity fundFlow = new DappFundFlowEntity(fromMember.getId(), amount, 2, null, null, e.log.getTransactionHash()); |
| | | // dappFundFlowDao.insert(fundFlow); |
| | | // |
| | | // // TODO price |
| | | // BigDecimal newPrice = BigDecimal.valueOf(1); |
| | | // |
| | | // BigDecimal transferAmount = amount.multiply(newPrice); |
| | | // String hash = ChainService.getInstance(ChainEnum.BSC_TFC.name()).transfer(e.from, transferAmount); |
| | | // fundFlow.setToHash(hash); |
| | | // dappFundFlowDao.updateById(fundFlow); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | keys.put(connectDto.getAddress(), key); |
| | | redisUtils.set(AppContants.REDIS_KEY_SIGN, keys); |
| | | redisUtils.hmset(AppContants.REDIS_KEY_SIGN, keys); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.dapp.dto.RecordInPageDto; |
| | | import cc.mrbird.febs.dapp.dto.TransferDto; |
| | | import cc.mrbird.febs.dapp.dto.WalletOperateDto; |
| | | import cc.mrbird.febs.dapp.entity.*; |
| | | import cc.mrbird.febs.dapp.mapper.*; |
| | |
| | | Page<DappAccountMoneyChangeEntity> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | return dappAccountMoneyChangeDao.selectInPage(change, page); |
| | | } |
| | | |
| | | @Override |
| | | public void transfer(TransferDto transferDto) { |
| | | |
| | | } |
| | | } |