注册登录,用户等级,社交,动态,新手任务
Change-Id: I1d3183526517fb3c0dab665e0e7547eefa5c9d76
diff --git a/src/main/java/com/example/myproject/entity/Collections.java b/src/main/java/com/example/myproject/entity/Collections.java
new file mode 100644
index 0000000..f7a8711
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Collections.java
@@ -0,0 +1,44 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "collections")
+public class Collections {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "collectionId")
+ private Long collectionId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ @Column(name = "postNo")
+ private Long postNo;
+
+ // Getters and Setters
+ public Long getCollectionId() {
+ return collectionId;
+ }
+
+ public void setCollectionId(Long collectionId) {
+ this.collectionId = collectionId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Long getPostNo() {
+ return postNo;
+ }
+
+ public void setPostNo(Long postNo) {
+ this.postNo = postNo;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Comments.java b/src/main/java/com/example/myproject/entity/Comments.java
new file mode 100644
index 0000000..fdf89fa
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Comments.java
@@ -0,0 +1,116 @@
+package com.example.myproject.entity;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "comments")
+public class Comments {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "comment_id")
+ private Long commentId;
+
+ @ManyToOne
+ @JoinColumn(name = "post_id", nullable = false)
+ @JsonBackReference
+ private Post post;
+
+ @Column(name = "content", nullable = false)
+ private String content;
+
+ @Column(name = "is_anonymous")
+ private Boolean isAnonymous; // 是否匿名
+
+ @Column(name = "likes_count")
+ private Integer likesCount = 0; // 点赞数
+
+ @Column(name = "reply_count")
+ private Integer replyCount = 0; // 回复数
+
+ @Column(name = "comment_time", nullable = false)
+ private Date commentTime; // 评论时间
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId; // 评论者的 user_id
+
+
+ @Column(name = "com_comment_id", nullable = false)
+ private Long com_comment_id;
+
+ // Getters and Setters
+
+ public Long getCommentId() {
+ return commentId;
+ }
+
+ public void setCommentId(Long commentId) {
+ this.commentId = commentId;
+ }
+
+ public Post getPost() {
+ return post;
+ }
+
+ public void setPost(Post post) {
+ this.post = post;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Boolean getIsAnonymous() {
+ return isAnonymous;
+ }
+
+ public void setIsAnonymous(Boolean isAnonymous) {
+ this.isAnonymous = isAnonymous;
+ }
+
+ public Integer getLikesCount() {
+ return likesCount;
+ }
+
+ public void setLikesCount(Integer likesCount) {
+ this.likesCount = likesCount;
+ }
+
+ public Integer getReplyCount() {
+ return replyCount;
+ }
+
+ public void setReplyCount(Integer replyCount) {
+ this.replyCount = replyCount;
+ }
+
+ public Date getCommentTime() {
+ return commentTime;
+ }
+
+ public void setCommentTime(Date commentTime) {
+ this.commentTime = commentTime;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Long getParentComment() {
+ return com_comment_id;
+ }
+
+ public void setParentComment(Long com_comment_id) {
+ this.com_comment_id = com_comment_id;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/DynamicComment.java b/src/main/java/com/example/myproject/entity/DynamicComment.java
new file mode 100644
index 0000000..d5c84d3
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/DynamicComment.java
@@ -0,0 +1,89 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "dynamic_comment")
+public class DynamicComment {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "comment_id")
+ private Long commentId;
+
+ @Column(name = "dynamic_id")
+ private Long dynamicId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ @Column(name = "comment_content")
+ private String commentContent;
+
+ @Column(name = "comment_time")
+ private Date commentTime;
+
+ @Column(name = "is_anonymous")
+ private Boolean isAnonymous = false;
+
+ @Column(name = "parent_comment_id")
+ private Long parentCommentId;
+
+ // Getters and Setters
+ public Long getCommentId() {
+ return commentId;
+ }
+
+ public void setCommentId(Long commentId) {
+ this.commentId = commentId;
+ }
+
+ public Long getDynamicId() {
+ return dynamicId;
+ }
+
+ public void setDynamicId(Long dynamicId) {
+ this.dynamicId = dynamicId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getCommentContent() {
+ return commentContent;
+ }
+
+ public void setCommentContent(String commentContent) {
+ this.commentContent = commentContent;
+ }
+
+ public Date getCommentTime() {
+ return commentTime;
+ }
+
+ public void setCommentTime(Date commentTime) {
+ this.commentTime = commentTime;
+ }
+
+ public Boolean getIsAnonymous() {
+ return isAnonymous;
+ }
+
+ public void setIsAnonymous(Boolean isAnonymous) {
+ this.isAnonymous = isAnonymous;
+ }
+
+ public Long getParentCommentId() {
+ return parentCommentId;
+ }
+
+ public void setParentCommentId(Long parentCommentId) {
+ this.parentCommentId = parentCommentId;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/DynamicLikes.java b/src/main/java/com/example/myproject/entity/DynamicLikes.java
new file mode 100644
index 0000000..986f903
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/DynamicLikes.java
@@ -0,0 +1,56 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "dynamic_likes")
+public class DynamicLikes {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "like_id")
+ private Long likeId;
+
+ @Column(name = "dynamic_id")
+ private Long dynamicId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ @Column(name = "like_time")
+ private Date likeTime;
+
+ // Getters and Setters
+ public Long getLikeId() {
+ return likeId;
+ }
+
+ public void setLikeId(Long likeId) {
+ this.likeId = likeId;
+ }
+
+ public Long getDynamicId() {
+ return dynamicId;
+ }
+
+ public void setDynamicId(Long dynamicId) {
+ this.dynamicId = dynamicId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Date getLikeTime() {
+ return likeTime;
+ }
+
+ public void setLikeTime(Date likeTime) {
+ this.likeTime = likeTime;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/EntityBase.java b/src/main/java/com/example/myproject/entity/EntityBase.java
deleted file mode 100644
index 48583cb..0000000
--- a/src/main/java/com/example/myproject/entity/EntityBase.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.example.myproject.entity;
-
-
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-
-import java.util.Objects;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * Base class for an entity, as explained in the book "Domain Driven Design".
- * All entities in this project have an identity attribute with type Long and
- * name id. Inspired by the DDD Sample project.
-
- */
-@Setter
-@Getter
-public abstract class EntityBase {
-
- /**
- * This identity field has the wrapper class type Long so that an entity which
- * has not been saved is recognizable by a null identity.
- */
- @TableId(type = IdType.AUTO)
- private Integer id;
-
- @Override
- public boolean equals(final Object object) {
- if (!(object instanceof EntityBase)) {
- return false;
- }
- if (!getClass().equals(object.getClass())) {
- return false;
- }
- final EntityBase that = (EntityBase) object;
- _checkIdentity(this);
- _checkIdentity(that);
- return this.id.equals(that.getId());
- }
-
-
- private void _checkIdentity(final EntityBase entity) {
- if (entity.getId() == null) {
- throw new IllegalStateException("Comparison identity missing in entity: " + entity);
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(this.getId());
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName() + "<" + getId() + ">";
- }
-
-}
diff --git a/src/main/java/com/example/myproject/entity/ExperienceHistory.java b/src/main/java/com/example/myproject/entity/ExperienceHistory.java
new file mode 100644
index 0000000..8c52f6b
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/ExperienceHistory.java
@@ -0,0 +1,67 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "experience_history")
+public class ExperienceHistory {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "history_id")
+ private Long historyId;
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId;
+
+ @Column(name = "experience_change", nullable = false)
+ private Integer experienceChange; // 经验值变化量
+
+ @Column(name = "source", nullable = false)
+ private String source; // 更新来源
+
+ @Column(name = "update_time", nullable = false)
+ private Date updateTime; // 更新操作的时间
+
+ // Getters and Setters
+ public Long getHistoryId() {
+ return historyId;
+ }
+
+ public void setHistoryId(Long historyId) {
+ this.historyId = historyId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Integer getExperienceChange() {
+ return experienceChange;
+ }
+
+ public void setExperienceChange(Integer experienceChange) {
+ this.experienceChange = experienceChange;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public Date getUpdateTime() {
+ return updateTime;
+ }
+
+ public void setUpdateTime(Date updateTime) {
+ this.updateTime = updateTime;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/FavoriteEntity.java b/src/main/java/com/example/myproject/entity/FavoriteEntity.java
deleted file mode 100644
index 3f76cfe..0000000
--- a/src/main/java/com/example/myproject/entity/FavoriteEntity.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.example.myproject.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.util.Date;
-
-@Data
-@TableName("favorite")
-@ApiModel("收藏实体类")
-public class FavoriteEntity {
- @TableId(type = IdType.AUTO)
- @ApiModelProperty(value = "收藏ID", example = "1")
- private Long id;
-
- @ApiModelProperty(value = "用户ID", example = "1001")
- @JsonProperty("userId")
- @TableField("user_id")
- private Long userId;
-
- @ApiModelProperty(value = "种子ID", example = "2001")
- @JsonProperty("seedId")
- @TableField("seed_id")
- private Long seedId;
-
- @ApiModelProperty(value = "收藏时间", example = "2024-05-13 12:00:00")
- @JsonProperty("createTime")
- @TableField("create_time")
- private Date createTime;
-}
\ No newline at end of file
diff --git a/src/main/java/com/example/myproject/entity/FriendRelation.java b/src/main/java/com/example/myproject/entity/FriendRelation.java
new file mode 100644
index 0000000..c086001
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/FriendRelation.java
@@ -0,0 +1,56 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "friend_relation")
+public class FriendRelation {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "relation_id")
+ private Long relationId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ @Column(name = "friend_id")
+ private Long friendId; // 好友ID
+
+ @Column(name = "create_time")
+ private Date createTime; // 好友关系创建时间
+
+ // Getters and Setters
+ public Long getRelationId() {
+ return relationId;
+ }
+
+ public void setRelationId(Long relationId) {
+ this.relationId = relationId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Long getFriendId() {
+ return friendId;
+ }
+
+ public void setFriendId(Long friendId) {
+ this.friendId = friendId;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Group.java b/src/main/java/com/example/myproject/entity/Group.java
new file mode 100644
index 0000000..ea4f2c7
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Group.java
@@ -0,0 +1,98 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "group_interests")
+public class Group {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "group_id")
+ private Long groupId;
+
+ @Column(name = "group_name")
+ private String groupName;
+
+ private String description; // 小组简介
+
+ @Column(name = "create_time")
+ private Date createTime; // 创建时间
+
+ @Column(name = "user_id")
+ private Long userId; // 创建该小组的用户ID
+
+ @Column(name = "member_count")
+ private Integer memberCount; // 小组成员人数
+
+ private String category; // 小组类别
+
+ @Column(name = "cover_image")
+ private String coverImage; // 小组封面图片
+
+ // Getters and Setters
+ public Long getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(Long groupId) {
+ this.groupId = groupId;
+ }
+
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public void setGroupName(String groupName) {
+ this.groupName = groupName;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Integer getMemberCount() {
+ return memberCount;
+ }
+
+ public void setMemberCount(Integer memberCount) {
+ this.memberCount = memberCount;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getCoverImage() {
+ return coverImage;
+ }
+
+ public void setCoverImage(String coverImage) {
+ this.coverImage = coverImage;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/GroupComments.java b/src/main/java/com/example/myproject/entity/GroupComments.java
new file mode 100644
index 0000000..fcf4205
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/GroupComments.java
@@ -0,0 +1,77 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "group_comments")
+public class GroupComments {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "comment_id")
+ private Long commentId; // 评论ID
+
+ @Column(name = "group_post_id")
+ private Long groupPostId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ private String content;
+
+ @Column(name = "parent_comment_id")
+ private Long parentCommentId;
+
+ @Column(name = "time")
+ private Date time; // 评论时间
+
+ // Getters and Setters
+ public Long getCommentId() {
+ return commentId;
+ }
+
+ public void setCommentId(Long commentId) {
+ this.commentId = commentId;
+ }
+
+ public Long getGroupPostId() {
+ return groupPostId;
+ }
+
+ public void setGroupPostId(Long groupPostId) {
+ this.groupPostId = groupPostId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Long getParentCommentId() {
+ return parentCommentId;
+ }
+
+ public void setParentCommentId(Long parentCommentId) {
+ this.parentCommentId = parentCommentId;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/GroupMembers.java b/src/main/java/com/example/myproject/entity/GroupMembers.java
new file mode 100644
index 0000000..e66e18c
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/GroupMembers.java
@@ -0,0 +1,44 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "group_members")
+public class GroupMembers {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "relation_id")
+ private Long relationId;
+
+ @Column(name = "group_id", nullable = false)
+ private Long groupId;
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId;
+
+ // Getters and Setters
+ public Long getRelationId() {
+ return relationId;
+ }
+
+ public void setRelationId(Long relationId) {
+ this.relationId = relationId;
+ }
+
+ public Long getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(Long groupId) {
+ this.groupId = groupId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/GroupPost.java b/src/main/java/com/example/myproject/entity/GroupPost.java
new file mode 100644
index 0000000..89867f7
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/GroupPost.java
@@ -0,0 +1,109 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "group_post")
+public class GroupPost {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "group_post_id")
+ private Long groupPostId;
+
+ @Column(name = "group_id")
+ private Long groupId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ private String content;
+
+ private String image;
+
+ @Column(name = "like_count")
+ private Integer likeCount;
+
+ @Column(name = "comment_count")
+ private Integer commentCount; // 帖子评论数
+
+ @Column(name = "time")
+ private Date time; // 帖子创建时间
+
+ private String title;
+
+
+ // Getters and Setters
+ public Long getGroupPostId() {
+ return groupPostId;
+ }
+
+ public void setGroupPostId(Long groupPostId) {
+ this.groupPostId = groupPostId;
+ }
+
+ public Long getGroupId() {
+ return groupId;
+ }
+
+ public void setGroupId(Long groupId) {
+ this.groupId = groupId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getImage() {
+ return image;
+ }
+
+ public void setImage(String image) {
+ this.image = image;
+ }
+
+ public Integer getLikeCount() {
+ return likeCount;
+ }
+
+ public void setLikeCount(Integer likeCount) {
+ this.likeCount = likeCount;
+ }
+
+ public Integer getCommentCount() {
+ return commentCount;
+ }
+
+ public void setCommentCount(Integer commentCount) {
+ this.commentCount = commentCount;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Level.java b/src/main/java/com/example/myproject/entity/Level.java
new file mode 100644
index 0000000..6837ef9
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Level.java
@@ -0,0 +1,89 @@
+package com.example.myproject.entity;
+
+
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "level")
+public class Level {
+
+ @Id
+ @Column(name = "level_id")
+ private Long levelId; // 等级唯一标识
+
+ @Column(name = "level_name", nullable = false)
+ private String levelName; // 等级名称
+
+ @Column(name = "required_experience", nullable = false)
+ private Long requiredExperience; // 所需经验值
+
+ @Column(name = "required_share_ratio")
+ private Float requiredShareRatio; // 所需分享率
+
+ @Column(name = "required_upload_gb")
+ private Float requiredUploadGb; // 所需上传数据量
+
+ @Column(name = "required_seeding_hours")
+ private Float requiredSeedingHours; // 所需做种时长
+
+ @Column(name = "permissions")
+ private String permissions; // 拥有的权限
+
+ // Getters and Setters
+ public Long getLevelId() {
+ return levelId;
+ }
+
+ public void setLevelId(Long levelId) {
+ this.levelId = levelId;
+ }
+
+ public String getLevelName() {
+ return levelName;
+ }
+
+ public void setLevelName(String levelName) {
+ this.levelName = levelName;
+ }
+
+ public Long getRequiredExperience() {
+ return requiredExperience;
+ }
+
+ public void setRequiredExperience(Long requiredExperience) {
+ this.requiredExperience = requiredExperience;
+ }
+
+ public Float getRequiredShareRatio() {
+ return requiredShareRatio;
+ }
+
+ public void setRequiredShareRatio(Float requiredShareRatio) {
+ this.requiredShareRatio = requiredShareRatio;
+ }
+
+ public Float getRequiredUploadGb() {
+ return requiredUploadGb;
+ }
+
+ public void setRequiredUploadGb(Float requiredUploadGb) {
+ this.requiredUploadGb = requiredUploadGb;
+ }
+
+ public Float getRequiredSeedingHours() {
+ return requiredSeedingHours;
+ }
+
+ public void setRequiredSeedingHours(Float requiredSeedingHours) {
+ this.requiredSeedingHours = requiredSeedingHours;
+ }
+
+ public String getPermissions() {
+ return permissions;
+ }
+
+ public void setPermissions(String permissions) {
+ this.permissions = permissions;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Likes.java b/src/main/java/com/example/myproject/entity/Likes.java
new file mode 100644
index 0000000..7a3dcda
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Likes.java
@@ -0,0 +1,44 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "likes")
+public class Likes {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY) // 使用自增主键
+ @Column(name = "likeId")
+ private Long likeId;
+
+ @Column(name = "user_id")
+ private Long userId;
+
+ @Column(name = "postNo")
+ private Long postNo;
+
+ // Getters and Setters
+ public Long getLikeId() {
+ return likeId;
+ }
+
+ public void setLikeId(Long likeId) {
+ this.likeId = likeId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Long getPostNo() {
+ return postNo;
+ }
+
+ public void setPostNo(Long postNo) {
+ this.postNo = postNo;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Post.java b/src/main/java/com/example/myproject/entity/Post.java
new file mode 100644
index 0000000..bb94aac
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Post.java
@@ -0,0 +1,116 @@
+package com.example.myproject.entity;
+
+import com.fasterxml.jackson.annotation.JsonManagedReference;
+
+import javax.persistence.*;
+
+import java.util.Date;
+import java.util.List;
+
+@Entity
+@Table(name = "post")
+public class Post {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "postNo")
+ private Long postNo;
+
+
+ @Column(name = "userId")
+ private Long user_id;
+
+ @Column(name = "postContent")
+ private String postContent;
+
+ @Column(name = "imageUrl")
+ private String imageUrl;
+
+ @Column(name = "postTime")
+ private Date postTime;
+
+ @Column(name = "postLikeNum")
+ private Integer postLikeNum;
+
+ @Column(name = "postCollectNum")
+ private Integer postCollectNum;
+
+ @Column(name = "title")
+ private String title;
+
+ @Column(name = "postType")
+ private String postType;
+
+ // Getters and Setters
+ public Long getPostNo() {
+ return postNo;
+ }
+
+ public void setPostNo(Long postNo) {
+ this.postNo = postNo;
+ }
+
+ public Long getUser_id() {
+ return user_id;
+ }
+
+ public void setUser_id(Long user) {
+ this.user_id = user;
+ }
+
+ public String getPostContent() {
+ return postContent;
+ }
+
+ public void setPostContent(String postContent) {
+ this.postContent = postContent;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imgUrl) {
+ this.imageUrl = imgUrl;
+ }
+
+ public Date getPostTime() {
+ return postTime;
+ }
+
+ public void setPostTime(Date postTime) {
+ this.postTime = postTime;
+ }
+
+ public Integer getPostLikeNum() {
+ return postLikeNum;
+ }
+
+ public void setPostLikeNum(Integer postLikeNum) {
+ this.postLikeNum = postLikeNum;
+ }
+
+ public Integer getPostCollectNum() {
+ return postCollectNum;
+ }
+
+ public void setPostCollectNum(Integer postCollectNum) {
+ this.postCollectNum = postCollectNum;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getPostType() {
+ return postType;
+ }
+
+ public void setPostType(String postType) {
+ this.postType = postType;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Promotion.java b/src/main/java/com/example/myproject/entity/Promotion.java
deleted file mode 100644
index 4ca846b..0000000
--- a/src/main/java/com/example/myproject/entity/Promotion.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.example.myproject.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-import java.util.List;
-
-@Data
-@TableName("promotion")
-public class Promotion {
- @TableId(type = IdType.AUTO)
- private Long id;
-
- private String name;
-
- private String description;
-
- private LocalDateTime startTime;
-
- private LocalDateTime endTime;
-
- private double discountPercentage;
-
- private String applicableTorrentIds;
-
- private LocalDateTime createTime;
-
- private LocalDateTime updateTime;
-
- private Boolean isDeleted;
-}
\ No newline at end of file
diff --git a/src/main/java/com/example/myproject/entity/SeedComment.java b/src/main/java/com/example/myproject/entity/SeedComment.java
new file mode 100644
index 0000000..af6e91f
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/SeedComment.java
@@ -0,0 +1,118 @@
+package com.example.myproject.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.*;
+
+
+import java.util.Date;
+
+@Entity
+@Table(name = "seed_comments") // 映射到数据库表 seed_comments
+public class SeedComment {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY) // 自增主键
+ @Column(name = "comment_id") // 映射到表的 comment_id 列
+ private long commentId;
+
+
+ @Column(name = "seed_id", nullable = false)
+ private long seedId;
+
+
+ @Column(name = "com_comment_id", nullable = true)
+ private long comCommentId; // 外键,指向父评论的 comment_id
+
+
+ @Column(name = "user_id",nullable = false)
+ private long userId;
+
+ @Column(name = "content", nullable = false)
+ private String content;
+
+ @Column(name = "is_anonymous")
+ private byte isAnonymous;
+
+ @Column(name = "likes_count", nullable = false)
+ private int likesCount;
+
+ @Column(name = "reply_count", nullable = false)
+ private int replyCount;
+
+ @Column(name = "comment_time")
+ private Date commentTime;
+
+ // Getter 和 Setter 方法
+
+ public long getCommentId() {
+ return commentId;
+ }
+
+ public void setCommentId(long commentId) {
+ this.commentId = commentId;
+ }
+
+ public long getSeedId() {
+ return seedId;
+ }
+
+ public void setSeedId(long seedId) {
+ this.seedId = seedId;
+ }
+
+ public long getComCommentId() {
+ return comCommentId;
+ }
+
+ public void setComCommentId(long comCommentId) {
+ this.comCommentId = comCommentId;
+ }
+
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public byte getIsAnonymous() {
+ return isAnonymous;
+ }
+
+ public void setIsAnonymous(byte isAnonymous) {
+ this.isAnonymous = isAnonymous;
+ }
+
+ public int getLikesCount() {
+ return likesCount;
+ }
+
+ public void setLikesCount(int likesCount) {
+ this.likesCount = likesCount;
+ }
+
+ public int getReplyCount() {
+ return replyCount;
+ }
+
+ public void setReplyCount(int replyCount) {
+ this.replyCount = replyCount;
+ }
+
+ public Date getCommentTime() {
+ return commentTime;
+ }
+
+ public void setCommentTime(Date commentTime) {
+ this.commentTime = commentTime;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/SeedCommentLikes.java b/src/main/java/com/example/myproject/entity/SeedCommentLikes.java
new file mode 100644
index 0000000..65f7fc6
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/SeedCommentLikes.java
@@ -0,0 +1,55 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "seed_comment_likes")
+public class SeedCommentLikes {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private Long id; // 点赞ID
+
+ @Column(name = "comment_id", nullable = false)
+ private Long commentId; // 被点赞的评论ID
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId; // 点赞的用户ID
+
+ @Column(name = "is_liked", nullable = false)
+ private Boolean isLiked = true; // 点赞状态,默认为true(点赞)
+
+ // Getters and Setters
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public Long getCommentId() {
+ return commentId;
+ }
+
+ public void setCommentId(Long commentId) {
+ this.commentId = commentId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public Boolean getIsLiked() {
+ return isLiked;
+ }
+
+ public void setIsLiked(Boolean isLiked) {
+ this.isLiked = isLiked;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/Task.java b/src/main/java/com/example/myproject/entity/Task.java
new file mode 100644
index 0000000..15796a1
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/Task.java
@@ -0,0 +1,66 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "tasks")
+public class Task {
+
+ @Id
+ @Column(name = "task_id")
+ private String taskId;
+
+ @Column(name = "title", nullable = false)
+ private String title;
+
+ @Column(name = "description", nullable = false)
+ private String description;
+
+ @Column(name = "reward_experience", nullable = false)
+ private int rewardExperience; // 任务奖励的经验
+
+ @Column(name = "reward_points", nullable = false)
+ private int rewardPoints; // 任务奖励的积分
+
+
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+
+ public int getRewardExperience() {
+ return rewardExperience;
+ }
+
+ public void setRewardExperience(int rewardExperience) {
+ this.rewardExperience = rewardExperience;
+ }
+
+ public int getRewardPoints() {
+ return rewardPoints;
+ }
+
+ public void setRewardPoints(int rewardPoints) {
+ this.rewardPoints = rewardPoints;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/TorrentEntity.java b/src/main/java/com/example/myproject/entity/TorrentEntity.java
deleted file mode 100644
index f62fb76..0000000
--- a/src/main/java/com/example/myproject/entity/TorrentEntity.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package com.example.myproject.entity;
-
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-import java.util.Date;
-import java.util.List;
-
-@Data
-@TableName("torrent")
-@ApiModel("种子实体类")
-public class TorrentEntity {
-
- @TableId(type = IdType.AUTO)
- @ApiModelProperty(value = "种子ID", example = "1")
- private Long id;
-
- @JsonProperty("infoHash")
- @ApiModelProperty(value = "种子信息哈希", example = "abcdef123456")
- private String infoHash;
-
- @JsonProperty("fileName")
- @ApiModelProperty(value = "种子文件名", example = "movie_torrent_file.torrent")
- private String fileName;
-
- @JsonProperty("uploader")
- @ApiModelProperty(value = "上传者", example = "user123")
- private String uploader;
-
- @JsonProperty("createdTime")
- @ApiModelProperty(value = "上传时间", example = "2024-01-01 12:00:00")
- @TableField(fill = FieldFill.INSERT)
- private LocalDateTime createTime;
-
- @JsonProperty("updateTime")
- @ApiModelProperty(value = "更新时间", example = "2024-01-01 12:00:00")
-
- @TableField(fill = FieldFill.INSERT_UPDATE)
- private LocalDateTime updateTime;
-
- @JsonProperty("size")
- @ApiModelProperty(value = "种子文件大小", example = "123456")
- private Long size;
-
- @JsonProperty("title")
- @ApiModelProperty(value = "种子标题", example = "《星际穿越》")
- private String title;
-
- @JsonProperty("description")
- @ApiModelProperty(value = "种子描述", example = "这是一部好看的科幻电影")
- private String description;
-
- @JsonProperty("tags")
- @ApiModelProperty(value = "种子标签", example = "[\"科幻\",\"动作\"]")
- private String tags;
-
- @JsonProperty("category")
- @ApiModelProperty(value = "种子分类", example = "movie")
- private String category;
-
- @JsonProperty("imageUrl")
- @ApiModelProperty(value = "种子封面图URL", example = "http://example.com/images/cover.jpg")
- private String imageUrl;
-
- @JsonProperty("leechers")
- @ApiModelProperty(value = "下载次数", example = "123")
- private Integer leechers;
-
- @JsonProperty("seeders")
- @ApiModelProperty(value = "做种数", example = "10")
- private Integer seeders;
-
- @JsonProperty("comments")
- @ApiModelProperty(value = "评论数", example = "5")
- private Integer comments;
-
- @JsonProperty("views")
- @ApiModelProperty(value = "浏览次数", example = "1000")
- private Integer views;
-
- @JsonProperty("hits")
- @ApiModelProperty(value = "点击次数", example = "2000")
- private Integer hits;
-
- @JsonProperty("promotionTimeType")
- @ApiModelProperty(value = "促销时间类型", example = "1")
- private Integer promotionTimeType;
-
- @JsonProperty("promotionUntil")
- @ApiModelProperty(value = "促销截止日期", example = "2024-12-31T23:59:59")
- private LocalDateTime promotionUntil;
-
-
- @JsonProperty("torrentFile")
- @ApiModelProperty(value = "种子文件", example = "base64 encoded torrent file")
- private byte[] torrentFile;
-
- @JsonProperty("isDeleted")
- @ApiModelProperty(value = "是否删除", example = "false")
- private Boolean isDeleted;
-
- public TorrentEntity() {
- }
-}
\ No newline at end of file
diff --git a/src/main/java/com/example/myproject/entity/User.java b/src/main/java/com/example/myproject/entity/User.java
deleted file mode 100644
index 7574e67..0000000
--- a/src/main/java/com/example/myproject/entity/User.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.example.myproject.entity;
-
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-@Data
-@TableName("user") // 指定数据库表名
-@ApiModel("用户实体类") // 用于描述模型
-public class User {
-
- @TableId(type = IdType.AUTO) // 指定主键策略
- @ApiModelProperty(value = "用户ID", example = "1")
- private Long id;
-
- @JsonProperty("username")
- @ApiModelProperty(value = "用户名", example = "22301115")
- private String username;
-
- @JsonProperty("nickname")
- @ApiModelProperty(value = "昵称", example = "cyl")
- private String nickname;
-
- @JsonProperty("role")
- @ApiModelProperty(value = "角色", example = "Student")
- private String role;
-
- @JsonProperty("password")
- @ApiModelProperty(value = "密码", example = "123")
- private String password;
-
- @JsonProperty("status")
- @ApiModelProperty(value = "用户状态", example = "1")
- private int status;
-
- @JsonProperty("email")
- @ApiModelProperty(value = "电子邮件地址", example = "john_doe@example.com")
- private String email;
-
- @JsonProperty("email_verified")
- @ApiModelProperty(value = "邮箱验证状态", example = "true")
- private boolean emailVerified;
-
- @JsonProperty("avatar")
- @ApiModelProperty(value = "头像")
- private String avatar;
-
- @JsonProperty("uploaded")
- @ApiModelProperty(value = "上传量", example = "1000")
- private Long uploaded;
-
- @JsonProperty("downloaded")
- @ApiModelProperty(value = "下载量", example = "500")
- private Long downloaded;
-
- @JsonProperty("create_time")
- @ApiModelProperty(value = "创建时间", example = "2024-04-01T12:00:00")
- private LocalDateTime createTime;
-
- @JsonProperty("update_time")
- @ApiModelProperty(value = "更新时间", example = "2024-04-01T12:00:00")
- private LocalDateTime updateTime;
-
- @JsonProperty("is_deleted")
- @ApiModelProperty(value = "是否删除", example = "false")
- private Boolean isDeleted;
-
- public User() {
- }
-}
diff --git a/src/main/java/com/example/myproject/entity/UserDetails.java b/src/main/java/com/example/myproject/entity/UserDetails.java
deleted file mode 100644
index 9af35f0..0000000
--- a/src/main/java/com/example/myproject/entity/UserDetails.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.example.myproject.entity;
-
-import org.springframework.security.core.GrantedAuthority;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-public interface UserDetails extends Serializable {
- Collection<? extends GrantedAuthority> getAuthorities();
-
- String getPassword();
-
- String getUsername();
-
- boolean isAccountNonExpired();
-
- boolean isAccountNonLocked();
-
- boolean isCredentialsNonExpired();
-
- boolean isEnabled();
-}
-
diff --git a/src/main/java/com/example/myproject/entity/UserDynamic.java b/src/main/java/com/example/myproject/entity/UserDynamic.java
new file mode 100644
index 0000000..a04d3ac
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserDynamic.java
@@ -0,0 +1,100 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "user_dynamic")
+public class UserDynamic {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "dynamic_id")
+ private Long dynamicId;
+
+ @Column(name = "user_id")
+ private Long userId; // 发布动态的用户ID
+
+ @Column(name = "title")
+ private String title; // 动态标题
+
+ @Column(name = "content")
+ private String content; // 动态内容
+
+ @Column(name = "image_url")
+ private String imageUrl; // 图片URL
+
+ @Column(name = "time")
+ private Date time; // 发布动态的时间
+
+ @Column(name = "likes_count")
+ private int likesCount = 0; // 点赞数
+
+ @Column(name = "comments_count")
+ private int commentsCount = 0; // 评论数
+
+
+ public Long getDynamicId() {
+ return dynamicId;
+ }
+
+ public void setDynamicId(Long dynamicId) {
+ this.dynamicId = dynamicId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public int getLikesCount() {
+ return likesCount;
+ }
+
+ public void setLikesCount(int likesCount) {
+ this.likesCount = likesCount;
+ }
+
+ public int getCommentsCount() {
+ return commentsCount;
+ }
+
+ public void setCommentsCount(int commentsCount) {
+ this.commentsCount = commentsCount;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/UserFollow.java b/src/main/java/com/example/myproject/entity/UserFollow.java
new file mode 100644
index 0000000..bfc14f7
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserFollow.java
@@ -0,0 +1,56 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "follow")
+public class UserFollow {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "record_id")
+ private Long recordId;
+
+ @Column(name = "follower_id")
+ private Long followerId;
+
+ @Column(name = "followed_id")
+ private Long followedId;
+
+ @Column(name = "follow_time")
+ private Date followTime;
+
+ // Getters and Setters
+ public Long getId() {
+ return recordId;
+ }
+
+ public void setId(Long recordId) {
+ this.recordId = recordId;
+ }
+
+ public Long getFollowerId() {
+ return followerId;
+ }
+
+ public void setFollowerId(Long followerId) {
+ this.followerId = followerId;
+ }
+
+ public Long getFollowedId() {
+ return followedId;
+ }
+
+ public void setFollowedId(Long followedId) {
+ this.followedId = followedId;
+ }
+
+ public Date getFollowTime() {
+ return followTime;
+ }
+
+ public void setFollowTime(Date followTime) {
+ this.followTime = followTime;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/UserInviteCode.java b/src/main/java/com/example/myproject/entity/UserInviteCode.java
new file mode 100644
index 0000000..8343c7e
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserInviteCode.java
@@ -0,0 +1,67 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@Entity
+@Table(name = "user_invite_code")
+public class UserInviteCode {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "invite_id")
+ private Long inviteId;
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId;
+
+ @Column(name = "invite_code", nullable = false, unique = true)
+ private String inviteCode;
+
+ @Column(name = "is_used", nullable = false)
+ private Boolean isUsed = false;
+
+ @Column(name = "created_at", nullable = false)
+ private LocalDateTime createdAt;
+
+ // Getters and Setters
+ public Long getInviteId() {
+ return inviteId;
+ }
+
+ public void setInviteId(Long inviteId) {
+ this.inviteId = inviteId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getInviteCode() {
+ return inviteCode;
+ }
+
+ public void setInviteCode(String inviteCode) {
+ this.inviteCode = inviteCode;
+ }
+
+ public Boolean getIsUsed() {
+ return isUsed;
+ }
+
+ public void setIsUsed(Boolean isUsed) {
+ this.isUsed = isUsed;
+ }
+
+ public LocalDateTime getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(LocalDateTime createdAt) {
+ this.createdAt = createdAt;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/UserMessages.java b/src/main/java/com/example/myproject/entity/UserMessages.java
new file mode 100644
index 0000000..ee7e43e
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserMessages.java
@@ -0,0 +1,67 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+import java.util.Date;
+
+@Entity
+@Table(name = "user_messages")
+public class UserMessages {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "message_id")
+ private Long messageId;
+
+ @Column(name = "sender_id")
+ private Long senderId;
+
+ @Column(name = "receiver_id")
+ private Long receiverId;
+
+ @Column(name = "content")
+ private String content;
+
+ @Column(name = "time")
+ private Date time;
+
+
+ public Long getMessageId() {
+ return messageId;
+ }
+
+ public void setMessageId(Long messageId) {
+ this.messageId = messageId;
+ }
+
+ public Long getSenderId() {
+ return senderId;
+ }
+
+ public void setSenderId(Long senderId) {
+ this.senderId = senderId;
+ }
+
+ public Long getReceiverId() {
+ return receiverId;
+ }
+
+ public void setReceiverId(Long receiverId) {
+ this.receiverId = receiverId;
+ }
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+}
diff --git a/src/main/java/com/example/myproject/entity/UserTaskStatus.java b/src/main/java/com/example/myproject/entity/UserTaskStatus.java
new file mode 100644
index 0000000..a66839d
--- /dev/null
+++ b/src/main/java/com/example/myproject/entity/UserTaskStatus.java
@@ -0,0 +1,98 @@
+package com.example.myproject.entity;
+
+import javax.persistence.*;
+
+@Entity
+@Table(name = "user_task_status")
+public class UserTaskStatus {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "status_id")
+ private Long statusId;
+
+ @Column(name = "user_id", nullable = false)
+ private Long userId;
+
+ @Column(name = "task_id", nullable = false)
+ private String taskId;
+
+ @Column(name = "current_progress", nullable = false)
+ private Float currentProgress;
+
+ @Column(name = "current_experience", nullable = false)
+ private Integer currentExperience;
+
+ @Column(name = "current_points", nullable = false)
+ private Integer currentPoints;
+
+ @Column(name = "status", nullable = false)
+ private String status;
+
+ @Column(name = "is_reward_claimed", nullable = false)
+ private Boolean isRewardClaimed = false;
+
+ public Long getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(Long statusId) {
+ this.statusId = statusId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public Float getCurrentProgress() {
+ return currentProgress;
+ }
+
+ public void setCurrentProgress(Float currentProgress) {
+ this.currentProgress = currentProgress;
+ }
+
+ public Integer getCurrentExperience() {
+ return currentExperience;
+ }
+
+ public void setCurrentExperience(Integer currentExperience) {
+ this.currentExperience = currentExperience;
+ }
+
+ public Integer getCurrentPoints() {
+ return currentPoints;
+ }
+
+ public void setCurrentPoints(Integer currentPoints) {
+ this.currentPoints = currentPoints;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public Boolean getIsRewardClaimed() {
+ return isRewardClaimed;
+ }
+
+ public void setIsRewardClaimed(Boolean isRewardClaimed) {
+ this.isRewardClaimed = isRewardClaimed;
+ }
+}
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;
+ }
+
+}
diff --git a/src/main/java/com/example/myproject/entity/VerificationToken.java b/src/main/java/com/example/myproject/entity/VerificationToken.java
deleted file mode 100644
index 231fd95..0000000
--- a/src/main/java/com/example/myproject/entity/VerificationToken.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.example.myproject.entity;
-
-import com.baomidou.mybatisplus.annotation.*;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.AllArgsConstructor;
-
-import java.time.Instant;
-
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@TableName("verification_token")
-@ApiModel("验证令牌实体类")
-public class VerificationToken {
-
- @TableId(type = IdType.AUTO)
- @ApiModelProperty(value = "令牌ID")
- private Long id;
-
- @ApiModelProperty(value = "令牌字符串")
- @TableField("token")
- private String token;
-
- @ApiModelProperty(value = "令牌过期日期")
- @TableField("expiry_date")
- private Instant expiryDate;
-
- @ApiModelProperty(value = "用户名")
- @TableField("username")
- private String username;
-
- @ApiModelProperty(value = "电子邮件地址")
- @TableField("email")
- private String email;
-
- @ApiModelProperty(value = "加密后的密码")
- @TableField("password")
- private String password;
-
- public VerificationToken(String token, String username, String email, String password, Instant expiryDate) {
- this.token = token;
- this.username = username;
- this.email = email;
- this.password = password;
- this.expiryDate = expiryDate;
- }
-
- /**
- * 检查令牌是否过期
- * @return true 如果令牌已过期
- */
- public boolean isExpired() {
- return expiryDate.isBefore(Instant.now());
- }
-}