插入购物车数据-修改bug
This commit is contained in:
parent
2ffc04318f
commit
f46e752a40
|
@ -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<String> add(ShoppingCartDTO shoppingCartDTO) {
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody ShoppingCartDTO shoppingCartDTO) {
|
||||
log.info("添加购物车:{}", shoppingCartDTO);
|
||||
shoppingCartService.addShoppingCart(shoppingCartDTO);
|
||||
return Result.success();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
from shopping_cart
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
and userId = #{userId}
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="setmealId != null">
|
||||
and setmeal_id = #{setmealId}
|
||||
|
|
Loading…
Reference in New Issue