Files
Yi.Admin/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Domain/Entities/BbsNoticeAggregateRoot.cs

60 lines
1.4 KiB
C#
Raw Normal View History

2024-05-22 22:16:44 +08:00
using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Bbs.Domain.Shared.Enums;
namespace Yi.Framework.Bbs.Domain.Entities
2024-05-22 14:35:08 +08:00
{
2024-05-22 22:16:44 +08:00
[SugarTable("BbsNotice")]
public class BbsNoticeAggregateRoot : AggregateRoot<Guid>, IHasCreationTime
2024-05-22 14:35:08 +08:00
{
2024-05-23 23:40:55 +08:00
public BbsNoticeAggregateRoot()
{
}
2024-05-22 22:16:44 +08:00
public BbsNoticeAggregateRoot(NoticeTypeEnum noticeType, string message, Guid? acceptUserId = null)
{
this.NoticeType = noticeType;
this.Message = message;
this.AcceptUserId = acceptUserId;
}
/// <summary>
/// 设置已读
/// </summary>
public void SetRead()
{
IsRead = true;
this.ReadTime = DateTime.Now;
}
public Guid? AcceptUserId { get; }
2024-05-22 14:35:08 +08:00
/// <summary>
2024-05-22 22:16:44 +08:00
/// 消息,支持html
2024-05-22 14:35:08 +08:00
/// </summary>
2024-08-07 00:01:44 +08:00
[SugarColumn(ColumnDataType = StaticConfig.CodeFirst_BigString)]
2024-05-22 14:35:08 +08:00
public string Message { get; set; }
2024-05-22 22:16:44 +08:00
/// <summary>
/// 消息类型
/// </summary>
public NoticeTypeEnum NoticeType { get; }
2024-05-22 14:35:08 +08:00
/// <summary>
/// 是否已读
/// </summary>
2024-05-22 22:16:44 +08:00
public bool IsRead { get; private set; }
2024-05-22 14:35:08 +08:00
/// <summary>
/// 已读时间
/// </summary>
2024-05-22 22:16:44 +08:00
public DateTime? ReadTime { get; private set; }
2024-05-22 14:35:08 +08:00
2024-05-23 23:40:55 +08:00
public DateTime CreationTime { get; set; }
2024-05-22 14:35:08 +08:00
}
2024-05-22 22:16:44 +08:00
2024-05-22 14:35:08 +08:00
}