using System.ComponentModel.DataAnnotations;
using Admin.Core.Model.Admin;
using FreeSql.DataAnnotations;
namespace Admin.Core.Model.Admin
{
///
/// 权限
///
[Table(Name = "ad_permission")]
[Index("uk_permission_parentid_label", "ParentId,Label", true)]
public class PermissionEntity : EntityBase
{
///
/// 父级节点
///
public long ParentId { get; set; }
///
/// 权限名称
///
[MaxLength(50)]
public string Label { get; set; }
///
/// 权限类型
///
[Column(MapType = typeof(int),CanUpdate = false)]
public PermissionType Type { get; set; }
///
/// 视图
///
public long? ViewId { get; set; }
public ViewEntity View { get; set; }
///
/// 接口
///
public long? ApiId { get; set; }
public ApiEntity Api { get; set; }
///
/// 菜单访问地址
///
[MaxLength(500)]
public string Path { get; set; }
///
/// 图标
///
[MaxLength(100)]
public string Icon { get; set; }
///
/// 隐藏
///
public bool Hidden { get; set; } = false;
///
/// 启用
///
public bool Enabled { get; set; } = true;
///
/// 可关闭
///
public bool? Closable { get; set; }
///
/// 打开组
///
public bool? Opened { get; set; }
///
/// 打开新窗口
///
public bool? NewWindow { get; set; }
///
/// 链接外显
///
public bool? External { get; set; }
///
/// 排序
///
public int? Sort { get; set; } = 0;
///
/// 描述
///
[MaxLength(100)]
public string Description { get; set; }
}
}