peng
7 天以前 75f9783d5a70a5f037e3b34dc0e479069e63c0e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package cn.lili.modules.goods.entity.dos;
 
import cn.lili.mybatis.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
 
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
 
/**
 * 商品分类
 *
 * @author pikachu
 * @since 2020-02-18 15:18:56
 */
@Data
@TableName("li_category")
@ApiModel(value = "商品分类")
@AllArgsConstructor
@NoArgsConstructor
public class Category extends BaseEntity {
 
    private static final long serialVersionUID = 1L;
 
    @NotEmpty(message = "分类名称不能为空")
    @Size(max = 20)
    @ApiModelProperty(value = "分类名称")
    private String name;
 
    @NotEmpty(message = "请选择父分类")
    @ApiModelProperty(value = "父id, 根节点为0")
    private String parentId;
 
    @NotNull(message = "层级不能为空")
    @Min(value = 0,message = "层级需要大于0")
    @Max(value = 3,message = "层级最大为3")
    @ApiModelProperty(value = "层级, 从0开始")
    private Integer level;
 
    @NotNull(message = "排序值不能为空")
    @Max(value = 999,message = "排序值最大999")
    @ApiModelProperty(value = "排序值")
    private BigDecimal sortOrder;
 
    @ApiModelProperty(value = "佣金比例")
    private Double commissionRate;
 
    @ApiModelProperty(value = "分类图标")
    private String image;
 
    @ApiModelProperty(value = "是否支持频道")
    private Boolean supportChannel;
 
    public Category(String id, String createBy, Date createTime, String updateBy, Date updateTime, Boolean deleteFlag, String name, String parentId, Integer level, BigDecimal sortOrder, Double commissionRate, String image, Boolean supportChannel) {
        super(id, createBy, createTime, updateBy, updateTime, deleteFlag);
        this.name = name;
        this.parentId = parentId;
        this.level = level;
        this.sortOrder = sortOrder;
        this.commissionRate = commissionRate;
        this.image = image;
        this.supportChannel = supportChannel;
    }
 
    public Category(String id, String name, String parentId, Integer level, BigDecimal sortOrder, Double commissionRate, String image, Boolean supportChannel) {
        this.name = name;
        this.parentId = parentId;
        this.level = level;
        this.sortOrder = sortOrder;
        this.commissionRate = commissionRate;
        this.image = image;
        this.supportChannel = supportChannel;
    }
}