随便笔记

获取个人钱包地址

 

    /**
     * 获取用户钱包地址
     *
     * @param param
     * @return
     */
    @PostMapping("/getUserAddress")
    public CommonResultDto<String> getUserAddress(@RequestBody @Valid CreateWalletParamDto param) {
        return CommonResultDto.SUCCESS(createWalletService.getUserAddress(param));
    }
    @Override
    public String getUserAddress(@Valid CreateWalletParamDto param) {
        Wrapper<WCoin> wrapperWCoin = new QueryWrapper<>(WCoin.builder().coinType(CoinTypeConstant.BTC_TOKEN).token(TokenConstant.USDT).switchFlag(true).valid("E").build());
        WCoin wCoin = wCoinService.getOne(wrapperWCoin);
        
        Wrapper<WWallet> wrapper = new QueryWrapper<>(WWallet.builder()
                    .orderId(String.valueOf(param.getUserId()))
                    .platform(param.getPlatform())
                .coinType(wCoin.getCoinType())
                .token(wCoin.getToken())
                .build());
        WWallet result = walletService.getOne(wrapper);
        return (result == null || result.getAddress() == null) ? "用户或钱包地址不存在" : result.getAddress();
    }

 

猜你喜欢

转载自www.cnblogs.com/andy3990/p/11692250.html