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.Enums;
namespace Yi.Furion.Core.Rbac.Entities
{
///
/// 角色表
///
[SugarTable("Role")]
public class RoleEntity : IEntity, ISoftDelete, IAuditedObject, IOrderNum, IState
{
///
/// 主键
///
[SugarColumn(IsPrimaryKey = true)]
public long Id { get; set; }
///
/// 逻辑删除
///
public bool IsDeleted { get; set; }
///
/// 创建时间
///
public DateTime CreationTime { get; set; } = DateTime.Now;
///
/// 创建者
///
public long? CreatorId { get; set; }
///
/// 最后修改者
///
public long? 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; }
}
}