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

Commit 82758980 authored by anjiabin's avatar anjiabin

实现百度链转让-消费

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