From c42c20b9c71c25ed119884ffe130ac013afb7f07 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期四, 19 六月 2025 09:02:34 +0800 Subject: [PATCH] 修改bug --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java index d6c9a9e..2cf993a 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java @@ -114,6 +114,14 @@ return R.ok(); } - + @RequestMapping(value = "/countShoppingCart", method = RequestMethod.POST) + @ApiOperation(value = "获取购物车数量") + public R<Integer> countShoppingCart() { + Long userId = SecurityUtils.getUserId(); + Member member = memberService.getMember(userId).getData(); + Long shopId = member.getRelationShopId(); + Integer count = shoppingCartService.countShoppingCart(userId, shopId); + return R.ok(count); + } } -- Gitblit v1.7.1