User.java
1.81 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
package isa.qa.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 用户
*
* @author May
* @date 2018/11/21 16:31
* @version 1.0
*/
@Data
@Entity
@Table(name = "i_user")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
/**
* Foreign key of role
*/
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "role_id", referencedColumnName = "id")
private Role role;
/**
* Username
*/
@Column(name = "name", length = 20)
private String name;
/**
* User's phone
*/
@Column(name = "phone", length = 20)
private String phone;
/**
* User's email
*/
@Column(name = "email", length = 32, unique = true, nullable = false)
private String email;
/**
* User's encoded password (PasswordEncoder.encode(md5(password)))
*/
@Column(name = "password", length = 256)
private String password;
/**
* Account enabled status: true-enabled, false-locked
*/
@Column(name = "is_enabled")
private Boolean isEnabled;
/**
* Account registerUser time
*/
@Column(name = "register_time", columnDefinition = "timestamp default current_timestamp comment '创建时间'")
private Date registerTime;
/**
* Account updated time
*/
@Column(name = "updated_time", columnDefinition = "timestamp default current_timestamp comment '创建时间'")
private Date updatedTime;
/**
* Last password reset time
*/
@Column(name = "last_password_reset_time", columnDefinition = "timestamp default current_timestamp comment '创建时间'")
private Date lastPasswordResetTime;
}