using Hotline.Identity.Roles;
using Hotline.Share.Enums.Settings;
using SqlSugar;
using System.ComponentModel;
using System.Security.Cryptography;
using XF.Domain.Entities;
using XF.Domain.Repository;

namespace Hotline.Settings
{
    [Description("数据权限分配")]
    public class SystemDataAuthority : CreationEntity
    {
        /// <summary>
        /// 角色ID
        /// </summary>
        public string RoleId { get; set; }

        [Navigate(NavigateType.OneToOne, nameof(RoleId))]
        public Role Role { get; set; }

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

        /// <summary>
        /// 权限方式
        /// </summary>
        public ETableAccessLevel AuthorityType { get; set; }

        /// <summary>
        /// 数据表Id
        /// </summary>
        public string TableId { get; set; }


        [Navigate(NavigateType.OneToOne, nameof(TableId))]
        public SystemDataTable Table { get; set; }
    }
}
