记得上下班打卡 | git大法好,push需谨慎

Commit b8182d7f authored by 张国柄's avatar 张国柄

opt;

parent c7c679e9
package com.liquidnet.service.adam.service.impl; package com.liquidnet.service.adam.service.impl;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.fasterxml.jackson.databind.node.ObjectNode;
import com.liquidnet.commons.lang.util.CurrentUtil; import com.liquidnet.commons.lang.util.CurrentUtil;
import com.liquidnet.commons.lang.util.HttpUtil; import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
...@@ -20,10 +20,8 @@ import lombok.extern.slf4j.Slf4j; ...@@ -20,10 +20,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
...@@ -45,8 +43,6 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -45,8 +43,6 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
// @Value("${liquidnet.service.galaxy.url}")// TODO: 2022/3/29 ==zhanggb // @Value("${liquidnet.service.galaxy.url}")// TODO: 2022/3/29 ==zhanggb
// private String sevGalaxyUrl; // private String sevGalaxyUrl;
private static final String BIZ_ACC_OPEN_NFT_ZXIN_BODY = "{\"routerType\":\"zxinchain\",\"idCardType\":\"1\",\"idCard\":\"P3\",\"userName\":\"P4\",\"mobile\":\"P5\",\"userId\":\"P6\"}";
@Override @Override
public ResponseDto<AdamUserBizAcctVo> openAccount(String uid, String bizCode, String name, String idCard, String mobile) { public ResponseDto<AdamUserBizAcctVo> openAccount(String uid, String bizCode, String name, String idCard, String mobile) {
List<AdamUserBizAcctVo> userBizAcctVoList = adamRdmService.getBizAcctVosByUid(uid); List<AdamUserBizAcctVo> userBizAcctVoList = adamRdmService.getBizAcctVosByUid(uid);
...@@ -103,20 +99,26 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -103,20 +99,26 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
} }
} }
String postBody = BIZ_ACC_OPEN_NFT_ZXIN_BODY.replace("P3", idCard).replace("P4", name).replace("P5", mobile).replace("P6", uid); ObjectNode postBodyNode = JsonUtils.OM().createObjectNode();
postBodyNode.put("routerType", "zxinchain");
postBodyNode.put("idCardType", "1");
postBodyNode.put("idCard", idCard);
postBodyNode.put("userName", name);
postBodyNode.put("mobile", mobile);
postBodyNode.put("userId", uid);
// String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/29 ==zhanggb // String postUrl = sevGalaxyUrl + "/user/register", blockChainAddress;// TODO: 2022/3/29 ==zhanggb
String postUrl = "https://ENVgalaxy.zhengzai.tv/galaxy/user/register".replace("ENV", env.getProperty(CurrentUtil.CK_ENV_ACTIVE)), blockChainAddress; String postUrl = "https://ENVgalaxy.zhengzai.tv/galaxy/user/register".replace("ENV", env.getProperty(CurrentUtil.CK_ENV_ACTIVE)), blockChainAddress;
try { try {
String postRespStr = HttpUtil.postRaw(postUrl, postBody, null); String postRespStr = HttpUtil.postRaw(postUrl, postBodyNode.toString(), null);
JsonNode postRespJNode = JsonUtils.fromJson(postRespStr, JsonNode.class), postRespCode; JsonNode postRespJNode = JsonUtils.fromJson(postRespStr, JsonNode.class), postRespCode;
if (null == postRespJNode || null == (postRespCode = postRespJNode.get("code")) || !postRespCode.asText().equals("0")) { if (null == postRespJNode || null == (postRespCode = postRespJNode.get("code")) || !postRespCode.asText().equals("0")) {
log.warn("#开通业务账号:至信数字藏品账号开通失败[postBody={},postRespStr={}]", postBody, postRespStr); log.warn("#开通业务账号:至信数字藏品账号开通失败[postBody={},postRespStr={}]", postBodyNode, postRespStr);
return ResponseDto.failure(ErrorMapping.get("10113")); return ResponseDto.failure(ErrorMapping.get("10113"));
} }
JsonNode postRespDataJNode = postRespJNode.get("data"); JsonNode postRespDataJNode = postRespJNode.get("data");
blockChainAddress = postRespDataJNode.get("blockChainAddress").asText(); blockChainAddress = postRespDataJNode.get("blockChainAddress").asText();
} catch (Exception e) { } catch (Exception e) {
log.error("Ex.开通业务账号:至信数字藏品账号开通请求异常[url={},postBody={}],ex:{}", postUrl, postBody, e.getMessage()); log.error("Ex.开通业务账号:至信数字藏品账号开通请求异常[url={},postBody={}],ex:{}", postUrl, postBodyNode, e.getMessage());
return ResponseDto.failure(ErrorMapping.get("10113")); return ResponseDto.failure(ErrorMapping.get("10113"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment