blob: 351e24d6a6a51366ca2fbbea1dcbdd587b6e15d2 [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;
wuchimedese5722e32025-04-13 17:38:50 +08007import java.sql.Timestamp;
8import lombok.Data;
夜雨声烦368e3562025-04-24 01:49:46 +08009import lombok.experimental.Accessors;
wuchimedese5722e32025-04-13 17:38:50 +080010
11@Data
12@TableName("posts")
夜雨声烦368e3562025-04-24 01:49:46 +080013@Accessors(chain = true)
wuchimedese5722e32025-04-13 17:38:50 +080014public class Post {
15 @TableId(type = IdType.AUTO)
16 private Long postId;
17
18 private Long userId;
19 private String postTitle;
20 private String postContent;
21 private Timestamp createdAt;
22 private String postType;
23
夜雨声烦f4b8b6f2025-04-24 00:58:36 +080024 @TableField("view_count")
25 private Integer viewCount = 0;
26
夜雨声烦368e3562025-04-24 01:49:46 +080027 // 新增热度评分字段
28 @TableField("hot_score")
29 private Double hotScore = 5.0; // 初始热度
30
31 // 新增最后计算时间字段
32 @TableField("last_calculated")
33 private Timestamp lastCalculated;
夜雨声烦f4b8b6f2025-04-24 00:58:36 +080034
wuchimedese5722e32025-04-13 17:38:50 +080035 @Override
36 public String toString() {
37 return "Post{" +
38 "postId=" + postId +
39 ", userId=" + userId +
40 ", postTitle='" + postTitle + '\'' +
41 ", postContent='" + postContent + '\'' +
42 ", createdAt=" + createdAt +
43 ", postType='" + postType + '\'' +
夜雨声烦368e3562025-04-24 01:49:46 +080044 ", viewCount=" + viewCount +
45 ", hotScore=" + hotScore + // 新增字段
46 ", lastCalculated=" + lastCalculated + // 新增字段
wuchimedese5722e32025-04-13 17:38:50 +080047 '}';
48 }
夜雨声烦368e3562025-04-24 01:49:46 +080049}