blob: 1a3cd25358fe3d2f64e2e4187865be209f498d51 [file] [log] [blame]
wuchimedese5722e32025-04-13 17:38:50 +08001package com.example.g8backend.entity;
2
3import com.baomidou.mybatisplus.annotation.IdType;
夜雨声烦f4b8b6f2025-04-24 00:58:36 +08004import com.baomidou.mybatisplus.annotation.TableField;
wuchimedese5722e32025-04-13 17:38:50 +08005import com.baomidou.mybatisplus.annotation.TableId;
6import com.baomidou.mybatisplus.annotation.TableName;
7
8import java.sql.Timestamp;
9import lombok.Data;
10
11@Data
12@TableName("posts")
13public class Post {
14 @TableId(type = IdType.AUTO)
15 private Long postId;
16
17 private Long userId;
18 private String postTitle;
19 private String postContent;
20 private Timestamp createdAt;
21 private String postType;
22
夜雨声烦f4b8b6f2025-04-24 00:58:36 +080023 @TableField("view_count")
24 private Integer viewCount = 0;
25
26
wuchimedese5722e32025-04-13 17:38:50 +080027 @Override
28 public String toString() {
29 return "Post{" +
30 "postId=" + postId +
31 ", userId=" + userId +
32 ", postTitle='" + postTitle + '\'' +
33 ", postContent='" + postContent + '\'' +
34 ", createdAt=" + createdAt +
35 ", postType='" + postType + '\'' +
夜雨声烦f4b8b6f2025-04-24 00:58:36 +080036 ", viewCount=" + viewCount + // ✅ 更新 toString 方法
wuchimedese5722e32025-04-13 17:38:50 +080037 '}';
38 }
39}