zainali5120
2020-12-01 ce3b47fdf62926f80510a94f7a520dbf05267d6d
src/main/java/com/xcong/excoin/modules/blackchain/service/Impl/BlockSeriveImpl.java
@@ -5,18 +5,14 @@
import javax.annotation.Resource;
import com.xcong.excoin.modules.blackchain.service.*;
import com.xcong.excoin.rabbit.producer.UsdtUpdateProducer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.xcong.excoin.common.LoginUserUtils;
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.blackchain.service.BlockSerive;
import com.xcong.excoin.modules.blackchain.service.BtcService;
import com.xcong.excoin.modules.blackchain.service.EthService;
import com.xcong.excoin.modules.blackchain.service.LtcService;
import com.xcong.excoin.modules.blackchain.service.UsdtService;
import com.xcong.excoin.modules.blackchain.service.XrpService;
import com.xcong.excoin.modules.member.dao.MemberCoinAddressDao;
import com.xcong.excoin.modules.member.dao.MemberDao;
import com.xcong.excoin.modules.member.entity.MemberCoinAddressEntity;
@@ -34,6 +30,9 @@
    MemberDao memberDao;
    @Resource
    MemberCoinAddressDao memberMapper;
    @Resource
    private UsdtUpdateProducer usdtUpdateProducer;
    @Override
    public Result findBlockAddress(String symbol) {
@@ -54,7 +53,7 @@
            } else {
                memberCoinAddress = memberMapper.selectBlockAddress(Long.parseLong(mId), symbol);
            }
            log.info("--->{}", memberCoinAddress);
            //log.info("--->{}", memberCoinAddress);
            if (memberCoinAddress != null) {
                map.put("address", memberCoinAddress.getAddress());
                map.put("lable", memberCoinAddress.getLabel());
@@ -105,9 +104,7 @@
                        map.put("lable", uuid);
                        break;
                    case "XRP":
                        JSONObject jSONObject = XrpService.createWallet();
                        address = (String) jSONObject.get("xAddress");
                        key = (String) jSONObject.get("secret");
                        address = "biyicteos123";
                        map.put("address", address);
                        map.put("lable", uuid);
                        break;
@@ -185,7 +182,13 @@
                                coinAddress.setLabel(uuid);
                                memberMapper.insert(coinAddress);
                            }
                           // 发送新增的地址到监听集合
                            usdtUpdateProducer.sendAddressMsg(address);
                        }
                        break;
                    case "ROC":
                        address = RocService.createWallet();
                        map.put("address", address);
                        break;
                    default:
                        break;
@@ -211,4 +214,8 @@
        return result;
    }
    public static void main(String[] args) {
        String wallet = RocService.createWallet();
        System.out.println(wallet);
    }
}