| package com.example.myproject.entity; |
| |
| import javax.persistence.*; |
| import java.util.Date; |
| |
| @Entity |
| @Table(name = "user") |
| public class Users { |
| |
| @Id |
| @GeneratedValue(strategy = GenerationType.IDENTITY) |
| @Column(name = "user_id") |
| private Long userId; |
| |
| @Column(name = "username", nullable = false,unique = true) |
| private String username; |
| |
| @Column(name = "avatar_url", nullable = true) |
| private String avatarUrl; |
| |
| @Column(name = "email", nullable = false) |
| private String email; |
| |
| @Column(name = "password", nullable = false) |
| private String password; |
| |
| @Column(name = "role", nullable = false) |
| private String role; |
| |
| @Column(name = "invite_count") |
| private Integer inviteCount; |
| |
| @Column(name = "level", nullable = false) |
| private Long level; |
| |
| @Column(name = "upload_count") |
| private Float uploadCount; |
| |
| @Column(name = "download_count") |
| private Float downloadCount; |
| |
| @Column(name = "share_rate") |
| private Float shareRate; |
| |
| @Column(name = "registration_date", nullable = false) |
| private Date registrationDate; |
| |
| @Column(name = "last_login_time") |
| private Date lastLoginTime; |
| |
| @Column(name = "user_points") |
| private Integer userPoints; |
| |
| @Column(name = "is_promo") |
| private Boolean isPromo; |
| |
| @Column(name = "current_experience", nullable = false) |
| private Integer currentExperience; // 当前经验值 |
| |
| @Column(name = "current_seeding_hours", nullable = false) |
| private Float currentSeedingHours; // 当前做种时长 |
| |
| @Column(name = "gender", nullable = true) |
| private String gender; // 性别 |
| |
| @Column(name = "description", nullable = true) |
| private String description; // 个人描述 |
| |
| @Column(name = "hobbies", nullable = true) |
| private String hobbies; |
| |
| @Column(name = "registration_time", nullable = false, updatable = false) |
| @Temporal(TemporalType.TIMESTAMP) |
| private Date registrationTime; |
| |
| // 新增的lastupdatetime字段 |
| @Column(name = "lastupdatetime") |
| private Date lastupdatetime; |
| |
| // Getters and Setters |
| public Long getUserId() { |
| return userId; |
| } |
| |
| public void setUserId(Long userId) { |
| this.userId = userId; |
| } |
| |
| public String getUsername() { |
| return username; |
| } |
| |
| public void setUsername(String username) { |
| this.username = username; |
| } |
| |
| public String getAvatarUrl() { |
| return avatarUrl; |
| } |
| |
| public void setAvatarUrl(String avatarUrl) { |
| this.avatarUrl = avatarUrl; |
| } |
| |
| public String getEmail() { |
| return email; |
| } |
| |
| public void setEmail(String email) { |
| this.email = email; |
| } |
| |
| public String getPassword() { |
| return password; |
| } |
| |
| public void setPassword(String password) { |
| this.password = password; |
| } |
| |
| public String getRole() { |
| return role; |
| } |
| |
| public void setRole(String role) { |
| this.role = role; |
| } |
| |
| public Integer getInviteCount() { |
| return inviteCount; |
| } |
| |
| public void setInviteCount(Integer inviteCount) { |
| this.inviteCount = inviteCount; |
| } |
| |
| public Long getLevel() { |
| return level; |
| } |
| |
| public void setLevel(Long level) { |
| this.level = level; |
| } |
| |
| public Float getUploadCount() { |
| return uploadCount; |
| } |
| |
| public void setUploadCount(Float uploadCount) { |
| this.uploadCount = uploadCount; |
| } |
| |
| public Float getDownloadCount() { |
| return downloadCount; |
| } |
| |
| public void setDownloadCount(Float downloadCount) { |
| this.downloadCount = downloadCount; |
| } |
| |
| public Float getShareRate() { |
| return shareRate; |
| } |
| |
| public void setShareRate(Float shareRate) { |
| this.shareRate = shareRate; |
| } |
| |
| public Date getRegistrationDate() { |
| return registrationDate; |
| } |
| |
| public void setRegistrationDate(Date registrationDate) { |
| this.registrationDate = registrationDate; |
| } |
| |
| public Date getLastLoginTime() { |
| return lastLoginTime; |
| } |
| |
| public void setLastLoginTime(Date lastLoginTime) { |
| this.lastLoginTime = lastLoginTime; |
| } |
| |
| public Integer getUserPoints() { |
| return userPoints; |
| } |
| |
| public void setUserPoints(Integer userPoints) { |
| this.userPoints = userPoints; |
| } |
| |
| public Boolean getIsPromo() { |
| return isPromo; |
| } |
| |
| public void setIsPromo(Boolean isPromo) { |
| this.isPromo = isPromo; |
| } |
| |
| public Integer getCurrentExperience() { |
| return currentExperience; |
| } |
| |
| public void setCurrentExperience(Integer currentExperience) { |
| this.currentExperience = currentExperience; |
| } |
| |
| public Float getCurrentSeedingHours() { |
| return currentSeedingHours; |
| } |
| |
| public void setCurrentSeedingHours(Float currentSeedingHours) { |
| this.currentSeedingHours = currentSeedingHours; |
| } |
| |
| public String getGender() { |
| return gender; |
| } |
| |
| public void setGender(String gender) { |
| this.gender = gender; |
| } |
| |
| public String getDescription() { |
| return description; |
| } |
| |
| public void setDescription(String description) { |
| this.description = description; |
| } |
| |
| public String getHobbies() { |
| return hobbies; |
| } |
| |
| public void setHobbies(String hobbies) { |
| this.hobbies = hobbies; |
| } |
| |
| public Date getRegistrationTime() { |
| return registrationTime; |
| } |
| |
| public void setRegistrationTime(Date registrationTime) { |
| this.registrationTime = registrationTime; |
| } |
| |
| // 新增的lastupdatetime的getter和setter方法 |
| public Date getLastupdatetime() { |
| return lastupdatetime; |
| } |
| |
| public void setLastupdatetime(Date lastupdatetime) { |
| this.lastupdatetime = lastupdatetime; |
| } |
| } |