mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-22 12:48:59 +08:00
feat: 优惠券适用范围字段添加
This commit is contained in:
parent
5b523499b9
commit
293bd6c81d
@ -0,0 +1,34 @@
|
||||
package com.youlai.mall.sms.common.enums;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.EnumValue;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.youlai.common.base.IBaseEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 优惠券适用类型枚举
|
||||
*
|
||||
* @author haoxr
|
||||
* @date 2022/7/13
|
||||
*/
|
||||
@Getter
|
||||
public enum CouponApplicationScopeEnum implements IBaseEnum<Integer> {
|
||||
|
||||
ALL(0, "全场通用"),
|
||||
SPU_CATEGORY(1, "指定商品分类"),
|
||||
SPU(2, "指定商品"),
|
||||
;
|
||||
|
||||
@Getter
|
||||
@EnumValue // Mybatis-Plus 提供注解表示插入数据库时插入该值
|
||||
private Integer value;
|
||||
|
||||
@Getter
|
||||
@JsonValue // 表示对枚举序列化时返回此字段
|
||||
private String label;
|
||||
|
||||
CouponApplicationScopeEnum(Integer value, String label) {
|
||||
this.value = value;
|
||||
this.label = label;
|
||||
}
|
||||
}
|
@ -92,7 +92,7 @@ public class SmsCoupon extends BaseEntity {
|
||||
/**
|
||||
* 使用类型(0-全场通用;1-指定商品分类;2-指定商品)
|
||||
*/
|
||||
private Integer useType;
|
||||
private Integer applicationScope;
|
||||
|
||||
/**
|
||||
* 发行量(-1:无限制)
|
||||
|
@ -3,6 +3,7 @@ package com.youlai.mall.sms.pojo.entity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -26,11 +27,6 @@ public class SmsCouponSpuCategory implements Serializable {
|
||||
*/
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 商品分类名称
|
||||
*/
|
||||
private String categoryName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -64,44 +64,15 @@ public class CouponForm {
|
||||
@ApiModelProperty("有效期截止时间")
|
||||
private Date validityEndTime;
|
||||
|
||||
@ApiModelProperty("使用类型(0:全场通用;1:指定商品分类;2:指定商品)")
|
||||
private Integer useType;
|
||||
@ApiModelProperty("应用范围(0:全场通用;1:指定商品分类;2:指定商品)")
|
||||
private Integer applicationScope;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("优惠券适用商品分类列表")
|
||||
private List<CouponSpuCategory> spuCategoryList;
|
||||
@ApiModelProperty("优惠券适用商品分类ID集合")
|
||||
private List<Long> spuCategoryIds;
|
||||
|
||||
@ApiModelProperty("优惠券适用商品列表")
|
||||
private List<CouponSpu> spuList;
|
||||
|
||||
@ApiModel("优惠券适用商品分类")
|
||||
@Data
|
||||
public static class CouponSpuCategory {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long categoryId;
|
||||
|
||||
private String categoryName;
|
||||
|
||||
}
|
||||
|
||||
@ApiModel("优惠券适用商品")
|
||||
@Data
|
||||
|
||||
public static class CouponSpu {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long spuId;
|
||||
|
||||
private String spuName;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
double div = NumberUtil.div(1L, 1L);
|
||||
}
|
||||
private List<Long> spuIds;
|
||||
}
|
Loading…
Reference in New Issue
Block a user