using System.ComponentModel;
using Hotline.Identity.Roles;
using Hotline.Share.Enums.Settings;
using SqlSugar;
using XF.Domain.Repository;
using XF.Utility.EnumExtensions;

namespace Hotline.Settings;

[Description("表访问等级")]
public class TableAccessLevel : CreationEntity
{
    /// <summary>
    /// 角色ID
    /// </summary>
    public string RoleId { get; set; }

    /// <summary>
    /// 角色Code
    /// </summary>
    public string RoleCode { get; set; }

    public string RoleDisplay { get; set; }

    /// <summary>
    /// 访问等级
    /// </summary>
    public ETableAccessLevel AccessLevel { get; set; }

    [SugarColumn(IsIgnore = true)]
    public string AccessLevelText => AccessLevel.GetDescription();

    /// <summary>
    /// 表名
    /// </summary>
    public string TableName { get; set; }
    public string TableDisplay { get; set; }
}