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

Commit c7c679e9 authored by jiangxiulong's avatar jiangxiulong

增加code换id

parent bded5e0b
......@@ -120,6 +120,7 @@ public class GoblinRedisConst {
/* --------------------------------NFT--------------------------------- */
public static final String REDIS_GOBLIN_NFT_ORDER_INFO = PREFIX.concat("nftOrder:");// nft订单详情 orderId
public static final String REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE = PREFIX.concat("nftOrder:orderCode:");// nft订单详情 orderCode
public static final String REDIS_GOBLIN_NFT_ORDER_USER_ID_LIST = PREFIX.concat("nftOrder:idList:user:");// nft用户订单id列表 userId
public static final String REDIS_GOBLIN_NFT_ORDER_REFUND_INFO = PREFIX.concat("nftOrder:refund:");// nft退款订单详情 orderId
public static final String REDIS_GOBLIN_NFT_ORDER_BUG_LOCK = PREFIX.concat("nftOrder:lock:userId:");// nft购买用户锁 userId
......
......@@ -398,6 +398,7 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
// redis 订单详情
nftOrderUtils.setNftOrder(orderVo);
nftOrderUtils.setNftOrderIdOfCode(nftOrder.getOrderCode(), nftOrder.getOrderId());
// redis 订单列表
// nftOrderUtils.addNftOrderList(uid, orderVo.getOrderId());
......@@ -534,11 +535,15 @@ public class GoblinNftOrderServiceImpl implements IGoblinNftOrderService {
log.info("NFT支付回调 参数: " + syncOrderParam.toString());
String orderCode = syncOrderParam.getOrderCode();
String orderId = syncOrderParam.getOrderId();
String orderId = nftOrderUtils.getNftOrderIdOfCode(orderCode);
if (orderId.isEmpty()) {
log.error("Nft订单不存在1 param:[orderCode:{}]", orderCode);
return "fail";
}
GoblinNftOrderVo orderVo = nftOrderUtils.getNftOrder(orderId);
if (null == orderVo) {
log.error("Nft订单不存在 param:[orderCode:{}]", orderCode);
log.error("Nft订单不存在2 param:[orderCode:{}]", orderCode);
return "fail";
}
if (!orderVo.getPayCode().equals(syncOrderParam.getCode())) {
......
......@@ -84,6 +84,22 @@ public class GoblinNftOrderUtils {
}
}
// code换id
public void setNftOrderIdOfCode(String orderCode, String orderId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE.concat(orderCode);
redisUtil.set(redisKey, orderId);
}
// code换id
public String getNftOrderIdOfCode(String orderCode) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_ORDER_ID_OF_CODE.concat(orderCode);
Object obj = redisUtil.get(redisKey);
if (obj == null) {
return "";
} else {
return (String) obj;
}
}
// 添加 订单id列表
public void addNftOrderList(String uid, String orderId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_NFT_ORDER_USER_ID_LIST.concat(uid);
......
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