apply .gitignore clean-up
Change-Id: Idd0b57a7340f0e62c85090d84c4fdb8cb5d6fe00
diff --git a/src/main/java/com/example/myproject/entity/SeedRating.java b/src/main/java/com/example/myproject/entity/SeedRating.java
new file mode 100644
index 0000000..268f64e
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/SeedRating.java
@@ -0,0 +1,59 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+
+@Entity
+@Table(name = "seed_rating", uniqueConstraints = @UniqueConstraint(columnNames = {"seed_id", "user_id"}))
+public class SeedRating {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "rating_id")
+ private Long ratingId;
+
+ @Column(name = "seed_id", nullable = false)
+ private Long seedId;
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId;
+
+ @Column(name = "score", nullable = false)
+ @Min(0)
+ @Max(10)
+ private Integer score;
+
+ // Getters and Setters
+ public Long getRatingId() {
+ return ratingId;
+ }
+
+ public void setRatingId(Long ratingId) {
+ this.ratingId = ratingId;
+ }
+
+ public Long getSeedId() {
+ return seedId;
+ }
+
+ public void setSeedId(Long seedId) {
+ this.seedId = seedId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Integer getScore() {
+ return score;
+ }
+
+ public void setScore(Integer score) {
+ this.score = score;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/example/myproject/entity/TorrentLikes.java b/src/main/java/com/example/myproject/entity/TorrentLikes.java
deleted file mode 100644
index e66ecd8..0000000
--- a/src/main/java/com/example/myproject/entity/TorrentLikes.java
+++ /dev/null
@@ -1,55 +0,0 @@
-//package com.example.myproject.entity;
-//
-//import javax.persistence.*;
-//
-//@Entity
-//@Table(name = "torrent_likes")
-//public class TorrentLikes {
-//
-// @Id
-// @GeneratedValue(strategy = GenerationType.IDENTITY)
-// @Column(name = "like_id")
-// private Long likeId;
-//
-// @Column(name = "user_id")
-// private Integer userId;
-//
-// @Column(name = "torrent_id")
-// private Long torrentId;
-//
-// @Column(name = "is_liked", columnDefinition = "TINYINT(1) DEFAULT 0")
-// private Integer isLiked;
-//
-// // Getters and Setters
-// public Long getLikeId() {
-// return likeId;
-// }
-//
-// public void setLikeId(Long likeId) {
-// this.likeId = likeId;
-// }
-//
-// public Integer getUserId() {
-// return userId;
-// }
-//
-// public void setUserId(Integer userId) {
-// this.userId = userId;
-// }
-//
-// public Long getTorrentId() {
-// return torrentId;
-// }
-//
-// public void setTorrentId(Long torrentId) {
-// this.torrentId = torrentId;
-// }
-//
-// public Integer getIsLiked() {
-// return isLiked;
-// }
-//
-// public void setIsLiked(Integer isLiked) {
-// this.isLiked = isLiked;
-// }
-//}
\ No newline at end of file
diff --git a/src/main/java/com/example/myproject/entity/Users.java b/src/main/java/com/example/myproject/entity/Users.java
index f1d0316..282ef79 100644
--- a/src/main/java/com/example/myproject/entity/Users.java
+++ b/src/main/java/com/example/myproject/entity/Users.java
@@ -1,246 +1,257 @@
- package com.example.myproject.entity;
+package com.example.myproject.entity;
- import javax.persistence.*;
- import java.util.Date;
+import javax.persistence.*;
+import java.util.Date;
- @Entity
- @Table(name = "user")
- public class Users {
+@Entity
+@Table(name = "user")
+public class Users {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Column(name = "user_id")
- private Long userId;
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "user_id")
+ private Long userId;
- @Column(name = "username", nullable = false,unique = true)
- private String username;
+ @Column(name = "username", nullable = false,unique = true)
+ private String username;
- @Column(name = "avatar_url", nullable = true)
- private String avatarUrl;
+ @Column(name = "avatar_url", nullable = true)
+ private String avatarUrl;
- @Column(name = "email", nullable = false)
- private String email;
+ @Column(name = "email", nullable = false)
+ private String email;
- @Column(name = "password", nullable = false)
- private String password;
+ @Column(name = "password", nullable = false)
+ private String password;
- @Column(name = "role", nullable = false)
- private String role;
+ @Column(name = "role", nullable = false)
+ private String role;
- @Column(name = "invite_count")
- private Integer inviteCount;
+ @Column(name = "invite_count")
+ private Integer inviteCount;
- @Column(name = "level", nullable = false)
- private Long level;
+ @Column(name = "level", nullable = false)
+ private Long level;
- @Column(name = "upload_count")
- private Float uploadCount;
+ @Column(name = "upload_count")
+ private Float uploadCount;
- @Column(name = "download_count")
- private Float downloadCount;
+ @Column(name = "download_count")
+ private Float downloadCount;
- @Column(name = "share_rate")
- private Float shareRate;
+ @Column(name = "share_rate")
+ private Float shareRate;
- @Column(name = "registration_date", nullable = false)
- private Date registrationDate;
+ @Column(name = "registration_date", nullable = false)
+ private Date registrationDate;
- @Column(name = "last_login_time")
- private Date lastLoginTime;
+ @Column(name = "last_login_time")
+ private Date lastLoginTime;
- @Column(name = "user_points")
- private Integer userPoints;
+ @Column(name = "user_points")
+ private Integer userPoints;
- @Column(name = "is_promo")
- private Boolean isPromo;
+ @Column(name = "is_promo")
+ private Boolean isPromo;
- @Column(name = "current_experience", nullable = false)
- private Integer currentExperience; // 当前经验值
+ @Column(name = "current_experience", nullable = false)
+ private Integer currentExperience; // 当前经验值
- @Column(name = "current_seeding_hours", nullable = false)
- private Float currentSeedingHours; // 当前做种时长
+ @Column(name = "current_seeding_hours", nullable = false)
+ private Float currentSeedingHours; // 当前做种时长
+ @Column(name = "gender", nullable = true)
+ private String gender; // 性别
- @Column(name = "gender", nullable = true)
- private String gender; // 性别
+ @Column(name = "description", nullable = true)
+ private String description; // 个人描述
- @Column(name = "description", nullable = true)
- private String description; // 个人描述
+ @Column(name = "hobbies", nullable = true)
+ private String hobbies;
- @Column(name = "hobbies", nullable = true)
- private String hobbies;
+ @Column(name = "registration_time", nullable = false, updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date registrationTime;
- @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;
- }
+ // Getters and Setters
+ public Long getUserId() {
+ return userId;
+ }
- public void setUserId(Long userId) {
- this.userId = userId;
- }
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
- public String getUsername() {
- return username;
- }
+ public String getUsername() {
+ return username;
+ }
- public void setUsername(String username) {
- this.username = username;
- }
+ public void setUsername(String username) {
+ this.username = username;
+ }
- public String getAvatarUrl() {
- return avatarUrl;
- }
+ public String getAvatarUrl() {
+ return avatarUrl;
+ }
- public void setAvatarUrl(String avatarUrl) {
- this.avatarUrl = avatarUrl;
- }
+ public void setAvatarUrl(String avatarUrl) {
+ this.avatarUrl = avatarUrl;
+ }
- public String getEmail() {
- return email;
- }
+ public String getEmail() {
+ return email;
+ }
- public void setEmail(String email) {
- this.email = email;
- }
+ public void setEmail(String email) {
+ this.email = email;
+ }
- public String getPassword() {
- return password;
- }
+ public String getPassword() {
+ return password;
+ }
- public void setPassword(String password) {
- this.password = password;
- }
+ public void setPassword(String password) {
+ this.password = password;
+ }
- public String getRole() {
- return role;
- }
+ public String getRole() {
+ return role;
+ }
- public void setRole(String role) {
- this.role = role;
- }
+ public void setRole(String role) {
+ this.role = role;
+ }
- public Integer getInviteCount() {
- return inviteCount;
- }
+ public Integer getInviteCount() {
+ return inviteCount;
+ }
+
+ public void setInviteCount(Integer inviteCount) {
+ this.inviteCount = inviteCount;
+ }
- public void setInviteCount(Integer inviteCount) {
- this.inviteCount = inviteCount;
- }
+ public Long getLevel() {
+ return level;
+ }
- public Long getLevel() {
- return level;
- }
+ public void setLevel(Long level) {
+ this.level = level;
+ }
- public void setLevel(Long level) {
- this.level = level;
- }
+ public Float getUploadCount() {
+ return uploadCount;
+ }
- public Float getUploadCount() {
- return uploadCount;
- }
+ public void setUploadCount(Float uploadCount) {
+ this.uploadCount = uploadCount;
+ }
- public void setUploadCount(Float uploadCount) {
- this.uploadCount = uploadCount;
- }
+ public Float getDownloadCount() {
+ return downloadCount;
+ }
- public Float getDownloadCount() {
- return downloadCount;
- }
+ public void setDownloadCount(Float downloadCount) {
+ this.downloadCount = downloadCount;
+ }
- public void setDownloadCount(Float downloadCount) {
- this.downloadCount = downloadCount;
- }
+ public Float getShareRate() {
+ return shareRate;
+ }
- public Float getShareRate() {
- return shareRate;
- }
+ public void setShareRate(Float shareRate) {
+ this.shareRate = shareRate;
+ }
- public void setShareRate(Float shareRate) {
- this.shareRate = shareRate;
- }
+ public Date getRegistrationDate() {
+ return registrationDate;
+ }
- public Date getRegistrationDate() {
- return registrationDate;
- }
+ public void setRegistrationDate(Date registrationDate) {
+ this.registrationDate = registrationDate;
+ }
- public void setRegistrationDate(Date registrationDate) {
- this.registrationDate = registrationDate;
- }
+ public Date getLastLoginTime() {
+ return lastLoginTime;
+ }
- public Date getLastLoginTime() {
- return lastLoginTime;
- }
+ public void setLastLoginTime(Date lastLoginTime) {
+ this.lastLoginTime = lastLoginTime;
+ }
- public void setLastLoginTime(Date lastLoginTime) {
- this.lastLoginTime = lastLoginTime;
- }
+ public Integer getUserPoints() {
+ return userPoints;
+ }
- public Integer getUserPoints() {
- return userPoints;
- }
+ public void setUserPoints(Integer userPoints) {
+ this.userPoints = userPoints;
+ }
- public void setUserPoints(Integer userPoints) {
- this.userPoints = userPoints;
- }
+ public Boolean getIsPromo() {
+ return isPromo;
+ }
- public Boolean getIsPromo() {
- return isPromo;
- }
+ public void setIsPromo(Boolean isPromo) {
+ this.isPromo = isPromo;
+ }
- public void setIsPromo(Boolean isPromo) {
- this.isPromo = isPromo;
- }
+ public Integer getCurrentExperience() {
+ return currentExperience;
+ }
- public Integer getCurrentExperience() {
- return currentExperience;
- }
+ public void setCurrentExperience(Integer currentExperience) {
+ this.currentExperience = currentExperience;
+ }
- public void setCurrentExperience(Integer currentExperience) {
- this.currentExperience = currentExperience;
- }
+ public Float getCurrentSeedingHours() {
+ return currentSeedingHours;
+ }
- public Float getCurrentSeedingHours() {
- return currentSeedingHours;
- }
+ public void setCurrentSeedingHours(Float currentSeedingHours) {
+ this.currentSeedingHours = currentSeedingHours;
+ }
- public void setCurrentSeedingHours(Float currentSeedingHours) {
- this.currentSeedingHours = currentSeedingHours;
- }
+ public String getGender() {
+ return gender;
+ }
- public String getGender() {
- return gender;
- }
+ public void setGender(String gender) {
+ this.gender = gender;
+ }
- public void setGender(String gender) {
- this.gender = gender;
- }
+ public String getDescription() {
+ return description;
+ }
- public String getDescription() {
- return description;
- }
+ public void setDescription(String description) {
+ this.description = description;
+ }
- public void setDescription(String description) {
- this.description = description;
- }
+ public String getHobbies() {
+ return hobbies;
+ }
- public String getHobbies() {
- return hobbies;
- }
+ public void setHobbies(String hobbies) {
+ this.hobbies = hobbies;
+ }
- public void setHobbies(String hobbies) {
- this.hobbies = hobbies;
- }
+ public Date getRegistrationTime() {
+ return registrationTime;
+ }
- public Date getRegistrationTime() {
- return registrationTime;
- }
+ public void setRegistrationTime(Date registrationTime) {
+ this.registrationTime = 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;
+ }
+}
\ No newline at end of file