22301138 | f682451 | 2025-06-04 02:03:13 +0800 | [diff] [blame] | 1 | package com.example.myproject.entity; |
| 2 | |
| 3 | import com.fasterxml.jackson.annotation.JsonManagedReference; |
| 4 | |
| 5 | import javax.persistence.*; |
| 6 | |
| 7 | import java.util.Date; |
| 8 | import java.util.List; |
| 9 | |
| 10 | @Entity |
| 11 | @Table(name = "post") |
| 12 | public class Post { |
| 13 | |
| 14 | @Id |
| 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 16 | @Column(name = "postNo") |
| 17 | private Long postNo; |
| 18 | |
| 19 | |
| 20 | @Column(name = "userId") |
| 21 | private Long user_id; |
| 22 | |
| 23 | @Column(name = "postContent") |
| 24 | private String postContent; |
| 25 | |
| 26 | @Column(name = "imageUrl") |
| 27 | private String imageUrl; |
| 28 | |
| 29 | @Column(name = "postTime") |
| 30 | private Date postTime; |
| 31 | |
| 32 | @Column(name = "postLikeNum") |
| 33 | private Integer postLikeNum; |
| 34 | |
| 35 | @Column(name = "postCollectNum") |
| 36 | private Integer postCollectNum; |
| 37 | |
| 38 | @Column(name = "title") |
| 39 | private String title; |
| 40 | |
| 41 | @Column(name = "postType") |
| 42 | private String postType; |
| 43 | |
| 44 | // Getters and Setters |
| 45 | public Long getPostNo() { |
| 46 | return postNo; |
| 47 | } |
| 48 | |
| 49 | public void setPostNo(Long postNo) { |
| 50 | this.postNo = postNo; |
| 51 | } |
| 52 | |
| 53 | public Long getUser_id() { |
| 54 | return user_id; |
| 55 | } |
| 56 | |
| 57 | public void setUser_id(Long user) { |
| 58 | this.user_id = user; |
| 59 | } |
| 60 | |
| 61 | public String getPostContent() { |
| 62 | return postContent; |
| 63 | } |
| 64 | |
| 65 | public void setPostContent(String postContent) { |
| 66 | this.postContent = postContent; |
| 67 | } |
| 68 | |
| 69 | public String getImageUrl() { |
| 70 | return imageUrl; |
| 71 | } |
| 72 | |
| 73 | public void setImageUrl(String imgUrl) { |
| 74 | this.imageUrl = imgUrl; |
| 75 | } |
| 76 | |
| 77 | public Date getPostTime() { |
| 78 | return postTime; |
| 79 | } |
| 80 | |
| 81 | public void setPostTime(Date postTime) { |
| 82 | this.postTime = postTime; |
| 83 | } |
| 84 | |
| 85 | public Integer getPostLikeNum() { |
| 86 | return postLikeNum; |
| 87 | } |
| 88 | |
| 89 | public void setPostLikeNum(Integer postLikeNum) { |
| 90 | this.postLikeNum = postLikeNum; |
| 91 | } |
| 92 | |
| 93 | public Integer getPostCollectNum() { |
| 94 | return postCollectNum; |
| 95 | } |
| 96 | |
| 97 | public void setPostCollectNum(Integer postCollectNum) { |
| 98 | this.postCollectNum = postCollectNum; |
| 99 | } |
| 100 | |
| 101 | public String getTitle() { |
| 102 | return title; |
| 103 | } |
| 104 | |
| 105 | public void setTitle(String title) { |
| 106 | this.title = title; |
| 107 | } |
| 108 | |
| 109 | public String getPostType() { |
| 110 | return postType; |
| 111 | } |
| 112 | |
| 113 | public void setPostType(String postType) { |
| 114 | this.postType = postType; |
| 115 | } |
| 116 | } |