购物车修改及其地址参数修复
This commit is contained in:
1 parent
461cfaa18e
commit
fbd1af0c5e
3 files changed
+6
-4
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.app.modular.member.controller;
|
package com.ruoyi.app.modular.member.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.itmuch.lightsecurity.annotation.PreAuthorize;
|
import com.itmuch.lightsecurity.annotation.PreAuthorize;
|
||||||
import com.itmuch.lightsecurity.jwt.User;
|
import com.itmuch.lightsecurity.jwt.User;
|
||||||
import com.itmuch.lightsecurity.jwt.UserOperator;
|
import com.itmuch.lightsecurity.jwt.UserOperator;
|
||||||
@@ -86,8 +87,8 @@ public class UserController {
|
|||||||
|
|
||||||
@PostMapping(value = "/shop/user-address-del")
|
@PostMapping(value = "/shop/user-address-del")
|
||||||
@ApiOperation(value = "删除地址",notes = "删除地址")
|
@ApiOperation(value = "删除地址",notes = "删除地址")
|
||||||
public R delAddress(@RequestParam(value = "address_id",defaultValue = "0") int addressId){
|
public R delAddress(@Validated @RequestBody String jsonStr){
|
||||||
|
int addressId = Integer.valueOf(JSON.parseObject(jsonStr).get("address_id").toString());
|
||||||
boolean result = addressService.removeById(addressId);
|
boolean result = addressService.removeById(addressId);
|
||||||
if(result){
|
if(result){
|
||||||
return R.success("操作成功");
|
return R.success("操作成功");
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class MallController {
|
|||||||
@GetMapping("/shop/mall-cart-list")
|
@GetMapping("/shop/mall-cart-list")
|
||||||
@ApiOperation(value = "获取购物车列表",notes = "获取购物车列表")
|
@ApiOperation(value = "获取购物车列表",notes = "获取购物车列表")
|
||||||
public R cartList(@RequestParam(value = "page",defaultValue = "0") int page,
|
public R cartList(@RequestParam(value = "page",defaultValue = "0") int page,
|
||||||
@RequestParam(value = "limit",defaultValue = "10") int limit){
|
@RequestParam(value = "page_num",defaultValue = "10") int limit){
|
||||||
int userId = userOperator.getUser().getId();
|
int userId = userOperator.getUser().getId();
|
||||||
//goodsService.cartList(pageVO,userId);
|
//goodsService.cartList(pageVO,userId);
|
||||||
PageVO pageVO = new PageVO();
|
PageVO pageVO = new PageVO();
|
||||||
|
|||||||
+2
-1
@@ -258,8 +258,9 @@ public class GoodsServiceImpl extends ServiceImpl<StoreGoodsMapper, StoreGoods>
|
|||||||
.selectPage(pageModel,cartQueryWrapper);
|
.selectPage(pageModel,cartQueryWrapper);
|
||||||
List<StoreCart> storeCartList = storeCarts.getRecords();
|
List<StoreCart> storeCartList = storeCarts.getRecords();
|
||||||
List<CartDTO> carts = new ArrayList<>();
|
List<CartDTO> carts = new ArrayList<>();
|
||||||
CartDTO cartDTO = new CartDTO();
|
|
||||||
for (StoreCart storeCart : storeCartList) {
|
for (StoreCart storeCart : storeCartList) {
|
||||||
|
CartDTO cartDTO = new CartDTO();
|
||||||
StoreGoods storeGoods = getById(storeCart.getGoodsId());
|
StoreGoods storeGoods = getById(storeCart.getGoodsId());
|
||||||
cartDTO.setGoodsId(storeCart.getGoodsId());
|
cartDTO.setGoodsId(storeCart.getGoodsId());
|
||||||
cartDTO.setGoodsName(storeGoods.getGoodsName());
|
cartDTO.setGoodsName(storeGoods.getGoodsName());
|
||||||
|
|||||||
Reference in new issue
Block a user