后端:商品确认下单的信息 api 接口,后续需要结合促销,完善这个接口。

This commit is contained in:
YunaiV
2019-04-11 00:44:46 +08:00
parent 50d8ec33ee
commit 4300ce141d
29 changed files with 688 additions and 75 deletions

View File

@@ -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;
}

View File

@@ -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);
}
}
}