|
|
@@ -339,6 +339,11 @@ public class GoodsDonController {
|
|
|
return yhShopGoodsDetail;
|
|
|
}
|
|
|
String goodsDetailKey = RedisService.key.YH_HOME_PAGHE_CACHE.getEnvName() + "goods_detail:" + id;
|
|
|
+ List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
+ //存在过滤平台 商品详情不返回
|
|
|
+ if (CollUtil.isNotEmpty(filter_goodsIds) && filter_goodsIds.contains(id)) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
Object o = redisService.get(goodsDetailKey);
|
|
|
if (o == null) {
|
|
|
GoodsFrontListView views = beanSearcher.searchFirst(GoodsFrontListView.class, MapUtils.builder().field(GoodsFrontListView::getId, id)
|
|
|
@@ -597,19 +602,19 @@ public class GoodsDonController {
|
|
|
}
|
|
|
|
|
|
public List<Long> getFilterGoodsIds() {
|
|
|
- //过滤杭州Ai ChatGPT平台
|
|
|
- //获取当前ip地址
|
|
|
- SysConfig sysConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
- .eq(SysConfig::getSysKey, Constant.LOCATION_FOR_GOODS_IDS).last("limit 1"));
|
|
|
List<Long> filter_goodsIds = null;
|
|
|
- if (sysConfig != null && StrUtil.isNotBlank(sysConfig.getSysValue())) {
|
|
|
- if (StringUtil.getRealAddressByIP(ServletUtil.getClientIP(request)).contains("杭州")) {
|
|
|
- try {
|
|
|
- filter_goodsIds = Jsons.parseList(sysConfig.getSysValue(), Long.class);
|
|
|
- } catch (Exception e) {
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //获取当前ip地址
|
|
|
+ if (StringUtil.getRealAddressByIP(ServletUtil.getClientIP(request)).contains("杭州")) {
|
|
|
+ //过滤杭州Ai ChatGPT平台
|
|
|
+ SysConfig sysConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class)
|
|
|
+ .eq(SysConfig::getSysKey, Constant.LOCATION_FOR_GOODS_IDS).last("limit 1"));
|
|
|
+ if (sysConfig != null && StrUtil.isNotBlank(sysConfig.getSysValue())) {
|
|
|
+ try {
|
|
|
+ filter_goodsIds = Jsons.parseList(sysConfig.getSysValue(), Long.class);
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return filter_goodsIds;
|
|
|
}
|
|
|
|