From 764db21f7f3c543899109b4e9c9c1ddcce148e09 Mon Sep 17 00:00:00 2001 From: xyiege Date: Tue, 7 Mar 2023 15:01:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8C=89=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../szwh/controller/api/GoodsController.java | 18 +++++++++++++----- .../szwh/service/impl/GoodsServiceImpl.java | 6 ++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java b/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java index 9387247..c72bd31 100644 --- a/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java +++ b/src/main/java/cn/chjyj/szwh/controller/api/GoodsController.java @@ -3,6 +3,7 @@ package cn.chjyj.szwh.controller.api; import cn.chjyj.szwh.bean.Goods; import cn.chjyj.szwh.controller.BaseController; import cn.chjyj.szwh.service.GoodsService; +import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -133,13 +134,18 @@ public class GoodsController extends BaseController { /** * 根据类型获取委托信息 * - * @param type - * @param createtime - * @param goods_type +// * @param type +// * @param createtime +// * @param goods_type * @return */ @RequestMapping("/getTypeGoods") - public JSONObject getTypeGoods(String type, String createtime, String goods_type) { + public JSONObject getTypeGoods(HttpServletRequest request) { + log.info("get_type_goods:"); + String type = request.getParameter("type"); + log.info(type); + String createtime = request.getParameter("createtime"); + String goods_type = request.getParameter("goods_type"); //10长的时间戳 long startTime = System.currentTimeMillis(); List goodsList = goodsService.getTypeGoods(type, createtime, goods_type); @@ -153,7 +159,9 @@ public class GoodsController extends BaseController { } @RequestMapping("/getTypeGoods/{type}") - public JSONObject getTypeGoodsRest(@PathVariable String type) { + public JSONObject getTypeGoodsRest(@PathVariable String type,@RequestBody String reqstr) { + log.info("get type goods json:"); + log.info(reqstr); long startTime = System.currentTimeMillis(); List goodsList = goodsService.getTypeGoods(type, "", ""); long endtime = System.currentTimeMillis(); diff --git a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java index b3d895f..6bb5cd7 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/GoodsServiceImpl.java @@ -567,12 +567,10 @@ public class GoodsServiceImpl implements GoodsService { if ("1".equals(type)) { limit=10; orderKey="click_count"; - } - if ("2".equals(type)) { + }else if ("2".equals(type)) { limit=10; orderKey="click_count"; - } - if ("3".equals(type)) { + } else{ orderKey="recommend_sort"; qmap.put("g.is_recommend",1); qmap.put("g.goods_status",1);