You've already forked FrameTour-BE
当价格配置未命中缓存时,不返回空
This commit is contained in:
@ -25,10 +25,10 @@ public class PriceRepository {
|
|||||||
priceConfigEntity = JSON.parseObject(redisTemplate.opsForValue().get(cacheKey), PriceConfigEntity.class);
|
priceConfigEntity = JSON.parseObject(redisTemplate.opsForValue().get(cacheKey), PriceConfigEntity.class);
|
||||||
}
|
}
|
||||||
if (priceConfigEntity == null) {
|
if (priceConfigEntity == null) {
|
||||||
PriceConfigEntity priceConfig = mapper.getPriceByScenicTypeGoods(scenicId, type, goodsId);
|
priceConfigEntity = mapper.getPriceByScenicTypeGoods(scenicId, type, goodsId);
|
||||||
if (priceConfig != null) {
|
if (priceConfigEntity != null) {
|
||||||
redisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(priceConfig));
|
redisTemplate.opsForValue().set(cacheKey, JSON.toJSONString(priceConfigEntity));
|
||||||
redisTemplate.opsForValue().set(String.format(PRICE_ID_CACHE, priceConfig.getId()), JSON.toJSONString(priceConfig));
|
redisTemplate.opsForValue().set(String.format(PRICE_ID_CACHE, priceConfigEntity.getId()), JSON.toJSONString(priceConfigEntity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return priceConfigEntity;
|
return priceConfigEntity;
|
||||||
|
Reference in New Issue
Block a user