| | |
| | | import com.xcong.excoin.modules.blackchain.service.*;
|
| | | import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
|
| | | import lombok.extern.slf4j.Slf4j;
|
| | | import org.apache.commons.lang.StringUtils;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.alibaba.fastjson.JSONObject;
|
| | |
| | | private UsdtUpdateProducer usdtUpdateProducer;
|
| | |
|
| | | @Override
|
| | | public Result findBlockAddress(String symbol) {
|
| | | public Result findBlockAddress(String symbol, String lable) {
|
| | | //获取用户ID
|
| | | String mId = LoginUserUtils.getAppLoginUser().getId().toString();
|
| | | MemberEntity member = memberDao.selectById(mId);
|
| | | if (member == null) {
|
| | | return Result.fail(MessageSourceUtils.getString("member_service_0003"));
|
| | | }
|
| | | String lable = "ERC20";
|
| | | if(StringUtils.isBlank(lable)){
|
| | | //lable = "ERC20";
|
| | | lable = "TRC20";
|
| | | }
|
| | | Result result = new Result();
|
| | | try {
|
| | | Map<String, String> map = new HashMap<String, String>();
|
| | |
| | | memberMapper.insert(coinAddress);
|
| | | }
|
| | |
|
| | | } else {
|
| | | } else if ("ERC20".equals(lable)) {
|
| | | MemberCoinAddressEntity ethAddress2 = memberMapper.selectBlockAddress(Long.parseLong(mId), "ETH");
|
| | | if (ethAddress2 != null) {
|
| | | address = ethAddress2.getAddress();
|
| | |
| | | coinAddress.setLabel(uuid);
|
| | | memberMapper.insert(coinAddress);
|
| | | }
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address);
|
| | | // 发送新增的地址到监听集合
|
| | | usdtUpdateProducer.sendAddressMsg(address+","+"ERC20");
|
| | | } else if ("TRC20".equals(lable)) {
|
| | | 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":
|