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

Commit 2dd5cdf8 authored by jiangxiulong's avatar jiangxiulong

exchange

parent 84375f7f
......@@ -25,4 +25,6 @@ public interface IGoblinNftOrderService {
String syncOrder(GoblinNftOrderPayCallbackParam syncOrderParam);
String refundSyncOrder(GoblinNftOrderRefundCallbackParam refundCallbackParam);
Boolean exchange(String code);
}
......@@ -70,4 +70,20 @@ public class GoblinNftOrderController {
return iGoblinNftOrderService.refundSyncOrder(refundCallbackParam);
}
@PostMapping("exchange")
@ApiOperation("兑换")
@ApiImplicitParams({
@ApiImplicitParam(type = "from", required = true, dataType = "String", name = "code", value = "兑换码", example = "1"),
})
public ResponseDto<Boolean> exchange(
@RequestParam("code") @NotBlank(message = "兑换码不能为空") String code
) {
Boolean res = iGoblinNftOrderService.exchange(code);
if (res) {
return ResponseDto.success();
} else {
return ResponseDto.failure();
}
}
}
......@@ -748,6 +748,21 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
return "success";
}
@Override
public Boolean exchange(String code) {
try {
// 加锁
// 验证
//1code是否存在 2是否在生效日期内 3是否未兑换的状态 4兑换限购
// 使用
// 下单
return true;
} catch (Exception e) {
log.error("Error", e);
return false;
}
}
/* --------------------------------------------------------------------------------- */
/**
......@@ -803,4 +818,5 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
initUserDigitalArtworkObjs.add(new Object[]{digitalArtworkVo.getArtworkId(), skuId, uid, orderId, source, digitalArtworkVo.getState(), now});
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.SQL_ARTWORK_GEN.getKey(), SqlMapping.gets(toMqSqls, initUserDigitalArtworkObjs));
}
}
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