Rights.java
2.33 KB
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
80
81
82
83
84
85
86
87
88
89
package com.topdraw.business.module.rights.domain;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* @author XiangHan
* @date 2021-10-22
*/
@Entity
@Data
@EntityListeners(AuditingEntityListener.class)
@Accessors(chain = true)
@Table(name="tr_rights")
public class Rights implements Serializable {
// 主键
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
// 标识
@Column(name = "code", nullable = false)
private String code;
// 权益名称
// @Column(name = "name")
// private String name;
// 类型 1:实体类 (预留字段)
@Column(name = "type", nullable = false)
private Integer type;
// 终端类型 0:大屏;1:微信小程序/公众号;2:App
@Column(name = "device_type", nullable = false)
private Integer deviceType;
// 权益的实体类型 1:积分;2成长值;3优惠券
@Column(name = "entity_type", nullable = false)
private String entityType;
// 实体id
@Column(name = "entity_id", nullable = false)
private Long entityId;
// 生效时间,为null表示获取后立即生效,不为空时,表示特定的生效时间
@Column(name = "valid_time")
private Timestamp validTime;
// 失效时间,空为不失效,否则为获得权益后直到失效的毫秒数
@Column(name = "expire_time")
private Long expireTime;
// 创建时间
@CreatedDate
@Column(name = "create_time")
private Timestamp createTime;
// 更新时间
@LastModifiedDate
@Column(name = "update_time")
private Timestamp updateTime;
// 图片
@Column(name = "image")
private String image;
// 图片
@Column(name = "images")
private String images;
// 描述
@Column(name = "description")
private String description;
public void copy(Rights source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}