| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.yami.trading.security.common.enums.CryptoCurrencyEnum; |
| | | import com.yami.trading.security.common.util.LocalKeyStorageAESUtil; |
| | |
| | | return Result.succeed(data); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据币种获取链地址 |
| | | */ |
| | | @GetMapping(action + "getBlockchainName.action") |
| | | public Object getBlockchainName(HttpServletRequest request) throws Exception { |
| | | String coin = request.getParameter("coin"); |
| | | List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>(); |
| | | // List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>(); |
| | | return Result.succeed(channelBlockchainService.list(Wrappers.<ChannelBlockchain>query().lambda().eq(ChannelBlockchain::getCoin, coin.toLowerCase()))); |
| | | // try { |
| | | // coin = coin.toLowerCase(); |
| | | // Map<String, List<CryptoCurrencyEnum>> allGroupedByCoin = CryptoCurrencyEnum.getAllGroupedByCoin(); |
| | | // List<CryptoCurrencyEnum> currencyEnums = allGroupedByCoin.get(coin); |
| | | // currencyEnums.forEach(f->{ |
| | | // try { |
| | | // String address = LocalKeyStorageAESUtil.loadAndDecrypt(f.getName()); |
| | | // ChannelBlockchain blockchain = new ChannelBlockchain(); |
| | | // blockchain.setBlockchain_name(f.getChain()); |
| | | // blockchain.setAddress(address); |
| | | // blockchain.setCoin(f.getCoin()); |
| | | // blockchain.setAuto(false); |
| | | // blockchain.setImg(null); |
| | | // data.add(blockchain); |
| | | // } catch (Exception e) { |
| | | // e.getMessage(); |
| | | // } |
| | | // }); |
| | | // }catch (Exception e){ |
| | | // log.error("获取充值地址错误:",e); |
| | | // return Result.failed("充值链暂不可用"); |
| | | // } |
| | | |
| | | try { |
| | | coin = coin.toLowerCase(); |
| | | Map<String, List<CryptoCurrencyEnum>> allGroupedByCoin = CryptoCurrencyEnum.getAllGroupedByCoin(); |
| | | List<CryptoCurrencyEnum> currencyEnums = allGroupedByCoin.get(coin); |
| | | currencyEnums.forEach(f->{ |
| | | try { |
| | | String address = LocalKeyStorageAESUtil.loadAndDecrypt(f.getName()); |
| | | ChannelBlockchain blockchain = new ChannelBlockchain(); |
| | | blockchain.setBlockchain_name(f.getChain()); |
| | | blockchain.setAddress(address); |
| | | blockchain.setCoin(f.getCoin()); |
| | | blockchain.setAuto(false); |
| | | blockchain.setImg(null); |
| | | data.add(blockchain); |
| | | } catch (Exception e) { |
| | | e.getMessage(); |
| | | } |
| | | }); |
| | | }catch (Exception e){ |
| | | log.error("获取充值地址错误:",e); |
| | | return Result.failed("充值链暂不可用"); |
| | | } |
| | | return Result.succeed(data); |
| | | |
| | | |
| | | |
| | |
| | | // data.get(i).setAddress(null); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | // String partyId =SecurityUtils.getUser().getUserId(); |
| | | // if(!StringUtils.isNotEmpty(partyId)){ |
| | | // throw new YamiShopBindException("请登录!"); |