diff --git a/sky-server/src/main/java/com/sky/controller/user/ShoppingCartController.java b/sky-server/src/main/java/com/sky/controller/user/ShoppingCartController.java index b3b2265..83a0a59 100644 --- a/sky-server/src/main/java/com/sky/controller/user/ShoppingCartController.java +++ b/sky-server/src/main/java/com/sky/controller/user/ShoppingCartController.java @@ -7,13 +7,14 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; @RestController -@RequestMapping("/user/shopping") +@RequestMapping("/user/shoppingCart") @Slf4j @Api(tags = "C端购物车相关接口") public class ShoppingCartController { @@ -28,8 +29,8 @@ public class ShoppingCartController { * @return Result */ @ApiOperation("添加购物车") - @PostMapping("add") - public Result add(ShoppingCartDTO shoppingCartDTO) { + @PostMapping("/add") + public Result add(@RequestBody ShoppingCartDTO shoppingCartDTO) { log.info("添加购物车:{}", shoppingCartDTO); shoppingCartService.addShoppingCart(shoppingCartDTO); return Result.success(); diff --git a/sky-server/src/main/resources/mapper/ShoppingCart.xml b/sky-server/src/main/resources/mapper/ShoppingCart.xml index 6ccddab..4cd451d 100644 --- a/sky-server/src/main/resources/mapper/ShoppingCart.xml +++ b/sky-server/src/main/resources/mapper/ShoppingCart.xml @@ -22,7 +22,7 @@ from shopping_cart - and userId = #{userId} + and user_id = #{userId} and setmeal_id = #{setmealId}