插入购物车数据-修改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 io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user/shopping")
|
@RequestMapping("/user/shoppingCart")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Api(tags = "C端购物车相关接口")
|
@Api(tags = "C端购物车相关接口")
|
||||||
public class ShoppingCartController {
|
public class ShoppingCartController {
|
||||||
|
@ -28,8 +29,8 @@ public class ShoppingCartController {
|
||||||
* @return Result
|
* @return Result
|
||||||
*/
|
*/
|
||||||
@ApiOperation("添加购物车")
|
@ApiOperation("添加购物车")
|
||||||
@PostMapping("add")
|
@PostMapping("/add")
|
||||||
public Result<String> add(ShoppingCartDTO shoppingCartDTO) {
|
public Result<String> add(@RequestBody ShoppingCartDTO shoppingCartDTO) {
|
||||||
log.info("添加购物车:{}", shoppingCartDTO);
|
log.info("添加购物车:{}", shoppingCartDTO);
|
||||||
shoppingCartService.addShoppingCart(shoppingCartDTO);
|
shoppingCartService.addShoppingCart(shoppingCartDTO);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
from shopping_cart
|
from shopping_cart
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
and userId = #{userId}
|
and user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
<if test="setmealId != null">
|
<if test="setmealId != null">
|
||||||
and setmeal_id = #{setmealId}
|
and setmeal_id = #{setmealId}
|
||||||
|
|
Loading…
Reference in New Issue