更新了商品类别
This commit is contained in:
parent
f8a5625a21
commit
110b49d2fc
|
@ -24,7 +24,10 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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 java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
@ -142,11 +145,11 @@ public class CartRecordController {
|
|||
|
||||
|
||||
/**
|
||||
* (小程序)从购物车中找出不合理的商品项
|
||||
* (小程序端)从购物车中找出不合理的商品项
|
||||
* @return 存在问题的购物车id列表
|
||||
*/
|
||||
@PostMapping("/cart/list/error")
|
||||
@Operation(summary = "(小程序)从购物车中找出不合理的商品项", description = "参数:无,权限:所有人,方法名:listInvalidCartIds")
|
||||
@PostMapping("/submit/error")
|
||||
@Operation(summary = "(小程序端)从购物车中找出不合理的商品项", description = "参数:无,权限:所有人,方法名:listInvalidCartIds")
|
||||
public BaseResponse<List<Long>> listInvalidCartIds (HttpServletRequest request) {
|
||||
User loginUser = userService.getLoginUser(request);
|
||||
Long userId = loginUser.getId();
|
||||
|
@ -163,12 +166,12 @@ public class CartRecordController {
|
|||
|
||||
|
||||
/**
|
||||
* (小程序)展示购物车提交订单页的商品信息
|
||||
* (小程序端)展示购物车提交订单页的商品信息
|
||||
* @param cartRecordIds 购物车id列表
|
||||
* @return 订单商品信息列表
|
||||
*/
|
||||
@PostMapping("/cart/list")
|
||||
@Operation(summary = "(小程序)展示购物车提交订单页的商品信息", description = "参数:商品id和购买数量信息,权限:所有人,方法名:listCartRecord")
|
||||
@PostMapping("/submit/list")
|
||||
@Operation(summary = "(小程序端)展示购物车提交订单页的商品信息", description = "参数:商品id和购买数量信息,权限:所有人,方法名:listCartRecord")
|
||||
public BaseResponse<List<CartOrderVO>> listCartRecord(@RequestBody List<Long> cartRecordIds, HttpServletRequest request) {
|
||||
if (CollectionUtils.isEmpty(cartRecordIds)) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR);
|
||||
|
@ -217,5 +220,4 @@ public class CartRecordController {
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -681,5 +681,17 @@ public class GoodController {
|
|||
|
||||
|
||||
|
||||
// /**
|
||||
// * (小程序端)在支付订单前找出不合理的商品项
|
||||
// * @return 存在问题的购物车id列表
|
||||
// */
|
||||
// @PostMapping("/cart/pay/error")
|
||||
// @Operation(summary = "(小程序端)在支付订单前找出不合理的商品项", description = "参数:无,权限:所有人,方法名:listInvalidCartIds")
|
||||
// public BaseResponse<List<Long>> listInvalidCartIdsBeforePay(@RequestBody List<CartPayRequest> cartPayRequests, HttpServletRequest request) {
|
||||
// User loginUser = userService.getLoginUser(request);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.cultural.heritage.model.dto.cart;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@Schema(description = "购物车商品项支付请求体", requiredProperties = {"id", "quantity"})
|
||||
public class CartPayRequest {
|
||||
|
||||
/**
|
||||
* 购物车id
|
||||
*/
|
||||
@Schema(description = "购物车id(id > 0)", example = "20")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@Schema(description = "商品数量(quantity > 0)", example = "3")
|
||||
private Integer quantity;
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
Loading…
Reference in New Issue
Block a user