|
|
@@ -153,7 +153,12 @@ public class GoodsDonController {
|
|
|
*/
|
|
|
@GetMapping("/get/list")
|
|
|
public Result<List<GoodsFrontListView>> getGoodsList() {
|
|
|
- Object value = redisService.get(RedisService.key.PC_WEB_CACHE.getName());
|
|
|
+ List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
+ String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
|
|
|
+ if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
+ pcCacheKey += ":hz-ip";
|
|
|
+ }
|
|
|
+ Object value = redisService.get(pcCacheKey);
|
|
|
if (value != null) {
|
|
|
try {
|
|
|
List<GoodsFrontListView> list = Jsons.parseObject(value, List.class);
|
|
|
@@ -163,7 +168,6 @@ public class GoodsDonController {
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
|
|
|
@@ -225,7 +229,7 @@ public class GoodsDonController {
|
|
|
notifyMsg.append("前有人购买");
|
|
|
data.setNotifyMsg(notifyMsg.toString());
|
|
|
});
|
|
|
- redisService.setNx(RedisService.key.PC_WEB_CACHE.getName(), list, RedisService.key.PC_WEB_CACHE.getTimeout());
|
|
|
+ redisService.setNx(pcCacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
}
|
|
|
|
|
|
@@ -234,7 +238,12 @@ public class GoodsDonController {
|
|
|
*/
|
|
|
@GetMapping("/get/homePage")
|
|
|
public Result<List<GoodsHomePageView>> getGoodsHomePage() {
|
|
|
- Object value = redisService.get(RedisService.key.H5_WEB_CACHE.getName());
|
|
|
+ List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
+ String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
|
+ if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
+ h5CacheKey += ":hz-ip";
|
|
|
+ }
|
|
|
+ Object value = redisService.get(h5CacheKey);
|
|
|
if (value != null) {
|
|
|
try {
|
|
|
List<GoodsHomePageView> list = Jsons.parseObject(value, List.class);
|
|
|
@@ -244,7 +253,6 @@ public class GoodsDonController {
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
|
builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
|
|
|
@@ -260,7 +268,7 @@ public class GoodsDonController {
|
|
|
data.setMonths(skuView.getMonths());
|
|
|
}
|
|
|
});
|
|
|
- redisService.setNx(RedisService.key.H5_WEB_CACHE.getName(), dataList, RedisService.key.H5_WEB_CACHE.getTimeout());
|
|
|
+ redisService.setNx(h5CacheKey, dataList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(dataList);
|
|
|
}
|
|
|
|