blob: 1a3cd25358fe3d2f64e2e4187865be209f498d51 [file] [log] [blame]
package com.example.g8backend.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 java.sql.Timestamp;
import lombok.Data;
@Data
@TableName("posts")
public class Post {
@TableId(type = IdType.AUTO)
private Long postId;
private Long userId;
private String postTitle;
private String postContent;
private Timestamp createdAt;
private String postType;
@TableField("view_count")
private Integer viewCount = 0;
@Override
public String toString() {
return "Post{" +
"postId=" + postId +
", userId=" + userId +
", postTitle='" + postTitle + '\'' +
", postContent='" + postContent + '\'' +
", createdAt=" + createdAt +
", postType='" + postType + '\'' +
", viewCount=" + viewCount + // ✅ 更新 toString 方法
'}';
}
}