| | |
| | | } |
| | | |
| | | public static void createWallet(Long userId, String userName, String symbol, String address) { |
| | | log.info("创建钱包开始:{}", System.currentTimeMillis()); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("userId", userId); |
| | | param.put("symbol", symbol); |
| | |
| | | param.put("accountFlag", 1); |
| | | param.put("sign", SecureUtil.md5(userId + symbol + address + SIGN_STR)); |
| | | String body = HttpRequest.post(TRC20_API + "account/created").body(JSONObject.toJSONString(param)).execute().body(); |
| | | log.info("创建钱包结束:{}", System.currentTimeMillis()); |
| | | if (!"200".equals(JSONObject.parseObject(body).getString("code"))) { |
| | | log.error("TRC20创建钱包失败:{}, {}, {}", userId, address, body); |
| | | throw new GlobalException("获取订单失败"); |