blob: ebe793fb0b04bb25e645ad85696eb7a883c0dcfc [file] [log] [blame]
223011381c359102025-06-03 15:19:59 +08001package com.example.myproject.entity;
2
3import javax.persistence.*;
4import java.util.Date;
5
6@Entity
7@Table(name = "user")
8public class Users {
9
10 @Id
11 @GeneratedValue(strategy = GenerationType.IDENTITY)
12 @Column(name = "user_id")
13 private Long userId;
14
15 @Column(name = "username", nullable = false,unique = true)
16 private String username;
17
18 @Column(name = "avatar_url", nullable = true)
19 private String avatarUrl;
20
21 @Column(name = "email", nullable = false)
22 private String email;
23
24 @Column(name = "password", nullable = false)
25 private String password;
26
27 @Column(name = "role", nullable = false)
28 private String role;
29
30 @Column(name = "invite_count")
31 private Integer inviteCount;
32
33 @Column(name = "level", nullable = false)
34 private Long level;
35
36 @Column(name = "upload_count")
37 private Float uploadCount;
38
39 @Column(name = "download_count")
40 private Float downloadCount;
41
42 @Column(name = "share_rate")
43 private Float shareRate;
44
45 @Column(name = "registration_date", nullable = false)
46 private Date registrationDate;
47
48 @Column(name = "last_login_time")
49 private Date lastLoginTime;
50
51 @Column(name = "user_points")
52 private Integer userPoints;
53
54 @Column(name = "is_promo")
55 private Boolean isPromo;
56
57 @Column(name = "current_experience", nullable = false)
58 private Integer currentExperience; // 当前经验值
59
60 @Column(name = "current_seeding_hours", nullable = false)
61 private Float currentSeedingHours; // 当前做种时长
62
63
64 @Column(name = "gender", nullable = true)
65 private String gender; // 性别
66
67 @Column(name = "description", nullable = true)
68 private String description; // 个人描述
69
70 @Column(name = "hobbies", nullable = true)
71 private String hobbies;
72
73 @Column(name = "registration_time", nullable = false, updatable = false)
74 @Temporal(TemporalType.TIMESTAMP)
75 private Date registrationTime;
76
77 // Getters and Setters
78 public Long getUserId() {
79 return userId;
80 }
81
82 public void setUserId(Long userId) {
83 this.userId = userId;
84 }
85
86 public String getUsername() {
87 return username;
88 }
89
90 public void setUsername(String username) {
91 this.username = username;
92 }
93
94 public String getAvatarUrl() {
95 return avatarUrl;
96 }
97
98 public void setAvatarUrl(String avatarUrl) {
99 this.avatarUrl = avatarUrl;
100 }
101
102 public String getEmail() {
103 return email;
104 }
105
106 public void setEmail(String email) {
107 this.email = email;
108 }
109
110 public String getPassword() {
111 return password;
112 }
113
114 public void setPassword(String password) {
115 this.password = password;
116 }
117
118 public String getRole() {
119 return role;
120 }
121
122 public void setRole(String role) {
123 this.role = role;
124 }
125
126 public Integer getInviteCount() {
127 return inviteCount;
128 }
129
130 public void setInviteCount(Integer inviteCount) {
131 this.inviteCount = inviteCount;
132 }
133
134 public Long getLevel() {
135 return level;
136 }
137
138 public void setLevel(Long level) {
139 this.level = level;
140 }
141
142 public Float getUploadCount() {
143 return uploadCount;
144 }
145
146 public void setUploadCount(Float uploadCount) {
147 this.uploadCount = uploadCount;
148 }
149
150 public Float getDownloadCount() {
151 return downloadCount;
152 }
153
154 public void setDownloadCount(Float downloadCount) {
155 this.downloadCount = downloadCount;
156 }
157
158 public Float getShareRate() {
159 return shareRate;
160 }
161
162 public void setShareRate(Float shareRate) {
163 this.shareRate = shareRate;
164 }
165
166 public Date getRegistrationDate() {
167 return registrationDate;
168 }
169
170 public void setRegistrationDate(Date registrationDate) {
171 this.registrationDate = registrationDate;
172 }
173
174 public Date getLastLoginTime() {
175 return lastLoginTime;
176 }
177
178 public void setLastLoginTime(Date lastLoginTime) {
179 this.lastLoginTime = lastLoginTime;
180 }
181
182 public Integer getUserPoints() {
183 return userPoints;
184 }
185
186 public void setUserPoints(Integer userPoints) {
187 this.userPoints = userPoints;
188 }
189
190 public Boolean getIsPromo() {
191 return isPromo;
192 }
193
194 public void setIsPromo(Boolean isPromo) {
195 this.isPromo = isPromo;
196 }
197
198 public Integer getCurrentExperience() {
199 return currentExperience;
200 }
201
202 public void setCurrentExperience(Integer currentExperience) {
203 this.currentExperience = currentExperience;
204 }
205
206 public Float getCurrentSeedingHours() {
207 return currentSeedingHours;
208 }
209
210 public void setCurrentSeedingHours(Float currentSeedingHours) {
211 this.currentSeedingHours = currentSeedingHours;
212 }
213
214 public String getGender() {
215 return gender;
216 }
217
218 public void setGender(String gender) {
219 this.gender = gender;
220 }
221
222 public String getDescription() {
223 return description;
224 }
225
226 public void setDescription(String description) {
227 this.description = description;
228 }
229
230 public String getHobbies() {
231 return hobbies;
232 }
233
234 public void setHobbies(String hobbies) {
235 this.hobbies = hobbies;
236 }
237
238 public Date getRegistrationTime() {
239 return registrationTime;
240 }
241
242 public void setRegistrationTime(Date registrationTime) {
243 this.registrationTime = registrationTime;
244 }
245
246}