Преглед изворни кода

Merge branch 'goods_q&a' into pre

zoujiajian пре 2 година
родитељ
комит
8481b18706

+ 4 - 1
netflix-web/src/main/java/com/cyksj/web/controller/group/GroupRelationController.java

@@ -782,10 +782,13 @@ public class GroupRelationController {
      */
      */
     @GetMapping("/get/questions/{goodsId}")
     @GetMapping("/get/questions/{goodsId}")
     public Result<List<GoodsDonQaFrontView>> getTicketQuestions(@PathVariable Long goodsId, @RequestParam(defaultValue = "1") Integer type) {
     public Result<List<GoodsDonQaFrontView>> getTicketQuestions(@PathVariable Long goodsId, @RequestParam(defaultValue = "1") Integer type) {
+        if (type < 1 || type > 2) {
+            return GatewayResponse.SUCCESS.newBuilder().toResult();
+        }
         String key = RedisService.key.YH_GOODS_QUESTIONS_DETAIL.getNameFormat(type, goodsId);
         String key = RedisService.key.YH_GOODS_QUESTIONS_DETAIL.getNameFormat(type, goodsId);
         Object o = redisService.get(key);
         Object o = redisService.get(key);
         if (o == null) {
         if (o == null) {
-            List<GoodsDonQaFrontView> donQaFrontViews = beanSearcher.searchAll(GoodsDonQaFrontView.class, MapUtils.builder().field(GoodsDonQaFrontView::getGoodsId, goodsId).field(GoodsDonQaFrontView::getType, 2).build());
+            List<GoodsDonQaFrontView> donQaFrontViews = beanSearcher.searchAll(GoodsDonQaFrontView.class, MapUtils.builder().field(GoodsDonQaFrontView::getGoodsId, goodsId).field(GoodsDonQaFrontView::getType, type).build());
             if (CollUtil.isEmpty(donQaFrontViews)) {
             if (CollUtil.isEmpty(donQaFrontViews)) {
                 return GatewayResponse.SUCCESS.newBuilder().toResult();
                 return GatewayResponse.SUCCESS.newBuilder().toResult();
             }
             }