using SqlSugar;
using Volo.Abp.Auditing;
using Volo.Abp.Domain.Entities;
using Yi.Framework.Core.Data;
using Yi.Framework.Rbac.Domain.Shared.Enums;
namespace Yi.Framework.Rbac.Domain.Entities
{
///
/// 角色表
///
[SugarTable("Role")]
public class RoleAggregateRoot : AggregateRoot, ISoftDelete, IAuditedObject, IOrderNum, IState
{
///
/// 主键
///
[SugarColumn(IsPrimaryKey = true)]
public override Guid Id { get; protected set; }
///
/// 逻辑删除
///
public bool IsDeleted { get; set; }
///
/// 创建时间
///
public DateTime CreationTime { get; set; } = DateTime.Now;
///
/// 创建者
///
public Guid? CreatorId { get; set; }
///
/// 最后修改者
///
public Guid? LastModifierId { get; set; }
///
/// 最后修改时间
///
public DateTime? LastModificationTime { get; set; }
///
/// 排序
///
public int OrderNum { get; set; } = 0;
///
/// 角色名
///
public string RoleName { get; set; } = string.Empty;
///
/// 角色编码
///
[SugarColumn(ColumnName = "RoleCode")]
public string RoleCode { get; set; } = string.Empty;
///
/// 描述
///
[SugarColumn(ColumnName = "Remark")]
public string? Remark { get; set; }
///
/// 角色数据范围
///
[SugarColumn(ColumnName = "DataScope")]
public DataScopeEnum DataScope { get; set; } = DataScopeEnum.ALL;
///
/// 状态
///
public bool State { get; set; } = true;
[Navigate(typeof(RoleMenuEntity), nameof(RoleMenuEntity.RoleId), nameof(RoleMenuEntity.MenuId))]
public List? Menus { get; set; }
[Navigate(typeof(RoleDeptEntity), nameof(RoleDeptEntity.RoleId), nameof(RoleDeptEntity.DeptId))]
public List? Depts { get; set; }
}
}