Price 价格服务的编写
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
|
||||
package cn.iocoder.mall.promotion.api.rpc.activity;
|
||||
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityListReqDTO;
|
||||
import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface PromotionActivityRpc {
|
||||
|
||||
List<PromotionActivityRespDTO> getPromotionActivityListBySpuId(Integer spuId,
|
||||
Collection<Integer> activityStatuses);
|
||||
// List<PromotionActivityRespDTO> getPromotionActivityListBySpuId(Integer spuId,
|
||||
// Collection<Integer> activityStatuses);
|
||||
//
|
||||
// List<PromotionActivityRespDTO> getPromotionActivityListBySpuIds(Collection<Integer> spuIds,
|
||||
// Collection<Integer> activityStatuses);
|
||||
//
|
||||
// PromotionActivityPageReqDTO getPromotionActivityPage(PromotionActivityPageRespDTO promotionActivityPageDTO);
|
||||
|
||||
List<PromotionActivityRespDTO> getPromotionActivityListBySpuIds(Collection<Integer> spuIds,
|
||||
Collection<Integer> activityStatuses);
|
||||
|
||||
PromotionActivityPageReqDTO getPromotionActivityPage(PromotionActivityPageRespDTO promotionActivityPageDTO);
|
||||
CommonResult<List<PromotionActivityRespDTO>> listPromotionActivities(PromotionActivityListReqDTO listReqDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 促销活动列表查询的 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PromotionActivityListReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 活动编号数组
|
||||
*/
|
||||
private Collection<Integer> activeIds;
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 促销伙伴 Response DTO
|
||||
* 促销活动 Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
||||
@@ -41,18 +41,26 @@ public class PriceProductCalcReqDTO implements Serializable {
|
||||
/**
|
||||
* SKU 编号
|
||||
*/
|
||||
@NotNull(message = "商品 SKU 编号不能为空")
|
||||
private Integer skuId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull(message = "商品 SKU 数量不能为空")
|
||||
private Integer quantity;
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
@NotNull(message = "是否选中不能为空")
|
||||
private Boolean selected;
|
||||
|
||||
public Item() {
|
||||
}
|
||||
|
||||
public Item(Integer skuId, Integer quantity) {
|
||||
public Item(Integer skuId, Integer quantity, Boolean selected) {
|
||||
this.skuId = skuId;
|
||||
this.quantity = quantity;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.price.dto;
|
||||
|
||||
import cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum;
|
||||
import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -57,7 +56,7 @@ public class PriceProductCalcRespDTO implements Serializable {
|
||||
*
|
||||
* // TODO 芋艿,目前只会有【满减送】的情况,未来有新的促销方式,可能需要改成数组
|
||||
*/
|
||||
private PromotionActivityRespDTO activity;
|
||||
private Integer activityId;
|
||||
/**
|
||||
* 促销减少的金额
|
||||
*
|
||||
@@ -94,6 +93,13 @@ public class PriceProductCalcRespDTO implements Serializable {
|
||||
* 商品 Category 编号
|
||||
*/
|
||||
private Integer cid;
|
||||
|
||||
// 非 SKU 自带信息
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private Boolean selected;
|
||||
/**
|
||||
* 购买数量
|
||||
*/
|
||||
@@ -103,7 +109,7 @@ public class PriceProductCalcRespDTO implements Serializable {
|
||||
*
|
||||
* 目前会有限时折扣 {@link PromotionActivityTypeEnum#TIME_LIMITED_DISCOUNT} 类型的活动
|
||||
*/
|
||||
private PromotionActivityRespDTO activity;
|
||||
private Integer activityId;
|
||||
/**
|
||||
* 原始单价,单位:分。
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user