完成部分帖子相关功能,同时完善了一些用户功能
Change-Id: Ie9d22bcceec197930d48f578d8b9a749ce7a3382
diff --git a/src/main/java/com/pt/entity/Post.java b/src/main/java/com/pt/entity/Post.java
new file mode 100644
index 0000000..ef36c5c
--- /dev/null
+++ b/src/main/java/com/pt/entity/Post.java
@@ -0,0 +1,71 @@
+package com.pt.entity;
+
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+
+import java.time.LocalDate;
+
+@Entity
+public class Post {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private int pid;
+
+ private String title;
+ private String content;
+ private String author;
+ private LocalDate publishDate;
+
+ public Post() {
+ }
+
+ public Post(String title, String content, String author) {
+ this.title = title;
+ this.content = content;
+ this.author = author;
+ this.publishDate = LocalDate.now();
+ }
+
+ public int getPid() {
+ return pid;
+ }
+
+ public void setPid(int pid) {
+ this.pid = pid;
+ }
+
+ 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 getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ public LocalDate getPublishDate() {
+ return publishDate;
+ }
+
+ public void setPublishDate(LocalDate publishDate) {
+ this.publishDate = publishDate;
+ }
+}