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

Commit 82758980 authored by anjiabin's avatar anjiabin

实现百度链转让-消费

parent 27a723a8
package com.liquidnet.service.galaxy.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.aop.annotation.ControllerLog;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.service.IGalaxyTradeService;
import com.liquidnet.service.galaxy.utils.QueueUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -32,6 +37,9 @@ import javax.validation.Valid;
@Validated
@Slf4j
public class GalaxyTradeController {
@Autowired
private QueueUtil queueUtil;
@Resource(name = "galaxyTradeServiceImpl")
private IGalaxyTradeService galaxyTradeService;
......@@ -72,7 +80,14 @@ public class GalaxyTradeController {
@ApiOperation(value = "NFT转让")
@PostMapping(value = {"/que/nftTransfer"})
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(@Valid @RequestBody GalaxyNftTransferReqDto reqDto){
return galaxyTradeService.nftTransfer(reqDto);
ResponseDto<GalaxyNftTransferRespDto> responseDto = galaxyTradeService.nftTransfer(reqDto);
if(!responseDto.isSuccess()){
//系统异常允许重试
if(responseDto.getCode().equalsIgnoreCase(GalaxyErrorEnum.NFT_TRANSFER_ERROR.getCode())){
queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_TRANSFER.getKey(), JsonUtils.toJson(reqDto));
}
}
return ResponseDto.success();
}
@ControllerLog(description = "NFT转让结果查询")
......@@ -83,6 +98,14 @@ public class GalaxyTradeController {
return galaxyTradeService.nftTransferQuery(reqDto);
}
@ControllerLog(description = "NFT手工转让调试")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "NFT手工转让调试")
@PostMapping(value = {"/manual/nftTransfer"})
public ResponseDto<GalaxyNftTransferRespDto> nftManualTransfer(@Valid @RequestBody GalaxyNftTransferReqDto reqDto){
return galaxyTradeService.nftTransfer(reqDto);
}
// @ControllerLog(description = "NFT发行购买结果批量查询")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "NFT发行购买结果批量查询")
......
......@@ -3,7 +3,6 @@ package com.liquidnet.service.galaxy.service.impl;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.base.constant.MQConst;
import com.liquidnet.service.galaxy.constant.GalaxyErrorEnum;
import com.liquidnet.service.galaxy.dto.param.*;
import com.liquidnet.service.galaxy.router.strategy.GalaxyRouterStrategyContext;
import com.liquidnet.service.galaxy.service.IGalaxyTradeService;
......@@ -70,14 +69,7 @@ public class GalaxyTradeServiceImpl implements IGalaxyTradeService {
@Override
public ResponseDto<GalaxyNftTransferRespDto> nftTransfer(GalaxyNftTransferReqDto reqDto) {
ResponseDto<GalaxyNftTransferRespDto> responseDto = galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouterType()).nftTransfer(reqDto);
if(!responseDto.isSuccess()){
//系统异常允许重试
if(responseDto.getCode().equalsIgnoreCase(GalaxyErrorEnum.NFT_TRANSFER_ERROR.getCode())){
queueUtil.sendMsgByRedis(MQConst.GalaxyQueue.JSON_NFT_TRANSFER.getKey(), JsonUtils.toJson(reqDto));
}
}
return ResponseDto.success();
return galaxyRouterStrategyContext.getTradeStrategy(reqDto.getRouterType()).nftTransfer(reqDto);
}
@Override
......
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