bug_fix+historyview
Change-Id: I6f446c1b660a4322865cfcf5502c88cb772ca0a1
diff --git a/src/main/java/com/example/g8backend/entity/PostView.java b/src/main/java/com/example/g8backend/entity/PostView.java
new file mode 100644
index 0000000..72de7ca
--- /dev/null
+++ b/src/main/java/com/example/g8backend/entity/PostView.java
@@ -0,0 +1,20 @@
+package com.example.g8backend.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.IdType;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.time.LocalDateTime;
+
+@Data
+@Accessors(chain = true)
+@TableName("post_views") // 指定数据库表名
+public class PostView {
+ @TableId(value = "view_id", type = IdType.AUTO) // 主键映射为 view_id,自增
+ private Long viewId;
+ private Long userId; // 对应 user_id 字段(自动驼峰转下划线)
+ private Long postId; // 对应 post_id 字段(自动驼峰转下划线)
+ private LocalDateTime viewTime; // 对应 view_time 字段
+}
\ No newline at end of file