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

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

+NFT批量查询交易调用;

parent 807cfcf3
...@@ -5,6 +5,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode; ...@@ -5,6 +5,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.liquidnet.commons.lang.util.CollectionUtil; import com.liquidnet.commons.lang.util.CollectionUtil;
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;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyResultBatchQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyResultBatchQueryRespDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -105,4 +107,27 @@ public class GoblinGalaxyService { ...@@ -105,4 +107,27 @@ public class GoblinGalaxyService {
return null; return null;
} }
} }
/**
* NFT发行、购买结果查询
*
* @param queryReqDto GalaxyNftPublishAndBuyResultBatchQueryReqDto
* @return GalaxyNftPublishAndBuyResultBatchQueryRespDto
*/
public GalaxyNftPublishAndBuyResultBatchQueryRespDto checkNftTradeResultBatch(GalaxyNftPublishAndBuyResultBatchQueryReqDto queryReqDto) {
String postUrl = serviceGalaxyUrl + "/galaxy/nftTrade/nftPublishAndBuyResultBatchQuery";
String postBody = JsonUtils.toJson(queryReqDto);
try {
String postRespStr = HttpUtil.postRaw(postUrl, postBody, null);
JsonNode postRespJNode = JsonUtils.fromJson(postRespStr, JsonNode.class), postRespCode;
if (null == postRespJNode || null == (postRespCode = postRespJNode.get("code")) || !postRespCode.asText().equals("0")) {
log.warn("#NFT发行购买结果查询:查询失败[postBody={},postRespStr={}]", postBody, postRespStr);
return null;
}
return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyNftPublishAndBuyResultBatchQueryRespDto.class);
} catch (Exception e) {
log.error("Ex.NFT发行购买结果查询:请求异常[url={},postBody={}],ex:{}", postUrl, postBody, e.getMessage());
return null;
}
}
} }
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