|
@@ -20,6 +20,7 @@ import com.cyksj.mapper.SysConfigMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.views.*;
|
|
import com.cyksj.model.views.*;
|
|
|
import com.cyksj.redis.RedisService;
|
|
import com.cyksj.redis.RedisService;
|
|
|
|
|
+import com.cyksj.service.shop.YhShopFrontService;
|
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
import com.ejlchina.searcher.SearchResult;
|
|
@@ -61,6 +62,8 @@ public class GoodsDonController {
|
|
|
|
|
|
|
|
private final SysConfigMapper sysConfigMapper;
|
|
private final SysConfigMapper sysConfigMapper;
|
|
|
|
|
|
|
|
|
|
+ private final YhShopFrontService yhShopFrontService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取商品列表
|
|
* 获取商品列表
|
|
|
*/
|
|
*/
|
|
@@ -159,7 +162,11 @@ public class GoodsDonController {
|
|
|
* 官网首页 平台列表
|
|
* 官网首页 平台列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/list")
|
|
@GetMapping("/get/list")
|
|
|
- public Result<List<GoodsFrontListView>> getGoodsList() {
|
|
|
|
|
|
|
+ public Result<Object> getGoodsList(String customId) {
|
|
|
|
|
+ if (StrUtil.isNotBlank(customId)) {
|
|
|
|
|
+ Result<List<YhShopGoodsFrontView>> shopGoods = getShopGoods(yhShopFrontService.getYhsIdByCustomId(customId));
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(shopGoods);
|
|
|
|
|
+ }
|
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
|
|
String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
@@ -173,7 +180,7 @@ public class GoodsDonController {
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
//设置特定价格
|
|
//设置特定价格
|
|
|
setSpecificPrice(list, fUid);
|
|
setSpecificPrice(list, fUid);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(Optional.ofNullable(list));
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
}
|
|
}
|
|
@@ -201,7 +208,7 @@ public class GoodsDonController {
|
|
|
redisService.setNx(pcCacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
redisService.setNx(pcCacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
//设置特定价格
|
|
//设置特定价格
|
|
|
setSpecificPrice(list, fUid);
|
|
setSpecificPrice(list, fUid);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(Optional.of(list));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -209,7 +216,11 @@ public class GoodsDonController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/get/homePage")
|
|
@GetMapping("/get/homePage")
|
|
|
@Deprecated
|
|
@Deprecated
|
|
|
- public Result<List<GoodsFrontListView>> getGoodsHomePage() {
|
|
|
|
|
|
|
+ public Result<Object> getGoodsHomePage(String customId) {
|
|
|
|
|
+ if (StrUtil.isNotBlank(customId)) {
|
|
|
|
|
+ Result<List<YhShopGoodsFrontView>> shopGoods = getShopGoods(yhShopFrontService.getYhsIdByCustomId(customId));
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(shopGoods);
|
|
|
|
|
+ }
|
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
List<Long> filter_goodsIds = getFilterGoodsIds();
|
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
|
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
if (CollUtil.isNotEmpty(filter_goodsIds)) {
|
|
@@ -223,7 +234,7 @@ public class GoodsDonController {
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
//设置特定价格
|
|
//设置特定价格
|
|
|
setSpecificPrice(list, fUid);
|
|
setSpecificPrice(list, fUid);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(Optional.ofNullable(list));
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
}
|
|
}
|
|
@@ -243,7 +254,7 @@ public class GoodsDonController {
|
|
|
redisService.setNx(h5CacheKey, dataList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
redisService.setNx(h5CacheKey, dataList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
|
|
|
//设置特定价格
|
|
//设置特定价格
|
|
|
setSpecificPrice(dataList, fUid);
|
|
setSpecificPrice(dataList, fUid);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(dataList);
|
|
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(Optional.of(dataList));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|