using SqlSugar; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; using Yi.Framework.Rbac.Domain.Entities; namespace Yi.Framework.Bbs.Domain.Entities { /// /// 评论表 /// [SugarTable("Comment")] public class CommentEntity : Entity, ISoftDelete, IAuditedObject { /// /// 采用二维数组方式,不使用树形方式 /// public CommentEntity() { } public CommentEntity(Guid discussId) { DiscussId = discussId; } [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] public override Guid Id { get; protected set; } public bool IsDeleted { get; set; } public string Content { get; set; } public Guid DiscussId { get; set; } /// /// 被回复的CommentId /// public Guid ParentId { get; set; } public DateTime CreationTime { get; set; } public Guid RootId { get; set; } [SugarColumn(IsIgnore = true)] public List Children { get; set; } = new(); /// /// 用户,评论人用户信息 /// [Navigate(NavigateType.OneToOne, nameof(CreatorId))] public UserEntity CreateUser { get; set; } /// /// 被评论的用户信息 /// [SugarColumn(IsIgnore = true)] public UserEntity CommentedUser { get; set; } public Guid? CreatorId { get; set; } public Guid? LastModifierId { get; set; } public DateTime? LastModificationTime { get; set; } } }