夜雨声烦 | 0206359 | 2025-04-23 18:10:00 +0800 | [diff] [blame^] | 1 | package com.example.g8backend.entity; |
| 2 | |
| 3 | import java.sql.Timestamp; |
| 4 | |
| 5 | public class PostLike { |
| 6 | |
| 7 | private Long userId; |
| 8 | private Long postId; |
| 9 | private Timestamp createdAt; |
| 10 | |
| 11 | public PostLike(Long userId, Long postId) { |
| 12 | this.userId = userId; |
| 13 | this.postId = postId; |
| 14 | this.createdAt = new Timestamp(System.currentTimeMillis()); |
| 15 | } |
| 16 | |
| 17 | // Getters and Setters |
| 18 | public Long getUserId() { |
| 19 | return userId; |
| 20 | } |
| 21 | |
| 22 | public void setUserId(Long userId) { |
| 23 | this.userId = userId; |
| 24 | } |
| 25 | |
| 26 | public Long getPostId() { |
| 27 | return postId; |
| 28 | } |
| 29 | |
| 30 | public void setPostId(Long postId) { |
| 31 | this.postId = postId; |
| 32 | } |
| 33 | |
| 34 | public Timestamp getCreatedAt() { |
| 35 | return createdAt; |
| 36 | } |
| 37 | |
| 38 | public void setCreatedAt(Timestamp createdAt) { |
| 39 | this.createdAt = createdAt; |
| 40 | } |
| 41 | } |