用户,社交接口
Change-Id: I10d13773cbe4bbcf3b69a2038cdf7aa9ba54b6df
diff --git a/src/main/java/com/example/myproject/entity/Users.java b/src/main/java/com/example/myproject/entity/Users.java
new file mode 100644
index 0000000..ebe793f
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Users.java
@@ -0,0 +1,246 @@
+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;
+
+ // 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;
+ }
+
+}