| | |
| | | } |
| | | |
| | | @ApiOperation(value = "查询微商城购物车数量", notes = "") |
| | | @PostMapping(value = "/getUserCartCount/{shopId}/{cartType}") |
| | | @PostMapping(value = "/getUserCartCount/{shopId}") |
| | | public |
| | | @ResponseBody |
| | | AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) { |
| | | AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId(),cartType); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId()); |
| | | if (userCartCount == null) { |
| | | userCartCount = 0; |
| | | } |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); |
| | | } |
| | | int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(), |
| | | loginUser.getOpenId(),shoppingCart.getCartType()); |
| | | loginUser.getOpenId()); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | result.putInMap("userCartCount", userCartCount); |
| | | return result; |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}/{cartType}") |
| | | @PostMapping("/updateCartAllSelected/{shopId}/{isSelected}") |
| | | @ResponseBody |
| | | public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, |
| | | @PathVariable("shopId") Long shopId,@PathVariable("cartType") Integer cartType) { |
| | | @PathVariable("shopId") Long shopId) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected,cartType); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(),shopId, isSelected); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | | } |