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

Commit 9ccacef6 authored by 张国柄's avatar 张国柄

~合并Galaxy到Goblin,接口调用调整;

parent ac00bc74
...@@ -38,8 +38,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -38,8 +38,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
private IAdamUserService adamUserService; private IAdamUserService adamUserService;
@Value("${liquidnet.service.galaxy.url}") // @Value("${liquidnet.service.galaxy.url}")
private String serviceGalaxyUrl; // private String serviceGalaxyUrl;
@Value("${liquidnet.service.goblin.url}") @Value("${liquidnet.service.goblin.url}")
private String serviceGoblinUrl; private String serviceGoblinUrl;
...@@ -122,7 +122,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService { ...@@ -122,7 +122,8 @@ public class AdamUserBusiAcctServiceImpl implements IAdamUserBusiAcctService {
postBodyNode.put("userName", name); postBodyNode.put("userName", name);
postBodyNode.put("mobile", mobile); postBodyNode.put("mobile", mobile);
postBodyNode.put("userId", uid); postBodyNode.put("userId", uid);
String postUrl = serviceGalaxyUrl + "/galaxy/user/register", blockChainAddress; // String postUrl = serviceGalaxyUrl + "/galaxy/user/register", blockChainAddress;
String postUrl = serviceGoblinUrl + "/goblin/user/register", blockChainAddress;
try { try {
String postRespStr = HttpUtil.postRaw(postUrl, postBodyNode.toString(), 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;
......
...@@ -36,8 +36,10 @@ public class ConsumerGoblinBizArtworkClqRdsReceiver extends AbstractBizRedisRece ...@@ -36,8 +36,10 @@ public class ConsumerGoblinBizArtworkClqRdsReceiver extends AbstractBizRedisRece
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@Value("${liquidnet.service.galaxy.url}") // @Value("${liquidnet.service.galaxy.url}")
private String serviceGalaxyUrl; // private String serviceGalaxyUrl;
@Value("${liquidnet.service.goblin.url}")
private String serviceGoblinUrl;
private static final String SQL_UPDATE_GOODS_SKU_NFT = "UPDATE goblin_goods_sku_nft SET upchain=?,series_id=?,series_hash=?,nft_hash=?,declare_at=?,updated_at=? WHERE sku_id=? "; private static final String SQL_UPDATE_GOODS_SKU_NFT = "UPDATE goblin_goods_sku_nft SET upchain=?,series_id=?,series_hash=?,nft_hash=?,declare_at=?,updated_at=? WHERE sku_id=? ";
...@@ -140,7 +142,8 @@ public class ConsumerGoblinBizArtworkClqRdsReceiver extends AbstractBizRedisRece ...@@ -140,7 +142,8 @@ public class ConsumerGoblinBizArtworkClqRdsReceiver extends AbstractBizRedisRece
artSeriesClaimResultQueryReqDto.setSkuId(skuId); artSeriesClaimResultQueryReqDto.setSkuId(skuId);
artSeriesClaimResultQueryReqDto.setRouterType(routerType); artSeriesClaimResultQueryReqDto.setRouterType(routerType);
String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaimResultQuery"; // String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaimResultQuery";
String postUrl = serviceGoblinUrl + "/goblin/artwork/seriesClaimResultQuery";
String postBoby = JsonUtils.toJson(artSeriesClaimResultQueryReqDto); String postBoby = JsonUtils.toJson(artSeriesClaimResultQueryReqDto);
try { try {
String postRespStr = HttpUtil.postRaw(postUrl, postBoby, null); String postRespStr = HttpUtil.postRaw(postUrl, postBoby, null);
......
...@@ -39,8 +39,10 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece ...@@ -39,8 +39,10 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece
private MongoTemplate mongoTemplate; private MongoTemplate mongoTemplate;
@Value("${liquidnet.service.galaxy.url}") // @Value("${liquidnet.service.galaxy.url}")
private String serviceGalaxyUrl; // private String serviceGalaxyUrl;
@Value("${liquidnet.service.goblin.url}")
private String serviceGoblinUrl;
private static final String SQL_UPDATE_GOODS_SKU_NFT = "UPDATE goblin_goods_sku_nft SET upchain=?,display_url=?,nft_url=? WHERE sku_id=? AND upchain=0 "; private static final String SQL_UPDATE_GOODS_SKU_NFT = "UPDATE goblin_goods_sku_nft SET upchain=?,display_url=?,nft_url=? WHERE sku_id=? AND upchain=0 ";
...@@ -160,7 +162,8 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece ...@@ -160,7 +162,8 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece
* @return GalaxyNftUploadRespDto * @return GalaxyNftUploadRespDto
*/ */
public GalaxyNftUploadRespDto uploadNftMaterial(GalaxyNftUploadReqDto nftUploadReqDto) { public GalaxyNftUploadRespDto uploadNftMaterial(GalaxyNftUploadReqDto nftUploadReqDto) {
String postUrl = serviceGalaxyUrl + "/galaxy/artwork/nftUpload"; // String postUrl = serviceGalaxyUrl + "/galaxy/artwork/nftUpload";
String postUrl = serviceGoblinUrl + "/goblin/artwork/nftUpload";
String postBody = JsonUtils.toJson(nftUploadReqDto); String postBody = JsonUtils.toJson(nftUploadReqDto);
try { try {
String postRespStr = HttpUtil.postRaw(postUrl, postBody, null); String postRespStr = HttpUtil.postRaw(postUrl, postBody, null);
...@@ -183,7 +186,8 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece ...@@ -183,7 +186,8 @@ public class ConsumerGoblinBizArtworkUplRdsReceiver extends AbstractBizRedisRece
* @return GalaxyArtSeriesClaimRespDto * @return GalaxyArtSeriesClaimRespDto
*/ */
public GalaxyArtSeriesClaimRespDto claimNftSeries(GalaxyArtSeriesClaimReqDto seriesClaimReqDto) { public GalaxyArtSeriesClaimRespDto claimNftSeries(GalaxyArtSeriesClaimReqDto seriesClaimReqDto) {
String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaim"; // String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaim";
String postUrl = serviceGoblinUrl + "/goblin/artwork/seriesClaim";
String postBody = JsonUtils.toJson(seriesClaimReqDto); String postBody = JsonUtils.toJson(seriesClaimReqDto);
try { try {
String postRespStr = HttpUtil.postRaw(postUrl, postBody, null); String postRespStr = HttpUtil.postRaw(postUrl, postBody, null);
......
...@@ -6,12 +6,14 @@ import com.liquidnet.commons.lang.util.DateUtil; ...@@ -6,12 +6,14 @@ import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.PagedResult; import com.liquidnet.service.base.PagedResult;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.base.constant.MQConst; import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.goblin.dto.GoblinQueueBizArtworkGenDto; import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyResultQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyResultQueryRespDto;
import com.liquidnet.service.galaxy.service.IGalaxyTradeService;
import com.liquidnet.service.goblin.dto.vo.*; import com.liquidnet.service.goblin.dto.vo.*;
import com.liquidnet.service.goblin.service.IGoblinUserDigitalArtworkService; import com.liquidnet.service.goblin.service.IGoblinUserDigitalArtworkService;
import com.liquidnet.service.goblin.service.impl.inner.GoblinGalaxyService;
import com.liquidnet.service.goblin.util.GoblinMongoUtils; import com.liquidnet.service.goblin.util.GoblinMongoUtils;
import com.liquidnet.service.goblin.util.GoblinRedisUtils; import com.liquidnet.service.goblin.util.GoblinRedisUtils;
import com.liquidnet.service.goblin.util.ObjectUtil; import com.liquidnet.service.goblin.util.ObjectUtil;
...@@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -21,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -34,8 +37,10 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr ...@@ -34,8 +37,10 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr
private GoblinRedisUtils goblinRedisUtils; private GoblinRedisUtils goblinRedisUtils;
@Autowired @Autowired
private GoblinMongoUtils goblinMongoUtils; private GoblinMongoUtils goblinMongoUtils;
@Autowired // @Autowired
private GoblinGalaxyService goblinGalaxyService; // private GoblinGalaxyService goblinGalaxyService;
@Resource(name = "galaxyTradeServiceImpl")
private IGalaxyTradeService galaxyTradeService;
@Override @Override
public GoblinUserDigitalArtworkPageVo page(String uid, Integer pageNum, Integer pageSize) { public GoblinUserDigitalArtworkPageVo page(String uid, Integer pageNum, Integer pageSize) {
...@@ -80,13 +85,15 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr ...@@ -80,13 +85,15 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr
listVo.setOpeningTime(goodsSkuInfoVo.getOpeningTime()); listVo.setOpeningTime(goodsSkuInfoVo.getOpeningTime());
if ("0".equals(listVo.getUnbox()) && 1 != listVo.getState() && listVo.getCreatedAt().isBefore(toCheckTime)) {// 15秒前创建的藏品,去主动核实发行交易状态 if ("0".equals(listVo.getUnbox()) && 1 != listVo.getState() && listVo.getCreatedAt().isBefore(toCheckTime)) {// 15秒前创建的藏品,去主动核实发行交易状态
List<String> checkRespDataList = goblinGalaxyService.checkNftTradeResult(uid, userDigitalArtworkVo.getOrderId(), goodsSkuInfoVo.getRouteType()); // List<String> checkRespDataList = goblinGalaxyService.checkNftTradeResult(uid, userDigitalArtworkVo.getOrderId(), goodsSkuInfoVo.getRouteType());
this.updateUserDigitalArtworkByChainTrade(userDigitalArtworkVo, listVo, checkRespDataList, now); // this.updateUserDigitalArtworkByChainTrade(userDigitalArtworkVo, listVo, checkRespDataList, now);
} else if (1 == listVo.getState() && "1".equals(listVo.getUnbox())) {// 盲盒已开启的,直接展示开出的藏品封面 this.updateUserDigitalArtworkByChainTrade(userDigitalArtworkVo, listVo, goodsSkuInfoVo.getRouteType(), now);
GoblinNftOrderVo goblinNftOrder = goblinRedisUtils.getGoblinNftOrder(userDigitalArtworkVo.getOrderId());
goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(goblinNftOrder.getBoxSkuId());
listVo.setCoverPic(goodsSkuInfoVo.getSkuPic());
} }
// else if (1 == listVo.getState() && "1".equals(listVo.getUnbox())) {// 盲盒已开启的,直接展示开出的藏品封面
// GoblinNftOrderVo goblinNftOrder = goblinRedisUtils.getGoblinNftOrder(userDigitalArtworkVo.getOrderId());
// goodsSkuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(goblinNftOrder.getBoxSkuId());
// listVo.setCoverPic(goodsSkuInfoVo.getSkuPic());
// }
list.add(listVo); list.add(listVo);
} }
...@@ -245,24 +252,59 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr ...@@ -245,24 +252,59 @@ public class GoblinUserDigitalArtworkServiceImpl implements IGoblinUserDigitalAr
/* -------------------------------------------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------------------------------------------- */
// private void updateUserDigitalArtworkByChainTrade(GoblinUserDigitalArtworkVo userDigitalArtworkVo, GoblinUserDigitalArtworkListVo listVo,
// List<String> checkRespDataList, LocalDateTime now) {
// if (!CollectionUtils.isEmpty(checkRespDataList)) {
// String nftId = checkRespDataList.get(0);
// String nftPublishChainTimestamp = checkRespDataList.get(1);
// String nftPublishTxHash = checkRespDataList.get(2);
// String nftBuyChainTimestamp = checkRespDataList.get(3);
// String nftBuyTxHash = checkRespDataList.get(4);
//
// listVo.setState(1);
// listVo.setEditionSn(Integer.valueOf(nftId.substring(nftId.indexOf("_") + 1)));
//
// userDigitalArtworkVo.setEditionSn(listVo.getEditionSn());
// userDigitalArtworkVo.setNftId(nftId);
// userDigitalArtworkVo.setReleaseAt(nftPublishChainTimestamp);
// userDigitalArtworkVo.setReleaseTxhash(nftPublishTxHash);
// userDigitalArtworkVo.setTradingAt(nftBuyChainTimestamp);
// userDigitalArtworkVo.setTradingTxhash(nftBuyTxHash);
// userDigitalArtworkVo.setState(1);
// userDigitalArtworkVo.setUpdatedAt(now);
//
// goblinRedisUtils.setUserDigitalArtworkVo(userDigitalArtworkVo);
// goblinMongoUtils.updateUserDigitalArtworkVoByChainTrade(userDigitalArtworkVo);
//
// queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_ARTWORK_GEN.getKey(),
// SqlMapping.get("goblin_user_digital_artwork.update_for_chain",
// userDigitalArtworkVo.getEditionSn(), userDigitalArtworkVo.getNftId(), userDigitalArtworkVo.getReleaseTxhash(),
// userDigitalArtworkVo.getReleaseAt(), userDigitalArtworkVo.getTradingTxhash(), userDigitalArtworkVo.getTradingAt(),
// userDigitalArtworkVo.getState(), userDigitalArtworkVo.getUpdatedAt(), userDigitalArtworkVo.getArtworkId())
// );
// }
// }
private void updateUserDigitalArtworkByChainTrade(GoblinUserDigitalArtworkVo userDigitalArtworkVo, GoblinUserDigitalArtworkListVo listVo, private void updateUserDigitalArtworkByChainTrade(GoblinUserDigitalArtworkVo userDigitalArtworkVo, GoblinUserDigitalArtworkListVo listVo,
List<String> checkRespDataList, LocalDateTime now) { String routerType, LocalDateTime now) {
if (!CollectionUtils.isEmpty(checkRespDataList)) { GalaxyNftPublishAndBuyResultQueryReqDto nftTradeQueryReqDto = GalaxyNftPublishAndBuyResultQueryReqDto.getNew();
String nftId = checkRespDataList.get(0); nftTradeQueryReqDto.setUserId(userDigitalArtworkVo.getUid());
String nftPublishChainTimestamp = checkRespDataList.get(1); nftTradeQueryReqDto.setNftOrderPayId(userDigitalArtworkVo.getOrderId());
String nftPublishTxHash = checkRespDataList.get(2); nftTradeQueryReqDto.setRouterType(routerType);
String nftBuyChainTimestamp = checkRespDataList.get(3); ResponseDto<GalaxyNftPublishAndBuyResultQueryRespDto> nftTradeQueryRespDto = galaxyTradeService.nftPublishAndBuyResultQuery(nftTradeQueryReqDto);
String nftBuyTxHash = checkRespDataList.get(4); if (nftTradeQueryRespDto.isSuccess()) {
GalaxyNftPublishAndBuyResultQueryRespDto nftTradeQueryRespDtoData = nftTradeQueryRespDto.getData();
String nftId = nftTradeQueryRespDtoData.getNftId();
listVo.setState(1); listVo.setState(1);
listVo.setEditionSn(Integer.valueOf(nftId.substring(nftId.indexOf("_") + 1))); listVo.setEditionSn(Integer.valueOf(nftId.substring(nftId.indexOf("_") + 1)));
userDigitalArtworkVo.setEditionSn(listVo.getEditionSn()); userDigitalArtworkVo.setEditionSn(listVo.getEditionSn());
userDigitalArtworkVo.setNftId(nftId); userDigitalArtworkVo.setNftId(nftId);
userDigitalArtworkVo.setReleaseAt(nftPublishChainTimestamp); userDigitalArtworkVo.setReleaseAt(nftTradeQueryRespDtoData.getNftPublishChainTimestamp());
userDigitalArtworkVo.setReleaseTxhash(nftPublishTxHash); userDigitalArtworkVo.setReleaseTxhash(nftTradeQueryRespDtoData.getNftPublishTradeHash());
userDigitalArtworkVo.setTradingAt(nftBuyChainTimestamp); userDigitalArtworkVo.setTradingAt(nftTradeQueryRespDtoData.getNftBuyChainTimestamp());
userDigitalArtworkVo.setTradingTxhash(nftBuyTxHash); userDigitalArtworkVo.setTradingTxhash(nftTradeQueryRespDtoData.getNftBuyTradeHash());
userDigitalArtworkVo.setState(1); userDigitalArtworkVo.setState(1);
userDigitalArtworkVo.setUpdatedAt(now); userDigitalArtworkVo.setUpdatedAt(now);
......
package com.liquidnet.service.goblin.service.impl.inner; //package com.liquidnet.service.goblin.service.impl.inner;
//
import com.fasterxml.jackson.databind.JsonNode; //import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode; //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.GalaxyNftPublishAndBuyResultBatchQueryReqDto;
import com.liquidnet.service.galaxy.dto.param.GalaxyNftPublishAndBuyResultBatchQueryRespDto; //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;
//
import java.util.List; //import java.util.List;
//
/** ///**
* Galaxy服务接口调用 // * Galaxy服务接口调用
* // *
* @author zhanggb // * @author zhanggb
* Created by IntelliJ IDEA at 2022/4/1 // * Created by IntelliJ IDEA at 2022/4/1
*/ // */
@Slf4j //@Slf4j
@Service //@Service
public class GoblinGalaxyService { //public class GoblinGalaxyService {
@Value("${liquidnet.service.galaxy.url}") // @Value("${liquidnet.service.galaxy.url}")
private String serviceGalaxyUrl; // private String serviceGalaxyUrl;
//
//// /**
//// * NFT素材上传
//// *
//// * @param nftUploadReqDto GalaxyNftUploadReqDto
//// * @return GalaxyNftUploadRespDto
//// */
//// public GalaxyNftUploadRespDto uploadNftMaterial(GalaxyNftUploadReqDto nftUploadReqDto) {
//// String postUrl = serviceGalaxyUrl + "/galaxy/artwork/nftUpload";
//// String postBody = JsonUtils.toJson(nftUploadReqDto);
//// 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素材上传:请求失败[paramsStr={},postRespStr={}]", postBody, postRespStr);
//// return null;
//// }
//// return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyNftUploadRespDto.class);
//// } catch (Exception e) {
//// log.error("Ex.NFT素材上传:请求异常[url={},paramsStr={}],ex:{}", postUrl, postBody, e.getMessage());
//// return null;
//// }
//// }
////
//// /**
//// * NFT系列声明
//// *
//// * @param seriesClaimReqDto GalaxyArtSeriesClaimReqDto
//// * @return GalaxyArtSeriesClaimRespDto
//// */
//// public GalaxyArtSeriesClaimRespDto claimNftSeries(GalaxyArtSeriesClaimReqDto seriesClaimReqDto) {
//// String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaim";
//// String postBody = JsonUtils.toJson(seriesClaimReqDto);
//// 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系列声明:请求失败[paramsStr={},postRespStr={}]", postBody, postRespStr);
//// return null;
//// }
//// return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyArtSeriesClaimRespDto.class);
//// } catch (Exception e) {
//// log.error("Ex.NFT系列声明:请求异常[url={},paramsStr={}],ex:{}", postUrl, postBody, e.getMessage());
//// return null;
//// }
//// }
//
// /** // /**
// * NFT素材上传 // * NFT发行、购买结果查询
// * // *
// * @param nftUploadReqDto GalaxyNftUploadReqDto // * @param uid
// * @return GalaxyNftUploadRespDto // * @param orderId
// * @param routerType
// * @return
// */ // */
// public GalaxyNftUploadRespDto uploadNftMaterial(GalaxyNftUploadReqDto nftUploadReqDto) { // public List<String> checkNftTradeResult(String uid, String orderId, String routerType) {
// String postUrl = serviceGalaxyUrl + "/galaxy/artwork/nftUpload"; // ObjectNode postBodyNode = JsonUtils.OM().createObjectNode();
// String postBody = JsonUtils.toJson(nftUploadReqDto); // postBodyNode.put("userId", uid);
// postBodyNode.put("nftOrderPayId", orderId);
// postBodyNode.put("routerType", routerType);
//
// String postUrl = serviceGalaxyUrl + "/galaxy/nftTrade/nftPublishAndBuyResultQuery";
// 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("#NFT素材上传:请求失败[paramsStr={},postRespStr={}]", postBody, postRespStr); // log.warn("#NFT发行购买结果查询:查询失败[postBody={},postRespStr={}]", postBodyNode, postRespStr);
// return null; // return null;
// } // }
// return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyNftUploadRespDto.class); // JsonNode postRespDataJNode = postRespJNode.get("data");
//
// List<String> respDataList = CollectionUtil.arrayListString();
// respDataList.add(postRespDataJNode.get("nftId").asText());
// respDataList.add(postRespDataJNode.get("nftPublishChainTimestamp").asText());
// respDataList.add(postRespDataJNode.get("nftPublishTradeHash").asText());
// respDataList.add(postRespDataJNode.get("nftBuyChainTimestamp").asText());
// respDataList.add(postRespDataJNode.get("nftBuyTradeHash").asText());
// return respDataList;
// } catch (Exception e) { // } catch (Exception e) {
// log.error("Ex.NFT素材上传:请求异常[url={},paramsStr={}],ex:{}", postUrl, postBody, e.getMessage()); // log.error("Ex.NFT发行购买结果查询:请求异常[url={},postBody={}],ex:{}", postUrl, postBodyNode, e.getMessage());
// return null; // return null;
// } // }
// } // }
// //
// /** // /**
// * NFT系列声明 // * NFT发行、购买结果查询
// * // *
// * @param seriesClaimReqDto GalaxyArtSeriesClaimReqDto // * @param queryReqDto GalaxyNftPublishAndBuyResultBatchQueryReqDto
// * @return GalaxyArtSeriesClaimRespDto // * @return GalaxyNftPublishAndBuyResultBatchQueryRespDto
// */ // */
// public GalaxyArtSeriesClaimRespDto claimNftSeries(GalaxyArtSeriesClaimReqDto seriesClaimReqDto) { // public GalaxyNftPublishAndBuyResultBatchQueryRespDto checkNftTradeResultBatch(GalaxyNftPublishAndBuyResultBatchQueryReqDto queryReqDto) {
// String postUrl = serviceGalaxyUrl + "/galaxy/artwork/seriesClaim"; // String postUrl = serviceGalaxyUrl + "/galaxy/nftTrade/nftPublishAndBuyResultBatchQuery";
// String postBody = JsonUtils.toJson(seriesClaimReqDto); // String postBody = JsonUtils.toJson(queryReqDto);
// try { // try {
// String postRespStr = HttpUtil.postRaw(postUrl, postBody, null); // String postRespStr = HttpUtil.postRaw(postUrl, postBody, 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("#NFT系列声明:请求失败[paramsStr={},postRespStr={}]", postBody, postRespStr); // log.warn("#NFT发行购买结果查询:查询失败[postBody={},postRespStr={}]", postBody, postRespStr);
// return null; // return null;
// } // }
// return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyArtSeriesClaimRespDto.class); // return JsonUtils.OM().convertValue(postRespJNode.get("data"), GalaxyNftPublishAndBuyResultBatchQueryRespDto.class);
// } catch (Exception e) { // } catch (Exception e) {
// log.error("Ex.NFT系列声明:请求异常[url={},paramsStr={}],ex:{}", postUrl, postBody, e.getMessage()); // log.error("Ex.NFT发行购买结果查询:请求异常[url={},postBody={}],ex:{}", postUrl, postBody, e.getMessage());
// return null; // return null;
// } // }
// } // }
//}
/**
* NFT发行、购买结果查询
*
* @param uid
* @param orderId
* @param routerType
* @return
*/
public List<String> checkNftTradeResult(String uid, String orderId, String routerType) {
ObjectNode postBodyNode = JsonUtils.OM().createObjectNode();
postBodyNode.put("userId", uid);
postBodyNode.put("nftOrderPayId", orderId);
postBodyNode.put("routerType", routerType);
String postUrl = serviceGalaxyUrl + "/galaxy/nftTrade/nftPublishAndBuyResultQuery";
try {
String postRespStr = HttpUtil.postRaw(postUrl, postBodyNode.toString(), 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={}]", postBodyNode, postRespStr);
return null;
}
JsonNode postRespDataJNode = postRespJNode.get("data");
List<String> respDataList = CollectionUtil.arrayListString();
respDataList.add(postRespDataJNode.get("nftId").asText());
respDataList.add(postRespDataJNode.get("nftPublishChainTimestamp").asText());
respDataList.add(postRespDataJNode.get("nftPublishTradeHash").asText());
respDataList.add(postRespDataJNode.get("nftBuyChainTimestamp").asText());
respDataList.add(postRespDataJNode.get("nftBuyTradeHash").asText());
return respDataList;
} catch (Exception e) {
log.error("Ex.NFT发行购买结果查询:请求异常[url={},postBody={}],ex:{}", postUrl, postBodyNode, e.getMessage());
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;
}
}
}
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>liquidnet-service-goblin-impl</module> <module>liquidnet-service-goblin-impl</module>
<module>liquidnet-service-goblin-common</module>
</modules> </modules>
<properties> <properties>
......
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