UserEntity.java
2.7 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package com.agent.entity.system;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.codehaus.jackson.annotate.JsonIgnore;
import com.agent.entity.BasicEntity;
@Entity
@Table(name = "sys_user")
public class UserEntity extends BasicEntity {
/**
* 登录账号
*/
private String loginaccount;
/**
* 密码
*/
private String password;
/**
* 姓名
*/
private String realName;
/**
* 手机号码
*/
private String mobile;
/**
* 邮箱
*/
private String email;
/**
* 角色
*/
private RoleEntity role;
/**
* 上次登录时间
*/
private Date lastLoginTime;
/**
* 用户描述
*/
private String description;
/**
* 0 启用 1禁用
*/
private int status = 0;
/**
* 代理人
*/
private Long agent;
/**
* 登录失败次数
* @return
*/
private int loginerror;
@Column(name = "loginaccount", nullable = false, length = 20)
public String getLoginaccount() {
return loginaccount;
}
public void setLoginaccount(String loginaccount) {
this.loginaccount = loginaccount;
}
@Column(name = "password", nullable = false)
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Column(name = "mobile", length = 20)
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "role")
public RoleEntity getRole() {
return role;
}
public void setRole(RoleEntity role) {
this.role = role;
}
@Column(name = "realName", length = 20, nullable = false)
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Column(name = "AGENT_ID")
public Long getAgent() {
return agent == null ? 0l : agent;
}
public void setAgent(Long agent) {
this.agent = agent;
}
public int getLoginerror() {
return loginerror;
}
public void setLoginerror(int loginerror) {
this.loginerror = loginerror;
}
}