后端:商品确认下单的信息 api 接口,后续需要结合促销,完善这个接口。
This commit is contained in:
@@ -93,9 +93,6 @@
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.mall.promotion.api.constant;
|
||||
|
||||
/**
|
||||
* 推广活动类型枚举
|
||||
*/
|
||||
public enum PromotionActivityTypeEnum {
|
||||
|
||||
LIMIT_DISCOUNT(1, "限时折扣"),
|
||||
MEET_REDUCE(2, "满减送"),
|
||||
;
|
||||
|
||||
/**
|
||||
* 类型值
|
||||
*/
|
||||
private final Integer value;
|
||||
/**
|
||||
* 类型名
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
PromotionActivityTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.mall.promotion.biz.dataobject;
|
||||
|
||||
import cn.iocoder.common.framework.dataobject.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 促销活动 DO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PromotionActivityDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 活动编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 活动标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 活动类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -58,7 +58,7 @@ public class ProductRecommendServiceImpl implements ProductRecommendService {
|
||||
return CommonResult.error(SysErrorCodeEnum.VALIDATION_REQUEST_PARAM_ERROR.getCode(), "推荐类型必须是新品(1)或热卖(2)"); // TODO 有点搓
|
||||
}
|
||||
// 校验商品不存在
|
||||
if (productSpuService.getProductSpu(productRecommendAddDTO.getProductSpuId()) == null) {
|
||||
if (productSpuService.getProductSpuDetail(productRecommendAddDTO.getProductSpuId()) == null) {
|
||||
return ServiceExceptionUtil.error(PromotionErrorCodeEnum.PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS.getCode());
|
||||
}
|
||||
// 校验商品是否已经推荐
|
||||
@@ -84,7 +84,7 @@ public class ProductRecommendServiceImpl implements ProductRecommendService {
|
||||
return ServiceExceptionUtil.error(PromotionErrorCodeEnum.PRODUCT_RECOMMEND_NOT_EXISTS.getCode());
|
||||
}
|
||||
// 校验商品不存在
|
||||
if (productSpuService.getProductSpu(productRecommendUpdateDTO.getProductSpuId()) == null) {
|
||||
if (productSpuService.getProductSpuDetail(productRecommendUpdateDTO.getProductSpuId()) == null) {
|
||||
return ServiceExceptionUtil.error(PromotionErrorCodeEnum.PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS.getCode());
|
||||
}
|
||||
// 校验商品是否已经推荐
|
||||
@@ -130,4 +130,4 @@ public class ProductRecommendServiceImpl implements ProductRecommendService {
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user