GoodsDonController.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. package com.cyksj.web.controller.goods;
  2. import cn.hutool.core.collection.CollUtil;
  3. import cn.hutool.core.date.DateTime;
  4. import cn.hutool.core.date.DateUnit;
  5. import cn.hutool.core.date.DateUtil;
  6. import cn.hutool.core.util.RandomUtil;
  7. import cn.hutool.core.util.StrUtil;
  8. import cn.hutool.extra.servlet.ServletUtil;
  9. import com.baomidou.mybatisplus.core.toolkit.Assert;
  10. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  11. import com.cyksj.common.constant.Constant;
  12. import com.cyksj.common.util.Jsons;
  13. import com.cyksj.common.util.StringUtil;
  14. import com.cyksj.dto.Result;
  15. import com.cyksj.enums.GatewayResponse;
  16. import com.cyksj.mapper.GoodsDonSkuMapper;
  17. import com.cyksj.mapper.OrderDonMapper;
  18. import com.cyksj.mapper.RegisterOrderDonMapper;
  19. import com.cyksj.mapper.SysConfigMapper;
  20. import com.cyksj.model.entity.*;
  21. import com.cyksj.model.request.HomeManagementClickRecordReq;
  22. import com.cyksj.model.views.*;
  23. import com.cyksj.redis.RedisService;
  24. import com.cyksj.service.home.HomeManagementFrontService;
  25. import com.cyksj.web.util.StpUserUtil;
  26. import com.ejlchina.searcher.BeanSearcher;
  27. import com.ejlchina.searcher.SearchResult;
  28. import com.ejlchina.searcher.param.Operator;
  29. import com.ejlchina.searcher.util.MapBuilder;
  30. import com.ejlchina.searcher.util.MapUtils;
  31. import lombok.RequiredArgsConstructor;
  32. import lombok.extern.slf4j.Slf4j;
  33. import org.springframework.web.bind.annotation.*;
  34. import javax.servlet.http.HttpServletRequest;
  35. import java.util.Date;
  36. import java.util.List;
  37. import java.util.Optional;
  38. /**
  39. * @author chan
  40. * @date 2022/9/26 5:33 PM
  41. */
  42. @Slf4j
  43. @RestController
  44. @RequestMapping("/applets/goods")
  45. @RequiredArgsConstructor
  46. public class GoodsDonController {
  47. private final HttpServletRequest request;
  48. private final BeanSearcher beanSearcher;
  49. private final OrderDonMapper orderDonMapper;
  50. private final RegisterOrderDonMapper registerOrderDonMapper;
  51. private final GoodsDonSkuMapper goodsDonSkuMapper;
  52. private final RedisService redisService;
  53. private final SysConfigMapper sysConfigMapper;
  54. private final HomeManagementFrontService homeManagementFrontService;
  55. /**
  56. * 获取商品列表
  57. */
  58. @GetMapping("/get")
  59. public Result<SearchResult<GoodsDon>> get() {
  60. SearchResult<GoodsDon> search = beanSearcher.search(GoodsDon.class, MapUtils.flatBuilder(request.getParameterMap())
  61. .field(GoodsDon::getStatus, true)
  62. .field(GoodsDon::getDeleted, true)
  63. .orderBy(GoodsDon::getSortBy).desc()
  64. .orderBy(GoodsDon::getId).asc()
  65. .build()
  66. );
  67. search.getDataList().forEach(goods -> {
  68. GoodsDonSku goodsDonSku = goodsDonSkuMapper.selectOne(Wrappers.lambdaQuery(GoodsDonSku.class).eq(GoodsDonSku::getGoodsId, goods.getId())
  69. .eq(GoodsDonSku::getStatus, true)
  70. .orderByAsc(GoodsDonSku::getPrice)
  71. .last("limit 1")
  72. .select(GoodsDonSku::getPrice));
  73. Optional.ofNullable(goodsDonSku).ifPresent(sku->{
  74. goods.setPrice(goodsDonSku.getPrice());
  75. goods.setSoldNum(goods.getVirtualSold() + orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
  76. .eq(OrderDon::getGoodsId, goods.getId())
  77. .notIn(OrderDon::getStatus, Constant.noOrderStatus)));
  78. });
  79. });
  80. return GatewayResponse.SUCCESS.newBuilder().toResult(search);
  81. }
  82. /**
  83. * 推广未登录,虚拟商品列表
  84. */
  85. @GetMapping("/get/popularize")
  86. public Result<SearchResult<GoodsDonPopularizeView>> getPopularizeVipGoods() {
  87. SearchResult<GoodsDonPopularizeView> search = beanSearcher.search(GoodsDonPopularizeView.class, MapUtils.flatBuilder(request.getParameterMap())
  88. .field(GoodsDonPopularizeView::getStatus, true)
  89. .field(GoodsDonPopularizeView::getDeleted, true)
  90. .field(GoodsDonPopularizeView::getType, 1)
  91. .orderBy(GoodsDonPopularizeView::getSortBy).desc()
  92. .orderBy(GoodsDonPopularizeView::getId).asc()
  93. .build());
  94. DateTime now = DateTime.now();
  95. search.getDataList().forEach(data -> {
  96. data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
  97. data.setSkuList(beanSearcher.searchAll(GoodsDonSku.class, MapUtils.builder().field(GoodsDonSku::getGoodsId, data.getId()).field(GoodsDonSku::getStatus, true).orderBy(GoodsDonSku::getPrice).asc().build()));
  98. Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
  99. .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
  100. data.setSold(sold + data.getVirtualSold());
  101. Optional.ofNullable(data.getSkuList()).ifPresent(skuList -> {
  102. if (skuList.size() > 0) {
  103. GoodsDonSku goodsDonSku = skuList.get(0);
  104. data.setPrice(goodsDonSku.getPrice());
  105. data.setMonths(goodsDonSku.getMonths());
  106. }
  107. });
  108. OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
  109. .eq(OrderDon::getGoodsId, data.getId())
  110. .notIn(OrderDon::getStatus, Constant.noOrderStatus).select(OrderDon::getCreatedTime, OrderDon::getPayTime, OrderDon::getId)
  111. .orderByDesc(OrderDon::getId)
  112. .last("limit 1"));
  113. StringBuilder notifyMsg = new StringBuilder();
  114. if (orderDon == null) {
  115. notifyMsg.append("点击购买立即上车");
  116. data.setNotifyMsg(notifyMsg.toString());
  117. return;
  118. } else {
  119. Date payTime = orderDon.getPayTime();
  120. Date startTime = payTime != null ? payTime : orderDon.getCreatedTime();
  121. long hour = DateUtil.between(startTime, now, DateUnit.HOUR);
  122. if (hour == 0) {
  123. long minute = DateUtil.between(startTime, now, DateUnit.MINUTE);
  124. if (minute == 0) {
  125. notifyMsg.append("1分钟");
  126. } else {
  127. notifyMsg.append(minute);
  128. notifyMsg.append("分钟");
  129. }
  130. } else {
  131. if (hour > 3) {
  132. int hours = RandomUtil.randomInt(3) + 1;
  133. notifyMsg.append(hours);
  134. } else {
  135. notifyMsg.append(hour);
  136. }
  137. notifyMsg.append("小时");
  138. }
  139. }
  140. notifyMsg.append("前有人购买");
  141. data.setNotifyMsg(notifyMsg.toString());
  142. });
  143. return GatewayResponse.SUCCESS.newBuilder().toResult(search);
  144. }
  145. /**
  146. * 官网首页 平台列表
  147. */
  148. @GetMapping("/get/list")
  149. public Result<List<GoodsFrontListView>> getGoodsList() {
  150. List<Long> filter_goodsIds = getFilterGoodsIds();
  151. String pcCacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "PC";
  152. if (CollUtil.isNotEmpty(filter_goodsIds)) {
  153. pcCacheKey += ":hz-ip";
  154. }
  155. Object value = redisService.get(pcCacheKey);
  156. if (value != null) {
  157. try {
  158. List<GoodsFrontListView> list = Jsons.parseObject(value, List.class);
  159. if (CollUtil.isNotEmpty(list)) {
  160. return GatewayResponse.SUCCESS.newBuilder().toResult(list);
  161. }
  162. } catch (Exception e) {
  163. }
  164. }
  165. MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
  166. if (CollUtil.isNotEmpty(filter_goodsIds)) {
  167. builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
  168. }
  169. List<GoodsFrontListView> list = beanSearcher.searchAll(GoodsFrontListView.class, builder.build());
  170. DateTime now = DateTime.now();
  171. list.forEach(data -> {
  172. data.setSpecs(beanSearcher.searchFirst(GoodsDonSpec.class, MapUtils.builder().field(GoodsDonSpec::getGoodsId, data.getId()).build()));
  173. data.setSkuList(beanSearcher.searchAll(GoodsDonSkuFrontView.class, MapUtils.builder().field(GoodsDonSkuFrontView::getGoodsId, data.getId()).field(GoodsDonSkuFrontView::getStatus, true).orderBy(GoodsDonSkuFrontView::getPrice).asc().build()));
  174. data.getSkuList().forEach(sku -> {
  175. if (sku.getIsDp()) {
  176. List<GoodsDiscountPlusPurchaseRelationFrontView> dpSkuViews = beanSearcher.searchAll(GoodsDiscountPlusPurchaseRelationFrontView.class, MapUtils.builder().field(GoodsDiscountPlusPurchaseRelationFrontView::getSkuId, sku.getId()).build());
  177. sku.setDpSkuViews(dpSkuViews);
  178. }
  179. });
  180. Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
  181. .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
  182. data.setSold(sold + data.getVirtualSold());
  183. OrderCommentFrontView comments = beanSearcher.searchFirst(OrderCommentFrontView.class, MapUtils.builder()
  184. .field(OrderCommentFrontView::getGoodsId, data.getId())
  185. .orderBy(OrderCommentFrontView::getCommentTime).desc()
  186. .orderBy(OrderCommentFrontView::getId).desc()
  187. .build());
  188. data.setComments(comments);
  189. data.setNotifyMsg(getPayMsgTime(data.getId(), now, 1));
  190. });
  191. redisService.setNx(pcCacheKey, list, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
  192. return GatewayResponse.SUCCESS.newBuilder().toResult(list);
  193. }
  194. /**
  195. * h5 银河首页平台展示
  196. */
  197. @GetMapping("/get/homePage")
  198. public Result<List<GoodsHomePageView>> getGoodsHomePage() {
  199. List<Long> filter_goodsIds = getFilterGoodsIds();
  200. String h5CacheKey = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "H5";
  201. if (CollUtil.isNotEmpty(filter_goodsIds)) {
  202. h5CacheKey += ":hz-ip";
  203. }
  204. Object value = redisService.get(h5CacheKey);
  205. if (value != null) {
  206. try {
  207. List<GoodsHomePageView> list = Jsons.parseObject(value, List.class);
  208. if (CollUtil.isNotEmpty(list)) {
  209. return GatewayResponse.SUCCESS.newBuilder().toResult(list);
  210. }
  211. } catch (Exception e) {
  212. }
  213. }
  214. MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
  215. if (CollUtil.isNotEmpty(filter_goodsIds)) {
  216. builder.field(GoodsFrontListView::getId, filter_goodsIds).op(Operator.NotIn);
  217. }
  218. List<GoodsHomePageView> dataList = beanSearcher.searchAll(GoodsHomePageView.class, builder.build());
  219. DateTime now = DateTime.now();
  220. dataList.forEach(data -> {
  221. Integer sold = orderDonMapper.selectCount(Wrappers.lambdaQuery(OrderDon.class)
  222. .eq(OrderDon::getGoodsId, data.getId()).notIn(OrderDon::getStatus, Constant.noOrderStatus));
  223. data.setSold(sold + data.getVirtualSold());
  224. data.setNotifyMsg(getPayMsgTime(data.getId(), now, 1));
  225. });
  226. redisService.setNx(h5CacheKey, dataList, RedisService.key.YH_HOME_PAGHE_CACHE.getTimeout());
  227. return GatewayResponse.SUCCESS.newBuilder().toResult(dataList);
  228. }
  229. /**
  230. * 注册首页平台展示
  231. */
  232. @GetMapping("/get/register")
  233. public Result<List<RegisterGoodsDonView>> getRegisterGoodsDon() {
  234. String registerCacheKey = RedisService.key.REGISTER_HOME_PAGE_CACHE.getName();
  235. Object value = redisService.get(registerCacheKey);
  236. if (value != null) {
  237. try {
  238. List<RegisterGoodsDonView> list = Jsons.parseList(value, RegisterGoodsDonView.class);
  239. if (CollUtil.isNotEmpty(list)) {
  240. return GatewayResponse.SUCCESS.newBuilder().toResult(list);
  241. }
  242. } catch (Exception e) {
  243. }
  244. }
  245. MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
  246. List<RegisterGoodsDonView> dataList = beanSearcher.searchAll(RegisterGoodsDonView.class, builder.build());
  247. DateTime now = DateTime.now();
  248. dataList.forEach(data->{
  249. Integer sold = registerOrderDonMapper.selectCount(Wrappers.lambdaQuery(RegisterOrderDon.class)
  250. .eq(RegisterOrderDon::getGoodsId, data.getId()).notIn(RegisterOrderDon::getStatus, Constant.noOrderStatus));
  251. data.setSold(sold + data.getVirtualSold());
  252. data.setNotifyMsg(getPayMsgTime(data.getId(), now, 2));
  253. });
  254. redisService.setNx(registerCacheKey, dataList, RedisService.key.REGISTER_HOME_PAGE_CACHE.getTimeout());
  255. return GatewayResponse.SUCCESS.newBuilder().toResult(dataList);
  256. }
  257. /**
  258. * 获取商品详情
  259. */
  260. @GetMapping("/get/{id}")
  261. public Result<GoodsDonViews> getDetail(@PathVariable Long id) {
  262. GoodsDonViews views = beanSearcher.searchFirst(GoodsDonViews.class, MapUtils.builder().field(GoodsDonViews::getId, id).build());
  263. views.setSpecs(beanSearcher.searchFirst(GoodsDonSpecFrontView.class, MapUtils.builder().field(GoodsDonSpecFrontView::getGoodsId, views.getId()).build()));
  264. MapBuilder builder = MapUtils.builder().field(GoodsDonSku::getGoodsId, views.getId()).field(GoodsDonSku::getStatus, true);
  265. if (views.getType() == 1) {
  266. builder.orderBy(GoodsDonSku::getOrderBy).asc();
  267. }
  268. views.setSkuList(beanSearcher.searchAll(GoodsDonSkuFrontView.class, builder.build()));
  269. views.getSkuList().forEach(sku -> {
  270. if (sku.getIsDp()) {
  271. sku.setDpSkuViews(beanSearcher.searchAll(GoodsDiscountPlusPurchaseRelationFrontView.class, MapUtils.builder()
  272. .field(GoodsDiscountPlusPurchaseRelationFrontView::getSkuId, sku.getId())
  273. .build()));
  274. }
  275. });
  276. return GatewayResponse.SUCCESS.newBuilder().toResult(views);
  277. }
  278. /**
  279. * 获取商品推荐平台
  280. */
  281. @GetMapping("/get/recommend/{id}")
  282. public Result<List<GoodsRecommendViews>> getRecommendGoodsByGid(@PathVariable Long id) throws Exception {
  283. String key = RedisService.key.YH_HOME_PAGHE_CACHE.getName() + "recommend:" + id;
  284. Object value = redisService.get(key);
  285. if (value != null) {
  286. List<GoodsRecommendViews> goodsRecommendViews = Jsons.parseList(value.toString(), GoodsRecommendViews.class);
  287. return GatewayResponse.SUCCESS.newBuilder().toResult(goodsRecommendViews);
  288. }
  289. if (value == null) {
  290. GoodsDon goodsDon = beanSearcher.searchFirst(GoodsDon.class, MapUtils.builder()
  291. .field(GoodsDon::getId, id)
  292. .field(GoodsDon::getStatus, true)
  293. .field(GoodsDon::getDeleted, true)
  294. .build());
  295. if (goodsDon != null && StrUtil.isNotEmpty(goodsDon.getRecommendGoods())) {
  296. List<Long> recommend_gidList = Jsons.parseList(goodsDon.getRecommendGoods(), Long.class);
  297. List<GoodsRecommendViews> goodsRecommendViews = beanSearcher.searchAll(GoodsRecommendViews.class, MapUtils.builder().field(GoodsRecommendViews::getGoodsId, recommend_gidList).op(Operator.InList).build());
  298. goodsRecommendViews.forEach(data->{
  299. Integer sold = registerOrderDonMapper.selectCount(Wrappers.lambdaQuery(RegisterOrderDon.class)
  300. .eq(RegisterOrderDon::getGoodsId, data.getGoodsId()).notIn(RegisterOrderDon::getStatus, Constant.noOrderStatus));
  301. data.setSold(sold + data.getVirtualSold());
  302. });
  303. redisService.setNx(key, Jsons.toJson(goodsRecommendViews), 60 * 15l);
  304. return GatewayResponse.SUCCESS.newBuilder().toResult(goodsRecommendViews);
  305. }
  306. }
  307. return GatewayResponse.SUCCESS.newBuilder().toResult();
  308. }
  309. /**
  310. * 获取商品多规格列表
  311. */
  312. @GetMapping("/get/sku")
  313. public Result<List<GoodsDonSkuView>> getGoodsDonSkuView(@RequestParam(value = "skuIds") List<Long> skuIds) {
  314. if (skuIds.isEmpty()) {
  315. return GatewayResponse.SUCCESS.newBuilder().toResult();
  316. }
  317. List<GoodsDonSkuView> views = beanSearcher.searchAll(GoodsDonSkuView.class, MapUtils.builder()
  318. .field(GoodsDonSkuView::getSkuId, skuIds).op(Operator.InList)
  319. .build());
  320. return GatewayResponse.SUCCESS.newBuilder().toResult(views);
  321. }
  322. /**
  323. * 获取评价列表
  324. */
  325. @GetMapping("/get/comments")
  326. public Result<SearchResult<OrderCommentFrontView>> getComments() {
  327. SearchResult<OrderCommentFrontView> search = beanSearcher.search(OrderCommentFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
  328. .orderBy(OrderCommentFrontView::getCommentTime).desc()
  329. .orderBy(OrderCommentFrontView::getId).desc()
  330. .build());
  331. return GatewayResponse.SUCCESS.newBuilder().toResult(search);
  332. }
  333. public List<Long> getFilterGoodsIds() {
  334. //过滤杭州Ai ChatGPT平台
  335. //获取当前ip地址
  336. SysConfig sysConfig = sysConfigMapper.selectOne(Wrappers.lambdaQuery(SysConfig.class)
  337. .eq(SysConfig::getSysKey, Constant.LOCATION_FOR_GOODS_IDS).last("limit 1"));
  338. List<Long> filter_goodsIds = null;
  339. if (sysConfig != null && StrUtil.isNotBlank(sysConfig.getSysValue())) {
  340. if (StringUtil.getRealAddressByIP(ServletUtil.getClientIP(request)).contains("杭州")) {
  341. try {
  342. filter_goodsIds = Jsons.parseList(sysConfig.getSysValue(), Long.class);
  343. } catch (Exception e) {
  344. }
  345. }
  346. }
  347. return filter_goodsIds;
  348. }
  349. /**
  350. *
  351. * @param goodsId
  352. * @param type 1、普通,2、注册平台
  353. * @return
  354. */
  355. public String getPayMsgTime(Long goodsId, DateTime now, Integer type) {
  356. Date startTime = null;
  357. StringBuilder notifyMsg = new StringBuilder();
  358. if (type == 1) {
  359. OrderDon orderDon = orderDonMapper.selectOne(Wrappers.lambdaQuery(OrderDon.class)
  360. .eq(OrderDon::getGoodsId, goodsId)
  361. .notIn(OrderDon::getStatus, Constant.noOrderStatus).select(OrderDon::getCreatedTime, OrderDon::getPayTime, OrderDon::getId)
  362. .orderByDesc(OrderDon::getId)
  363. .last("limit 1"));
  364. if (orderDon == null) {
  365. notifyMsg.append("点击购买立即上车");
  366. return notifyMsg.toString();
  367. }
  368. startTime = orderDon.getPayTime() != null ? orderDon.getPayTime() : orderDon.getCreatedTime();
  369. } else if (type == 2) {
  370. RegisterOrderDon orderDon = registerOrderDonMapper.selectOne(Wrappers.lambdaQuery(RegisterOrderDon.class)
  371. .eq(RegisterOrderDon::getGoodsId, goodsId)
  372. .notIn(RegisterOrderDon::getStatus, Constant.noOrderStatus).select(RegisterOrderDon::getCreatedTime, RegisterOrderDon::getPayTime, RegisterOrderDon::getId)
  373. .orderByDesc(RegisterOrderDon::getId)
  374. .last("limit 1"));
  375. if (orderDon == null) {
  376. return null;
  377. }
  378. startTime = orderDon.getPayTime() != null ? orderDon.getPayTime() : orderDon.getCreatedTime();
  379. }
  380. long hour = DateUtil.between(startTime, now, DateUnit.HOUR);
  381. if (hour == 0) {
  382. long minute = DateUtil.between(startTime, now, DateUnit.MINUTE);
  383. if (minute == 0) {
  384. notifyMsg.append("1分钟");
  385. } else {
  386. notifyMsg.append(minute);
  387. notifyMsg.append("分钟");
  388. }
  389. } else {
  390. if (hour > 3) {
  391. int hours = RandomUtil.randomInt(3) + 1;
  392. notifyMsg.append(hours);
  393. } else {
  394. notifyMsg.append(hour);
  395. }
  396. notifyMsg.append("小时");
  397. }
  398. notifyMsg.append("前有人购买");
  399. return notifyMsg.toString();
  400. }
  401. /**
  402. * 获取首页配置列表
  403. */
  404. @GetMapping("/get/homeManage")
  405. public Result<List<HomeManagementFrontView>> getHomeManagementFrontPage() {
  406. List<HomeManagementFrontView> views = beanSearcher.searchAll(HomeManagementFrontView.class, MapUtils.flatBuilder(request.getParameterMap()).build());
  407. return GatewayResponse.SUCCESS.newBuilder().toResult(views);
  408. }
  409. /**
  410. * 记录首页配置 用户点击记录
  411. */
  412. @PostMapping("/homeManage/click")
  413. public Result<String> homeManageClick(@RequestBody HomeManagementClickRecordReq request) {
  414. Long userId = null;
  415. Boolean isLogin = request.getIsLogin();
  416. Long configId = request.getConfigId();
  417. Assert.notNull(configId, "参数错误");
  418. if (isLogin != null && isLogin) {
  419. userId = StpUserUtil.getLoginIdAsLong();
  420. }
  421. homeManagementFrontService.click(userId, configId);
  422. return GatewayResponse.SUCCESS.newBuilder().toResult();
  423. }
  424. }