fix promotion优惠券工程迁移

pull/4/MERGE
wuwenbin 2020-07-26 10:04:42 +08:00
parent de81e5f5ae
commit ef015d9e4c
61 changed files with 254 additions and 186 deletions

View File

@ -157,8 +157,8 @@ DROP TABLE IF EXISTS `promotion_activity`;
CREATE TABLE `promotion_activity` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '活动编号',
`title` varchar(50) NOT NULL DEFAULT '' COMMENT '活动标题',
`activity_type` tinyint(4) NOT NULL COMMENT '活动类型\n *\n * 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum} 枚举',
`status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态\n *\n * 参见 {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum} 枚举',
`activity_type` tinyint(4) NOT NULL COMMENT '活动类型\n *\n * 参见 {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum} 枚举',
`status` tinyint(4) NOT NULL DEFAULT '-1' COMMENT '活动状态\n *\n * 参见 {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum} 枚举',
`start_time` datetime NOT NULL COMMENT '开始时间',
`end_time` datetime NOT NULL COMMENT '结束时间',
`invalid_time` datetime DEFAULT NULL COMMENT '失效时间',

View File

@ -19,7 +19,7 @@ import cn.iocoder.mall.promotion.api.CouponService;
import cn.iocoder.mall.promotion.api.PromotionActivityService;
import cn.iocoder.mall.promotion.api.bo.CouponCardDetailBO;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import cn.iocoder.mall.promotion.api.constant.*;
import cn.iocoder.mall.promotion.api.enums.*;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

View File

@ -30,6 +30,7 @@
<module>management-web-app</module>
<module>shop-web-app</module>
<module>product-service-project</module>
<module>promotion-service-project</module>
</modules>
<packaging>pom</packaging>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>onemall</artifactId>
<groupId>cn.iocoder.mall</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>promotion-service-project</artifactId>
<packaging>pom</packaging>
<modules>
<module>promotion-service-api</module>
<module>promotion-service-app</module>
</modules>
<dependencyManagement>
<dependencies>
<!-- onemall 基础 bom 文件 -->
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>mall-dependencies</artifactId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>common-framework</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 自身项目 -->
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>promotion-service-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -33,6 +33,17 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
<build>

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
/**
*

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.constant;
package cn.iocoder.mall.promotion.api.enums;
import cn.iocoder.common.framework.core.IntArrayValuable;

View File

@ -0,0 +1,16 @@
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
import java.util.Collection;
import java.util.List;
public interface PromotionActivityService {
List<PromotionActivityRespDTO> getPromotionActivityListBySpuId(Integer spuId,
Collection<Integer> activityStatuses);
List<PromotionActivityRespDTO> getPromotionActivityListBySpuIds(Collection<Integer> spuIds,
Collection<Integer> activityStatuses);
PromotionActivityPageReqDTO getPromotionActivityPage(PromotionActivityPageRespDTO promotionActivityPageDTO);
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -10,12 +10,12 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
public class PromotionActivityPageBO {
public class PromotionActivityPageReqDTO {
/**
* PromotionActivityBO
*/
private List<PromotionActivityBO> list;
private List<PromotionActivityRespDTO> list;
/**
*
*/

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -12,7 +12,7 @@ import java.util.Collection;
*/
@Data
@Accessors(chain = true)
public class PromotionActivityPageDTO implements Serializable {
public class PromotionActivityPageRespDTO implements Serializable {
/**
*

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.activity.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -9,7 +9,7 @@ import java.util.List;
@Data
@Accessors(chain = true)
public class PromotionActivityBO implements Serializable {
public class PromotionActivityRespDTO implements Serializable {
/**
*
@ -22,13 +22,13 @@ public class PromotionActivityBO implements Serializable {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum}
* {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum}
*/
private Integer activityType;
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum}
* {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum}
*/
private Integer status;
/**
@ -129,7 +129,7 @@ public class PromotionActivityBO implements Serializable {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum}
* {@link cn.iocoder.mall.promotion.api.enums.RangeTypeEnum}
* + PRODUCT_INCLUDE_PRT
*/
private Integer rangeType;

View File

@ -0,0 +1,28 @@
package cn.iocoder.mall.promotion.api.rpc.banner;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerRespDTO;
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerPageRespDTO;
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerAddReqDTO;
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerPageDTO;
import cn.iocoder.mall.promotion.api.rpc.banner.dto.BannerUpdateReqDTO;
import java.util.List;
public interface BannerService {
List<BannerRespDTO> getBannerListByStatus(Integer status);
BannerPageRespDTO getBannerPage(BannerPageDTO bannerPageDTO);
BannerRespDTO addBanner(Integer adminId, BannerAddReqDTO bannerAddDTO);
Boolean updateBanner(Integer adminId, BannerUpdateReqDTO bannerUpdateDTO);
Boolean updateBannerStatus(Integer adminId, Integer bannerId,
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
Boolean deleteBanner(Integer adminId, Integer bannerId);
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -14,7 +14,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class BannerAddDTO implements Serializable {
public class BannerAddReqDTO implements Serializable {
@NotEmpty(message = "标题不能为空")
@Length(min = 2, max = 32, message = "标题长度为 2-32 位")

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,12 +11,12 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
public class BannerPageBO implements Serializable {
public class BannerPageRespDTO implements Serializable {
/**
* Banner
*/
private List<BannerBO> list;
private List<BannerRespDTO> list;
/**
*
*/

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,7 +11,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
public class BannerBO implements Serializable {
public class BannerRespDTO implements Serializable {
/**
*

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -14,7 +14,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class BannerUpdateDTO implements Serializable {
public class BannerUpdateReqDTO implements Serializable {
@NotNull(message = "编号不能为空")
private Integer id;

View File

@ -1,9 +1,8 @@
package cn.iocoder.mall.promotion.api;
package cn.iocoder.mall.promotion.api.rpc.coupon;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.bo.*;
import cn.iocoder.mall.promotion.api.constant.CouponTemplateStatusEnum;
import cn.iocoder.mall.promotion.api.dto.*;
import cn.iocoder.mall.promotion.api.enums.CouponTemplateStatusEnum;
import cn.iocoder.mall.promotion.api.rpc.coupon.dto.*;
import javax.validation.constraints.NotNull;
import java.util.List;
@ -14,7 +13,7 @@ public interface CouponService {
CouponTemplateBO getCouponTemplate(Integer couponTemplateId);
CouponTemplatePageBO getCouponTemplatePage(CouponTemplatePageDTO couponTemplatePageDTO);
CouponTemplatePageBO getCouponTemplatePage(CouponTemplatePageReqDTO couponTemplatePageDTO);
/**
*
@ -22,7 +21,7 @@ public interface CouponService {
* @param couponCodeTemplateAddDTO DTO
* @return
*/
CouponTemplateBO addCouponCodeTemplate(CouponCodeTemplateAddDTO couponCodeTemplateAddDTO);
CouponTemplateBO addCouponCodeTemplate(CouponCodeTemplateAddReqDTO couponCodeTemplateAddDTO);
/**
*
@ -30,7 +29,7 @@ public interface CouponService {
* @param couponCardTemplateAddDTO DTO
* @return
*/
CouponTemplateBO addCouponCardTemplate(CouponCardTemplateAddDTO couponCardTemplateAddDTO);
CouponTemplateBO addCouponCardTemplate(CouponCardTemplateAddReqDTO couponCardTemplateAddDTO);
/**
*
@ -38,7 +37,7 @@ public interface CouponService {
* @param couponCodeTemplateUpdateDTO DTO
* @return
*/
Boolean updateCouponCodeTemplate(CouponCodeTemplateUpdateDTO couponCodeTemplateUpdateDTO);
Boolean updateCouponCodeTemplate(CouponCodeTemplateUpdateReqDTO couponCodeTemplateUpdateDTO);
/**
*
@ -46,7 +45,7 @@ public interface CouponService {
* @param couponCardTemplateUpdateDTO DTO
* @return
*/
Boolean updateCouponCardTemplate(CouponCardTemplateUpdateDTO couponCardTemplateUpdateDTO);
Boolean updateCouponCardTemplate(CouponCardTemplateUpdateReqDTO couponCardTemplateUpdateDTO);
/**
*
@ -61,7 +60,7 @@ public interface CouponService {
// ========== 优惠劵 ==========
CouponCardPageBO getCouponCardPage(CouponCardPageDTO couponCardPageDTO);
CouponCardPageBO getCouponCardPage(CouponCardPageReqDTO couponCardPageDTO);
/**
*
@ -109,7 +108,7 @@ public interface CouponService {
* @param spus /
* @return
*/
List<CouponCardAvailableBO> getCouponCardList(Integer userId, List<CouponCardSpuDTO> spus);
List<CouponCardAvailableRespDTO> getCouponCardList(Integer userId, List<CouponCardSpuRespDTO> spus);
// ========== 优惠码 ==========

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -10,7 +10,7 @@ import lombok.experimental.Accessors;
*/
@Data
@Accessors(chain = true)
public class CouponCardAvailableBO extends CouponCardBO {
public class CouponCardAvailableRespDTO extends CouponCardBO {
/**
*

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,7 +11,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class CouponCardPageDTO implements Serializable {
public class CouponCardPageReqDTO implements Serializable {
/**
*

View File

@ -1,5 +1,6 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import cn.iocoder.mall.promotion.api.rpc.coupon.CouponService;
import lombok.Data;
import lombok.experimental.Accessors;
@ -9,11 +10,11 @@ import java.util.List;
/**
* DTO
*
* {@link cn.iocoder.mall.promotion.api.CouponService#getCouponCardList(Integer, List)}
* {@link CouponService#getCouponCardList(Integer, List)}
*/
@Data
@Accessors(chain = true)
public class CouponCardSpuDTO implements Serializable {
public class CouponCardSpuRespDTO implements Serializable {
/**
* SPU

View File

@ -1,9 +1,9 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.constant.CouponTemplateDateTypeEnum;
import cn.iocoder.mall.promotion.api.constant.PreferentialTypeEnum;
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
import cn.iocoder.mall.promotion.api.enums.CouponTemplateDateTypeEnum;
import cn.iocoder.mall.promotion.api.enums.PreferentialTypeEnum;
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
@ -20,7 +20,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
public class CouponCardTemplateAddDTO implements Serializable {
public class CouponCardTemplateAddReqDTO implements Serializable {
// ========== 基本信息 BEGIN ==========
/**

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
@ -16,7 +16,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class CouponCardTemplateUpdateDTO implements Serializable {
public class CouponCardTemplateUpdateReqDTO implements Serializable {
@NotNull(message = "编号不能为空")
private Integer id;
@ -143,7 +143,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return id;
}
public CouponCardTemplateUpdateDTO setId(Integer id) {
public CouponCardTemplateUpdateReqDTO setId(Integer id) {
this.id = id;
return this;
}
@ -152,7 +152,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return title;
}
public CouponCardTemplateUpdateDTO setTitle(String title) {
public CouponCardTemplateUpdateReqDTO setTitle(String title) {
this.title = title;
return this;
}
@ -161,7 +161,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return description;
}
public CouponCardTemplateUpdateDTO setDescription(String description) {
public CouponCardTemplateUpdateReqDTO setDescription(String description) {
this.description = description;
return this;
}
@ -170,7 +170,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return quota;
}
public CouponCardTemplateUpdateDTO setQuota(Integer quota) {
public CouponCardTemplateUpdateReqDTO setQuota(Integer quota) {
this.quota = quota;
return this;
}
@ -179,7 +179,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return total;
}
public CouponCardTemplateUpdateDTO setTotal(Integer total) {
public CouponCardTemplateUpdateReqDTO setTotal(Integer total) {
this.total = total;
return this;
}
@ -188,7 +188,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return rangeType;
}
public CouponCardTemplateUpdateDTO setRangeType(Integer rangeType) {
public CouponCardTemplateUpdateReqDTO setRangeType(Integer rangeType) {
this.rangeType = rangeType;
return this;
}
@ -197,7 +197,7 @@ public class CouponCardTemplateUpdateDTO implements Serializable {
return rangeValues;
}
public CouponCardTemplateUpdateDTO setRangeValues(String rangeValues) {
public CouponCardTemplateUpdateReqDTO setRangeValues(String rangeValues) {
this.rangeValues = rangeValues;
return this;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -10,5 +10,5 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class CouponCodeTemplateAddDTO implements Serializable {
public class CouponCodeTemplateAddReqDTO implements Serializable {
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -10,5 +10,5 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class CouponCodeTemplateUpdateDTO implements Serializable {
public class CouponCodeTemplateUpdateReqDTO implements Serializable {
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.coupon.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,7 +11,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class CouponTemplatePageDTO implements Serializable {
public class CouponTemplatePageReqDTO implements Serializable {
/**
*

View File

@ -0,0 +1,24 @@
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.exception.ServiceException;
import cn.iocoder.common.framework.validator.InEnum;
import java.util.List;
public interface ProductRecommendService {
List<ProductRecommendRespDTO> getProductRecommendList(Integer type, Integer status);
ProductRecommendPageRespDTO getProductRecommendPage(ProductRecommendPageReqDTO productRecommendPageDTO);
ProductRecommendRespDTO addProductRecommend(Integer adminId, ProductRecommendAddReqDTO productRecommendAddDTO) throws ServiceException;
Boolean updateProductRecommend(Integer adminId, ProductRecommendUpdateReqDTO productRecommendUpdateDTO) throws ServiceException;
Boolean updateProductRecommendStatus(Integer adminId, Integer productRecommendId,
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status) throws ServiceException;
Boolean deleteProductRecommend(Integer adminId, Integer productRecommendId);
}

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
import cn.iocoder.mall.promotion.api.enums.ProductRecommendTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
@ -14,7 +14,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class ProductRecommendAddDTO implements Serializable {
public class ProductRecommendAddReqDTO implements Serializable {
@InEnum(value = ProductRecommendTypeEnum.class, message = "修改推荐类型必须是 {value}")
@NotNull(message = "推荐类型不能为空")

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,7 +11,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class ProductRecommendPageDTO implements Serializable {
public class ProductRecommendPageReqDTO implements Serializable {
/**
*

View File

@ -1,4 +1,4 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import lombok.Data;
import lombok.experimental.Accessors;
@ -11,12 +11,12 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
public class ProductRecommendPageBO implements Serializable {
public class ProductRecommendPageRespDTO implements Serializable {
/**
* ProductRecommend
*/
private List<ProductRecommendBO> list;
private List<ProductRecommendRespDTO> list;
/**
*
*/

View File

@ -1,6 +1,6 @@
package cn.iocoder.mall.promotion.api.bo;
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
import cn.iocoder.mall.promotion.api.enums.ProductRecommendTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
@ -12,7 +12,7 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
public class ProductRecommendBO implements Serializable {
public class ProductRecommendRespDTO implements Serializable {
/**
*

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.promotion.api.dto;
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
import cn.iocoder.mall.promotion.api.enums.ProductRecommendTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
@ -14,7 +14,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
public class ProductRecommendUpdateDTO implements Serializable {
public class ProductRecommendUpdateReqDTO implements Serializable {
@NotNull(message = "编号不能为空")
private Integer id;

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>promotion-service-project</artifactId>
<groupId>cn.iocoder.mall</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>promotion-service-app</artifactId>
<dependencies>
<dependency>
<groupId>cn.iocoder.mall</groupId>
<artifactId>promotion-service-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,28 +0,0 @@
package cn.iocoder.mall.promotion.api;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.api.bo.BannerPageBO;
import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
import cn.iocoder.mall.promotion.api.dto.BannerPageDTO;
import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;
import java.util.List;
public interface BannerService {
List<BannerBO> getBannerListByStatus(Integer status);
BannerPageBO getBannerPage(BannerPageDTO bannerPageDTO);
BannerBO addBanner(Integer adminId, BannerAddDTO bannerAddDTO);
Boolean updateBanner(Integer adminId, BannerUpdateDTO bannerUpdateDTO);
Boolean updateBannerStatus(Integer adminId, Integer bannerId,
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
Boolean deleteBanner(Integer adminId, Integer bannerId);
}

View File

@ -1,29 +0,0 @@
package cn.iocoder.mall.promotion.api;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.exception.ServiceException;
import cn.iocoder.common.framework.validator.InEnum;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;
import java.util.List;
public interface ProductRecommendService {
List<ProductRecommendBO> getProductRecommendList(Integer type, Integer status);
ProductRecommendPageBO getProductRecommendPage(ProductRecommendPageDTO productRecommendPageDTO);
ProductRecommendBO addProductRecommend(Integer adminId, ProductRecommendAddDTO productRecommendAddDTO) throws ServiceException;
Boolean updateProductRecommend(Integer adminId, ProductRecommendUpdateDTO productRecommendUpdateDTO) throws ServiceException;
Boolean updateProductRecommendStatus(Integer adminId, Integer productRecommendId,
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status) throws ServiceException;
Boolean deleteProductRecommend(Integer adminId, Integer productRecommendId);
}

View File

@ -1,20 +0,0 @@
package cn.iocoder.mall.promotion.api;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
import java.util.Collection;
import java.util.List;
public interface PromotionActivityService {
List<PromotionActivityBO> getPromotionActivityListBySpuId(Integer spuId,
Collection<Integer> activityStatuses);
List<PromotionActivityBO> getPromotionActivityListBySpuIds(Collection<Integer> spuIds,
Collection<Integer> activityStatuses);
PromotionActivityPageBO getPromotionActivityPage(PromotionActivityPageDTO promotionActivityPageDTO);
}

View File

@ -1,7 +1,7 @@
package cn.iocoder.mall.promotion.biz.config;
import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;

View File

@ -38,7 +38,7 @@ public class CouponTemplateDO extends BaseDO {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.CouponTemplateStatusEnum}
* {@link cn.iocoder.mall.promotion.api.enums.CouponTemplateStatusEnum}
*
*
*/

View File

@ -2,7 +2,7 @@ package cn.iocoder.mall.promotion.biz.dataobject;
import cn.iocoder.mall.mybatis.core.dataobject.DeletableDO;
import cn.iocoder.mall.promotion.api.constant.ProductRecommendTypeEnum;
import cn.iocoder.mall.promotion.api.enums.ProductRecommendTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;

View File

@ -25,7 +25,7 @@ public class PromotionActivityDO extends BaseDO {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum}
* {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum}
*/
private Integer activityType;
// /**
@ -36,7 +36,7 @@ public class PromotionActivityDO extends BaseDO {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum}
* {@link cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum}
*/
private Integer status;
/**
@ -165,7 +165,7 @@ public class PromotionActivityDO extends BaseDO {
/**
*
*
* {@link cn.iocoder.mall.promotion.api.constant.RangeTypeEnum}
* {@link cn.iocoder.mall.promotion.api.enums.RangeTypeEnum}
* + PRODUCT_INCLUDE_PRT
*/
private Integer rangeType;

View File

@ -6,7 +6,7 @@ import cn.iocoder.mall.mybatis.core.enums.DeletedStatusEnum;
import cn.iocoder.mall.promotion.api.BannerService;
import cn.iocoder.mall.promotion.api.bo.BannerBO;
import cn.iocoder.mall.promotion.api.bo.BannerPageBO;
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
import cn.iocoder.mall.promotion.api.dto.BannerPageDTO;
import cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO;

View File

@ -6,7 +6,7 @@ import cn.iocoder.common.framework.util.ServiceExceptionUtil;
import cn.iocoder.common.framework.util.StringUtil;
import cn.iocoder.mall.promotion.api.CouponService;
import cn.iocoder.mall.promotion.api.bo.*;
import cn.iocoder.mall.promotion.api.constant.*;
import cn.iocoder.mall.promotion.api.enums.*;
import cn.iocoder.mall.promotion.api.dto.*;
import cn.iocoder.mall.promotion.biz.convert.CouponCardConvert;
import cn.iocoder.mall.promotion.biz.convert.CouponTemplateConvert;

View File

@ -7,7 +7,7 @@ import cn.iocoder.mall.product.rpc.api.ProductSpuRpc;
import cn.iocoder.mall.promotion.api.ProductRecommendService;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendBO;
import cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO;
import cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionErrorCodeEnum;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO;
import cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO;

View File

@ -3,8 +3,8 @@ package cn.iocoder.mall.promotion.biz.service;
import cn.iocoder.mall.promotion.api.PromotionActivityService;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityBO;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
import cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum;
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum;
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
import cn.iocoder.mall.promotion.biz.convert.PromotionActivityConvert;
import cn.iocoder.mall.promotion.biz.dao.PromotionActivityMapper;

View File

@ -1,10 +1,10 @@
package cn.iocoder.mall.promotion.biz.dao;
import cn.iocoder.common.framework.util.DateUtil;
import cn.iocoder.mall.promotion.api.constant.PreferentialTypeEnum;
import cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum;
import cn.iocoder.mall.promotion.api.constant.PromotionActivityTypeEnum;
import cn.iocoder.mall.promotion.api.constant.RangeTypeEnum;
import cn.iocoder.mall.promotion.api.enums.PreferentialTypeEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionActivityTypeEnum;
import cn.iocoder.mall.promotion.api.enums.RangeTypeEnum;
import cn.iocoder.mall.promotion.biz.dataobject.PromotionActivityDO;
import org.junit.Ignore;
import org.junit.Test;

View File

@ -3,7 +3,7 @@ package cn.iocoder.mall.promotion.application.controller.admins;
import cn.iocoder.common.framework.vo.CommonResult;
import cn.iocoder.mall.promotion.api.PromotionActivityService;
import cn.iocoder.mall.promotion.api.bo.PromotionActivityPageBO;
import cn.iocoder.mall.promotion.api.constant.PromotionActivityStatusEnum;
import cn.iocoder.mall.promotion.api.enums.PromotionActivityStatusEnum;
import cn.iocoder.mall.promotion.api.dto.PromotionActivityPageDTO;
import io.swagger.annotations.Api;
import org.apache.dubbo.config.annotation.Reference;