22301138 | f682451 | 2025-06-04 02:03:13 +0800 | [diff] [blame] | 1 | package com.example.myproject.entity; |
| 2 | |
| 3 | import javax.persistence.*; |
| 4 | import java.util.Date; |
| 5 | |
| 6 | @Entity |
| 7 | @Table(name = "user_dynamic") |
| 8 | public class UserDynamic { |
| 9 | |
| 10 | @Id |
| 11 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 12 | @Column(name = "dynamic_id") |
| 13 | private Long dynamicId; |
| 14 | |
| 15 | @Column(name = "user_id") |
| 16 | private Long userId; // 发布动态的用户ID |
| 17 | |
| 18 | @Column(name = "title") |
| 19 | private String title; // 动态标题 |
| 20 | |
| 21 | @Column(name = "content") |
| 22 | private String content; // 动态内容 |
| 23 | |
| 24 | @Column(name = "image_url") |
| 25 | private String imageUrl; // 图片URL |
| 26 | |
| 27 | @Column(name = "time") |
| 28 | private Date time; // 发布动态的时间 |
| 29 | |
| 30 | @Column(name = "likes_count") |
| 31 | private int likesCount = 0; // 点赞数 |
| 32 | |
| 33 | @Column(name = "comments_count") |
| 34 | private int commentsCount = 0; // 评论数 |
| 35 | |
| 36 | |
| 37 | public Long getDynamicId() { |
| 38 | return dynamicId; |
| 39 | } |
| 40 | |
| 41 | public void setDynamicId(Long dynamicId) { |
| 42 | this.dynamicId = dynamicId; |
| 43 | } |
| 44 | |
| 45 | public Long getUserId() { |
| 46 | return userId; |
| 47 | } |
| 48 | |
| 49 | public void setUserId(Long userId) { |
| 50 | this.userId = userId; |
| 51 | } |
| 52 | |
| 53 | public String getTitle() { |
| 54 | return title; |
| 55 | } |
| 56 | |
| 57 | public void setTitle(String title) { |
| 58 | this.title = title; |
| 59 | } |
| 60 | |
| 61 | public String getContent() { |
| 62 | return content; |
| 63 | } |
| 64 | |
| 65 | public void setContent(String content) { |
| 66 | this.content = content; |
| 67 | } |
| 68 | |
| 69 | public String getImageUrl() { |
| 70 | return imageUrl; |
| 71 | } |
| 72 | |
| 73 | public void setImageUrl(String imageUrl) { |
| 74 | this.imageUrl = imageUrl; |
| 75 | } |
| 76 | |
| 77 | public Date getTime() { |
| 78 | return time; |
| 79 | } |
| 80 | |
| 81 | public void setTime(Date time) { |
| 82 | this.time = time; |
| 83 | } |
| 84 | |
| 85 | public int getLikesCount() { |
| 86 | return likesCount; |
| 87 | } |
| 88 | |
| 89 | public void setLikesCount(int likesCount) { |
| 90 | this.likesCount = likesCount; |
| 91 | } |
| 92 | |
| 93 | public int getCommentsCount() { |
| 94 | return commentsCount; |
| 95 | } |
| 96 | |
| 97 | public void setCommentsCount(int commentsCount) { |
| 98 | this.commentsCount = commentsCount; |
| 99 | } |
| 100 | } |