wangrong
2021-11-24 749179ef60bca3074f8e12325b92b0d406d9246c
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
package com.example.demo.model.mall;
 
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.DateType;
import xyz.erupt.annotation.sub_field.sub_edit.InputType;
import xyz.erupt.annotation.sub_field.sub_edit.ReferenceTreeType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.jpa.model.BaseModel;
 
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import java.util.Date;
 
/**
 * @author YuePeng
 * date 2020/12/11 13:29
 */
@Erupt(name = "优惠券管理")
@Table(name = "mall_goods_coupon")
@Entity
public class Coupon extends BaseModel {
 
    @EruptField(
            views = @View(title = "名称"),
            edit = @Edit(title = "名称", notNull = true, search = @Search, inputType = @InputType(fullSpan = true))
    )
    private String name;
 
    @EruptField(
            views = @View(title = "金额"),
            edit = @Edit(title = "金额", notNull = true, search = @Search)
    )
    private Double price;
 
    @EruptField(
            views = @View(title = "商品金额满多少可用"),
            edit = @Edit(title = "商品金额满多少可用", notNull = true, search = @Search)
    )
    private Double priceMax;
 
    @EruptField(
            views = @View(title = "发行量"),
            edit = @Edit(title = "发行量", notNull = true, search = @Search(vague = true))
    )
    private Integer maxCount;
 
    @EruptField(
            views = @View(title = "颜色", template = "'<div style=\"width:100%;height:20px;background:'+value+'\"></div>'"),
            edit = @Edit(title = "颜色", notNull = true, inputType = @InputType(type = "color"))
    )
    private String color;
 
    @EruptField(
            views = @View(title = "生效时间"),
            edit = @Edit(title = "生效时间", notNull = true, dateType = @DateType(type = DateType.Type.DATE_TIME))
    )
    private Date startTime;
 
    @EruptField(
            views = @View(title = "失效时间"),
            edit = @Edit(title = "失效时间", notNull = true, dateType = @DateType(type = DateType.Type.DATE_TIME))
    )
    private Date endTime;
 
    @ManyToOne
    @EruptField(
            views = @View(title = "指定类别商品可用", column = "name"),
            edit = @Edit(title = "指定类别商品可用", desc = "不选择全场可用", type = EditType.REFERENCE_TREE, search = @Search, referenceTreeType = @ReferenceTreeType(pid = "parent.id"))
    )
    private GoodsCategory category;
 
}