用户
Change-Id: I33150cf6ffdea3bf582023bf540394075d081af9
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/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/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/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/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;
+ }
+
+}