using Newtonsoft.Json; using SqlSugar; using System; using System.Collections.Generic; using System.Text; namespace ZR.Model.System { /// /// 角色表 sys_role /// [SugarTable("sys_role")] [Tenant("0")] public class SysRole : SysBase { /// /// 角色ID /// [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public long RoleId { get; set; } /// /// 角色名称 /// public string RoleName { get; set; } /// /// 角色权限 /// public string RoleKey { get; set; } /// /// 角色排序 /// public int RoleSort { get; set; } /// /// 帐号状态(0正常 1停用) /// public string Status { get; set; } /// /// 删除标志(0代表存在 2代表删除) /// [SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] public string DelFlag { get; set; } /// /// 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)) /// public string DataScope { get; set; } /// /// 菜单树选择项是否关联显示 /// [SugarColumn(ColumnName = "menu_check_strictly")] public bool MenuCheckStrictly { get; set; } /// /// 部门树选择项是否关联显示 /// [SugarColumn(ColumnName = "dept_check_strictly")] public bool DeptCheckStrictly { get; set; } /// /// 菜单组 /// [SugarColumn(IsIgnore = true)] public long[] MenuIds { get; set; } /// /// 部门组(数据权限) /// [SugarColumn(IsIgnore = true)] public long[] DeptIds { get; set; } /// /// 用户个数 /// [SugarColumn(IsIgnore = true)] public int UserNum { get; set; } public SysRole() { } public SysRole(long roleId) { RoleId = roleId; } public bool IsAdmin() { return IsAdmin(RoleId); } public static bool IsAdmin(long roleId) { return 1 == roleId; } } }