夜雨声烦 | 7e6eb38 | 2025-04-22 01:18:00 +0800 | [diff] [blame^] | 1 | // Message.java(新增) |
| 2 | package com.example.g8backend.entity; |
| 3 | import com.baomidou.mybatisplus.annotation.IdType; |
| 4 | import com.baomidou.mybatisplus.annotation.TableField; |
| 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | import lombok.Data; |
| 8 | import lombok.experimental.Accessors; |
| 9 | |
| 10 | import java.time.LocalDateTime; |
| 11 | |
| 12 | @Data |
| 13 | @Accessors(chain = true) |
| 14 | @TableName("private_messages") |
| 15 | public class Message { |
| 16 | @TableId(type = IdType.AUTO) |
| 17 | private Long messageId; |
| 18 | private Long senderId; |
| 19 | private Long receiverId; |
| 20 | private String content; |
| 21 | private LocalDateTime sentAt; |
| 22 | @TableField("is_read") |
| 23 | private Boolean isRead = false; // ✅ 默认值 |
| 24 | } |