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

Commit 9606a7ef authored by zhengfuxin's avatar zhengfuxin

NFT支持降级查询

parent 983cfb1a
......@@ -22,6 +22,8 @@ import java.util.stream.Collectors;
public class KylinRedisUtils {
@Autowired
RedisUtil redisUtil;
@Autowired
GoblinMongodbUtils goblinMongoUtils;
private int randomMax = 10;
......@@ -41,11 +43,17 @@ public class KylinRedisUtils {
String[] spuSplitArr = spuId.split(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue());
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuSplitArr[0]);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getGoodsInfoVo(spuId))) {
redisUtil.set(rk, vo);
}
if (vo == null) {
return vo;
}
String marketrk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo marketVo = (GoblinGoodsInfoVo) redisUtil.get(marketrk);
if (null == marketVo && null != (marketVo = goblinMongoUtils.getGoodsInfoVo(spuId))) {
redisUtil.set(marketrk, marketVo);
}
if (marketVo == null) {
return marketVo;
}
......@@ -63,6 +71,9 @@ public class KylinRedisUtils {
} else {
String rk = GoblinRedisConst.BASIC_GOODS.concat(spuId);
GoblinGoodsInfoVo vo = (GoblinGoodsInfoVo) redisUtil.get(rk);
if (null == vo && null != (vo = goblinMongoUtils.getGoodsInfoVo(spuId))) {
redisUtil.set(rk, vo);
}
return vo;
}
}
......
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