using SqlSugar; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; using Yi.Framework.Bbs.Domain.Shared.Enums; namespace Yi.Framework.Bbs.Domain.Entities { [SugarTable("BbsNotice")] public class BbsNoticeAggregateRoot : AggregateRoot, IHasCreationTime { public BbsNoticeAggregateRoot(NoticeTypeEnum noticeType, string message, Guid? acceptUserId = null) { this.NoticeType = noticeType; this.Message = message; this.AcceptUserId = acceptUserId; } /// /// 设置已读 /// public void SetRead() { IsRead = true; this.ReadTime = DateTime.Now; } public Guid? AcceptUserId { get; } /// /// 消息,支持html /// public string Message { get; set; } /// /// 消息类型 /// public NoticeTypeEnum NoticeType { get; } /// /// 是否已读 /// public bool IsRead { get; private set; } /// /// 已读时间 /// public DateTime? ReadTime { get; private set; } public DateTime CreationTime { get; } } }