ChatRoomForGpt/ARW-net/ARW.Model/System/SysRole.cs
2023-04-04 18:15:13 +08:00

95 lines
2.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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