| | |
| | | import cc.mrbird.febs.mall.entity.MallShoppingCart; |
| | | import cc.mrbird.febs.mall.service.IApiMallShoppingCartService; |
| | | import cc.mrbird.febs.mall.vo.ShoppingCartGoodsVo; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @ApiOperation(value = "从购物车中删除商品", notes = "从购物车中删除商品") |
| | | @PostMapping(value = "/delGoods") |
| | | public FebsResponse delGoods(@RequestBody DelCartGoodsDto delCartGoodsDto) { |
| | | List<String> ids = StrUtil.split(delCartGoodsDto.getIds(), ','); |
| | | mallShoppingCartService.removeByIds(ids); |
| | | |
| | | if(CollUtil.isEmpty(delCartGoodsDto.getIds())){ |
| | | return new FebsResponse().fail().data("请选择要删除的商品"); |
| | | } |
| | | mallShoppingCartService.removeByIds(delCartGoodsDto.getIds()); |
| | | return new FebsResponse().success().data("删除成功"); |
| | | } |
| | | |