using FreeSql.DataAnnotations; using F9WebAiTest.Domain.Common; namespace F9WebAiTest.Domain.Entities.Notice; /// 消息接收人(投递时生成,记录阅读状态与推送结果:在线推送成功 / 离线待拉取) [Table(Name = "NotificationReceivers")] [Index("IX_NotificationReceivers_MessageId_UserId", "MessageId, UserId", IsUnique = true)] [Index("IX_NotificationReceivers_UserId_ReadStatus", "UserId, ReadStatus")] public class NotificationReceiver : BaseEntity { public long MessageId { get; set; } // 消息ID public long UserId { get; set; } // 接收人用户ID public NotificationReadStatus ReadStatus { get; set; } = NotificationReadStatus.Unread; // 阅读状态 public DateTime? ReadTime { get; set; } // 阅读时间 public bool IsOffline { get; set; } // 推送时是否离线 public NotificationSendStatus SendStatus { get; set; } = NotificationSendStatus.NotSent; // 推送状态 public DateTime? SendTime { get; set; } // 推送时间 public string ErrorMsg { get; set; } = ""; // 错误信息 }