using System;
using System.Collections.Generic;
using SqlSugar;
using Yi.Framework.Infrastructure.Data.Auditing;
using Yi.Framework.Infrastructure.Data.Entities;
using Yi.Framework.Infrastructure.Ddd.Entities;
using Yi.Furion.Core.Rbac.Entities;
namespace Yi.Furion.Core.Bbs.Entities
{
///
/// 评论表
///
[SugarTable("Comment")]
public class CommentEntity : IEntity, ISoftDelete, IAuditedObject
{
///
/// 采用二维数组方式,不使用树形方式
///
public CommentEntity()
{
}
public CommentEntity(long discussId)
{
DiscussId = discussId;
}
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
public bool IsDeleted { get; set; }
public string Content { get; set; }
public long DiscussId { get; set; }
///
/// 被回复的CommentId
///
public long ParentId { get; set; }
public DateTime CreationTime { get; set; }
public long 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 long? CreatorId { get; set; }
public long? LastModifierId { get; set; }
public DateTime? LastModificationTime { get; set; }
}
}