SysRole.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. namespace Model
  2. {
  3. /// <summary>
  4. /// 系统角色表 sys_role
  5. /// </summary>
  6. [SugarTable("sys_role", "系统角色表")]
  7. [Tenant("0")]
  8. public class SysRole
  9. {
  10. /// <summary>
  11. /// 角色ID
  12. /// </summary>
  13. [SugarColumn(ColumnDescription = "角色ID", IsPrimaryKey = true, IsIdentity = true, ColumnName = "role_id")]
  14. public long roleId { get; set; }
  15. /// <summary>
  16. /// 角色名称
  17. /// </summary>
  18. [SugarColumn(ColumnDescription = "角色名称", Length = 64, ColumnName = "role_name")]
  19. public string? roleName { get; set; }
  20. /// <summary>
  21. /// 角色编码
  22. /// </summary>
  23. [SugarColumn(ColumnDescription = "角色编码", Length = 64, ColumnName = "role_code")]
  24. public string? roleCode { get; set; }
  25. /// <summary>
  26. /// 角色描述
  27. /// </summary>
  28. [SugarColumn(ColumnDescription = "角色描述", Length = 255, ColumnName = "role_desc")]
  29. public string? roleDesc { get; set; }
  30. /// <summary>
  31. /// 创建人
  32. /// </summary>
  33. [SugarColumn(ColumnDescription = "创建人", Length = 64, ColumnName = "create_by")]
  34. public string? CreateBy { get; set; }
  35. /// <summary>
  36. /// 修改人
  37. /// </summary>
  38. [SugarColumn(ColumnDescription = "修改人", Length = 64, ColumnName = "update_by")]
  39. public string? UpdateBy { get; set; }
  40. /// <summary>
  41. /// 创建时间
  42. /// </summary>
  43. [SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
  44. public DateTime? CreateTime { get; set; }
  45. /// <summary>
  46. /// 更新时间
  47. /// </summary>
  48. [SugarColumn(ColumnDescription = "更新时间", ColumnName = "update_time")]
  49. public DateTime? UpdateTime { get; set; }
  50. /// <summary>
  51. /// 删除标记,0未删除,1已删除
  52. /// </summary>
  53. [SugarColumn(ColumnDescription = "删除标记,0未删除,1已删除", Length = 1, ColumnName = "del_flag")]
  54. public string? DelFlag { get; set; }
  55. /// <summary>
  56. /// 用户个数
  57. /// </summary>
  58. [SugarColumn(IsIgnore = true)]
  59. public int userNum { get; set; }
  60. public SysRole() { }
  61. public SysRole(long roleId)
  62. {
  63. roleId = roleId;
  64. }
  65. public bool IsAdmin()
  66. {
  67. return IsAdmin(roleId);
  68. }
  69. public static bool IsAdmin(long roleId)
  70. {
  71. return 1 == roleId;
  72. }
  73. }
  74. }