| | |
| | | package com.xcong.excoin.modules.blackchain.service.Impl;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.xcong.excoin.common.enumerates.CoinTypeEnum;
|
| | | import com.xcong.excoin.modules.blackchain.service.*;
|
| | | import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | |
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"ERC20");
|
| | | } else if ("TRC20".equals(lable)) {
|
| | | MemberCoinAddressEntity coinAddress = memberMapper.selectBlockAddress(Long.parseLong(mId), CoinTypeEnum.XCC.name());
|
| | | if (coinAddress != null) {
|
| | | address = coinAddress.getAddress();
|
| | | key = coinAddress.getPrivateKey();
|
| | | } else {
|
| | | Map<String, String> usdtMap = Trc20Service.createAddress();
|
| | | address = usdtMap.get("address");
|
| | | key = usdtMap.get("privateKey");
|
| | | map.put("address", address);
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"TRC20");
|
| | | }
|
| | | }
|
| | | break;
|
| | | case "ROC":
|
| | | address = RocService.createWallet();
|
| | | map.put("address", address);
|
| | | break;
|
| | | case "XCC" :
|
| | | MemberCoinAddressEntity trc20Usdt = memberMapper.selectBlockAddressWithTag(Long.parseLong(mId), CoinTypeEnum.USDT.name(), "TRC20");
|
| | | if (trc20Usdt != null) {
|
| | | address = trc20Usdt.getAddress();
|
| | | key = trc20Usdt.getPrivateKey();
|
| | | map.put("address", address);
|
| | | } else {
|
| | | Map<String, String> usdtMap = Trc20Service.createAddress();
|
| | | address = usdtMap.get("address");
|
| | | key = usdtMap.get("privateKey");
|
| | |
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"TRC20");
|
| | | }
|
| | | break;
|
| | | case "ROC":
|
| | | address = RocService.createWallet();
|
| | | map.put("address", address);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
| | | coinAddress.setPrivateKey(key);
|
| | | coinAddress.setSymbol(symbol);
|
| | | coinAddress.setLabel(uuid);
|
| | | if (symbol.equals("USDT")) {
|
| | | if (symbol.equals("USDT") || "XCC".equals(symbol)) {
|
| | | coinAddress.setTag(lable);
|
| | | }
|
| | |
|