后端 + 前端:购物车详情

This commit is contained in:
YunaiV
2019-04-13 22:53:44 +08:00
parent fa5ea5dfd9
commit b2abc625d1
16 changed files with 497 additions and 144 deletions

View File

@@ -8,6 +8,7 @@ import cn.iocoder.mall.order.api.bo.OrderCreateBO;
import cn.iocoder.mall.order.api.dto.CalcOrderPriceDTO;
import org.springframework.lang.Nullable;
import java.util.Collection;
import java.util.List;
public interface CartService {
@@ -38,11 +39,11 @@ public interface CartService {
* 购物车更新商品是否选中
*
* @param userId 用户编号
* @param skuId 商品 SKU 编号
* @param skuIds 商品 SKU 编号数组
* @param selected 是否选中
* @return 是否成功
*/
CommonResult<Boolean> updateSelected(Integer userId, Integer skuId, Boolean selected);
CommonResult<Boolean> updateSelected(Integer userId, Collection<Integer> skuIds, Boolean selected);
/**
* 购物车删除商品
@@ -77,7 +78,7 @@ public interface CartService {
* @param selected 是否选中。若为空,则不进行筛选
* @return 购物车中商品列表信息
*/
List<CartItemBO> list(Integer userId, @Nullable Boolean selected);
CommonResult<List<CartItemBO>> list(Integer userId, @Nullable Boolean selected);
// ========== 购物车与订单相关的逻辑 ==========

View File

@@ -3,6 +3,8 @@ package cn.iocoder.mall.order.api.bo;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 购物车的商品信息 DO
*/
@@ -10,6 +12,89 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class CartItemBO {
// ========= 基础字段 BEGIN =========
/**
* 编号,唯一自增。
*/
private Integer id;
/**
* 状态
*
* 1-正常
* 2-主动删除
* 3-下单删除
*/
private Integer status;
/**
* 是否选中
*/
private Boolean selected;
// ========= 基础字段 END =========
// ========= 买家信息 BEGIN =========
/**
* 用户编号
*/
private Integer userId;
// /**
// * 会话 key
// */
// private String nobody;
// ========= 买家信息 END =========
// ========= 商品信息 BEGIN =========
/**
* 商品 SPU 编号
*/
private Integer spuId;
/**
* 商品 SKU 编号
*/
private Integer skuId;
/**
* 商品购买数量
*/
private Integer quantity;
// TODO 冗余字段
// ========= 商品信息 END =========
// ========= 交易信息 BEGIN =========
/**
* 订单编号
*/
private Integer orderId;
/**
* 订单创建时间
*/
private Date orderCreateTime;
// ========= 交易信息 BEGIN =========
// ========= 优惠信息 BEGIN =========
// /**
// * 商品营销活动编号
// */
// private Integer activityId;
// /**
// * 商品营销活动类型
// */
// private Integer activityType;
// ========= 优惠信息 END =========
/**
* 创建时间
*/
private Date createTime;
}