package com.xcong.excoin.modules.blackchain.service; import com.alibaba.fastjson.JSONObject; import com.xcong.excoin.modules.blackchain.model.RocCreateAcoountModel; import org.apache.commons.lang3.StringUtils; /** * ROC币种接入 */ public class RocService { private final static String URL = "http://api.rocwallet.cc"; private final static String CREATE_WALLET= "/init/createaccount"; public static String createWallet(){ RocCreateAcoountModel createAcoountModel = new RocCreateAcoountModel(); createAcoountModel.setPassword("123456"); createAcoountModel.setTerminalId("rocexcoin"); createAcoountModel.setWalletName("coin"); String post = HttpUtil.jsonPost(URL+CREATE_WALLET, JSONObject.toJSONString(createAcoountModel)); if(StringUtils.isBlank(post)){ return null; } JSONObject jsonObject = JSONObject.parseObject(post); Object code = jsonObject.get("code"); if("0".equals(code.toString())){ Object o = jsonObject.getJSONObject("data").get("address"); return o.toString(); } return null; } }