Banner 的迁移
商品推荐的迁移
This commit is contained in:
@@ -1,28 +1,52 @@
|
||||
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 cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.promotion.api.rpc.banner.dto.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Banner Rpc 接口
|
||||
*/
|
||||
public interface BannerRpc {
|
||||
|
||||
List<BannerRespDTO> getBannerListByStatus(Integer status);
|
||||
/**
|
||||
* 创建 Banner
|
||||
*
|
||||
* @param createDTO 创建 Banner DTO
|
||||
* @return Banner 编号
|
||||
*/
|
||||
CommonResult<Integer> createBanner(BannerCreateReqDTO createDTO);
|
||||
|
||||
BannerPageRespDTO getBannerPage(BannerPageDTO bannerPageDTO);
|
||||
/**
|
||||
* 更新 Banner
|
||||
*
|
||||
* @param updateDTO 更新 Banner DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateBanner(BannerUpdateReqDTO updateDTO);
|
||||
|
||||
BannerRespDTO addBanner(Integer adminId, BannerAddReqDTO bannerAddDTO);
|
||||
/**
|
||||
* 删除 Banner
|
||||
*
|
||||
* @param bannerId Banner 编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteBanner(Integer bannerId);
|
||||
|
||||
Boolean updateBanner(Integer adminId, BannerUpdateReqDTO bannerUpdateDTO);
|
||||
/**
|
||||
* 获得 Banner 列表
|
||||
*
|
||||
* @param listDTO Banner 列表查询 DTO
|
||||
* @return Banner 列表
|
||||
*/
|
||||
CommonResult<List<BannerRespDTO>> listBanners(BannerListReqDTO listDTO);
|
||||
|
||||
Boolean updateBannerStatus(Integer adminId, Integer bannerId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status);
|
||||
|
||||
Boolean deleteBanner(Integer adminId, Integer bannerId);
|
||||
/**
|
||||
* 获得 Banner 分页
|
||||
*
|
||||
* @param pageDTO Banner 分页查询
|
||||
* @return Banner 分页结果
|
||||
*/
|
||||
CommonResult<PageResult<BannerRespDTO>> pageBanner(BannerPageReqDTO pageDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
@@ -10,25 +12,46 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 添加 DTO
|
||||
* Banner 创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerAddReqDTO implements Serializable {
|
||||
public class BannerCreateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 32, message = "标题长度为 2-32 位")
|
||||
private String title;
|
||||
/**
|
||||
* 跳转链接
|
||||
*/
|
||||
@NotEmpty(message = "跳转链接不能为空")
|
||||
@URL(message = "跳转链接格式不正确")
|
||||
@Length(max = 255, message = "跳转链接最大长度为 255 位")
|
||||
private String url;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
@NotEmpty(message = "图片链接不能为空")
|
||||
@URL(message = "图片链接格式不正确")
|
||||
@Length(max = 255, message = "图片链接最大长度为 255 位")
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Banner 列表 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class BannerListReqDTO extends PageParam {
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 分页 DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerPageDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 标题,模糊匹配
|
||||
*/
|
||||
private String title;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* Banner 分页 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class BannerPageReqDTO extends PageParam {
|
||||
|
||||
/**
|
||||
* 标题,模糊匹配
|
||||
*/
|
||||
private String title;
|
||||
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Banner 分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerPageRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* Banner 数组
|
||||
*/
|
||||
private List<BannerRespDTO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Banner BO
|
||||
* Banner Response DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.banner.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
@@ -10,27 +12,51 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Banner 更新 DTO
|
||||
* Banner 更新 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class BannerUpdateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotEmpty(message = "标题不能为空")
|
||||
@Length(min = 2, max = 32, message = "标题长度为 2-32 位")
|
||||
private String title;
|
||||
/**
|
||||
* 跳转链接
|
||||
*/
|
||||
@NotEmpty(message = "跳转链接不能为空")
|
||||
@URL(message = "跳转链接格式不正确")
|
||||
@Length(max = 255, message = "跳转链接最大长度为 255 位")
|
||||
private String url;
|
||||
/**
|
||||
* 图片链接
|
||||
*/
|
||||
@NotEmpty(message = "图片链接不能为空")
|
||||
@URL(message = "图片链接格式不正确")
|
||||
@Length(max = 255, message = "图片链接最大长度为 255 位")
|
||||
private String picUrl;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
|
||||
@@ -1,24 +1,52 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.exception.ServiceException;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.promotion.api.rpc.recommend.dto.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品推荐 Rpc 接口
|
||||
*/
|
||||
public interface ProductRecommendRpc {
|
||||
|
||||
List<ProductRecommendRespDTO> getProductRecommendList(Integer type, Integer status);
|
||||
/**
|
||||
* 创建商品推荐
|
||||
*
|
||||
* @param createDTO 创建商品推荐 DTO
|
||||
* @return 商品推荐编号
|
||||
*/
|
||||
CommonResult<Integer> createProductRecommend(ProductRecommendCreateReqDTO createDTO);
|
||||
|
||||
ProductRecommendPageRespDTO getProductRecommendPage(ProductRecommendPageReqDTO productRecommendPageDTO);
|
||||
/**
|
||||
* 更新商品推荐
|
||||
*
|
||||
* @param updateDTO 更新商品推荐 DTO
|
||||
*/
|
||||
CommonResult<Boolean> updateProductRecommend(ProductRecommendUpdateReqDTO updateDTO);
|
||||
|
||||
ProductRecommendRespDTO addProductRecommend(Integer adminId, ProductRecommendAddReqDTO productRecommendAddDTO) throws ServiceException;
|
||||
/**
|
||||
* 删除商品推荐
|
||||
*
|
||||
* @param productRecommendId 商品推荐编号
|
||||
*/
|
||||
CommonResult<Boolean> deleteProductRecommend(Integer productRecommendId);
|
||||
|
||||
Boolean updateProductRecommend(Integer adminId, ProductRecommendUpdateReqDTO productRecommendUpdateDTO) throws ServiceException;
|
||||
/**
|
||||
* 获得商品推荐列表
|
||||
*
|
||||
* @param listReqDTO 商品推荐列表查询 DTO
|
||||
* @return 商品推荐列表
|
||||
*/
|
||||
CommonResult<List<ProductRecommendRespDTO>> listProductRecommends(ProductRecommendListReqDTO listReqDTO);
|
||||
|
||||
Boolean updateProductRecommendStatus(Integer adminId, Integer productRecommendId,
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}") Integer status) throws ServiceException;
|
||||
|
||||
Boolean deleteProductRecommend(Integer adminId, Integer productRecommendId);
|
||||
/**
|
||||
* 获得商品推荐分页
|
||||
*
|
||||
* @param pageDTO 商品推荐分页查询
|
||||
* @return 商品推荐分页结果
|
||||
*/
|
||||
CommonResult<PageResult<ProductRecommendRespDTO>> pageProductRecommend(ProductRecommendPageReqDTO pageDTO);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.recommend.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
@@ -10,19 +11,37 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐添加 DTO
|
||||
* 商品推荐创建 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendAddReqDTO implements Serializable {
|
||||
public class ProductRecommendCreateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 推荐类型
|
||||
*/
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "修改推荐类型必须是 {value}")
|
||||
@NotNull(message = "推荐类型不能为空")
|
||||
private Integer type;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull(message = "商品编号不能为空")
|
||||
private Integer productSpuId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.recommend.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐列表 Req DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendListReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "推荐类型必须是 {value}")
|
||||
private Integer type;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@@ -1,26 +1,24 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.common.framework.vo.PageParam;
|
||||
import cn.iocoder.mall.promotion.api.enums.recommend.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐分页 DTO
|
||||
* 商品推荐分页 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendPageReqDTO implements Serializable {
|
||||
public class ProductRecommendPageReqDTO extends PageParam {
|
||||
|
||||
/**
|
||||
* 推荐类型
|
||||
*/
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "推荐类型必须是 {value}")
|
||||
private Integer type;
|
||||
|
||||
@NotNull(message = "页码不能为空")
|
||||
private Integer pageNo;
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品推荐分页 BO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendPageRespDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* ProductRecommend 数组
|
||||
*/
|
||||
private List<ProductRecommendRespDTO> list;
|
||||
/**
|
||||
* 总量
|
||||
*/
|
||||
private Integer total;
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.mall.promotion.api.rpc.recommend.dto;
|
||||
|
||||
import cn.iocoder.common.framework.enums.CommonStatusEnum;
|
||||
import cn.iocoder.common.framework.validator.InEnum;
|
||||
import cn.iocoder.mall.promotion.api.enums.recommend.ProductRecommendTypeEnum;
|
||||
import lombok.Data;
|
||||
@@ -10,21 +11,42 @@ import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品推荐更新 DTO
|
||||
* 商品推荐更新 Request DTO
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ProductRecommendUpdateReqDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@NotNull(message = "编号不能为空")
|
||||
private Integer id;
|
||||
@NotNull(message = "类型不能为空")
|
||||
/**
|
||||
* 推荐类型
|
||||
*/
|
||||
@InEnum(value = ProductRecommendTypeEnum.class, message = "修改推荐类型必须是 {value}")
|
||||
@NotNull(message = "推荐类型不能为空")
|
||||
private Integer type;
|
||||
/**
|
||||
* 商品编号
|
||||
*/
|
||||
@NotNull(message = "商品编号不能为空")
|
||||
private Integer productSpuId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@NotNull(message = "排序不能为空")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Length(max = 255, message = "备注最大长度为 255 位")
|
||||
private String memo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user