SysMenu.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. using Vo;
  2. namespace Model
  3. {
  4. /// <summary>
  5. /// 菜单权限表 sys_menu
  6. /// </summary>
  7. [SugarTable("sys_menu", "菜单权限表")]
  8. [Tenant("0")]
  9. public class SysMenu
  10. {
  11. /// <summary>
  12. /// 菜单ID
  13. /// </summary>
  14. [SugarColumn(ColumnDescription = "菜单ID", IsPrimaryKey = true, IsIdentity = true, ColumnName = "menu_id")]
  15. public long menuId { get; set; }
  16. /// <summary>
  17. /// 菜单名称
  18. /// </summary>
  19. [SugarColumn(ColumnDescription = "菜单名称", Length = 32, ColumnName = "name")]
  20. public string? name { get; set; }
  21. /// <summary>
  22. /// 英文名称
  23. /// </summary>
  24. [SugarColumn(ColumnDescription = "英文名称", Length = 128, ColumnName = "en_name")]
  25. public string? enName { get; set; }
  26. /// <summary>
  27. /// 权限标识
  28. /// </summary>
  29. [SugarColumn(ColumnDescription = "权限标识", Length = 32, ColumnName = "permission")]
  30. public string? permission { get; set; }
  31. /// <summary>
  32. /// 路由路径
  33. /// </summary>
  34. [SugarColumn(ColumnDescription = "路由路径", Length = 128, ColumnName = "path")]
  35. public string? path { get; set; }
  36. /// <summary>
  37. /// 父菜单ID
  38. /// </summary>
  39. [SugarColumn(ColumnDescription = "父菜单ID", ColumnName = "parent_id")]
  40. public long parentId { get; set; }
  41. /// <summary>
  42. /// 菜单图标
  43. /// </summary>
  44. [SugarColumn(ColumnDescription = "菜单图标", Length = 64, ColumnName = "icon")]
  45. public string? icon { get; set; }
  46. /// <summary>
  47. /// 是否可见,0隐藏,1显示
  48. /// </summary>
  49. [SugarColumn(ColumnDescription = "是否可见,0隐藏,1显示", Length = 1, ColumnName = "visible")]
  50. public string? visible { get; set; }
  51. /// <summary>
  52. /// 排序值,越小越靠前
  53. /// </summary>
  54. [SugarColumn(ColumnDescription = "排序值,越小越靠前", ColumnName = "sort_order")]
  55. public int sortOrder { get; set; }
  56. /// <summary>
  57. /// 是否缓存,0否,1是
  58. /// </summary>
  59. [SugarColumn(ColumnDescription = "是否缓存,0否,1是", Length = 1, ColumnName = "keep_alive")]
  60. public string? keepAlive { get; set; }
  61. /// <summary>
  62. /// 是否内嵌,0否,1是
  63. /// </summary>
  64. [SugarColumn(ColumnDescription = "是否内嵌,0否,1是", Length = 1, ColumnName = "embedded")]
  65. public string? embedded { get; set; }
  66. /// <summary>
  67. /// 菜单类型,0目录,1菜单,2按钮
  68. /// </summary>
  69. [SugarColumn(ColumnDescription = "菜单类型,0目录,1菜单,2按钮", Length = 1, ColumnName = "menu_type")]
  70. public string? menuType { get; set; }
  71. /// <summary>
  72. /// 创建人
  73. /// </summary>
  74. [SugarColumn(ColumnDescription = "创建人", Length = 64, ColumnName = "create_by")]
  75. public string? CreateBy { get; set; }
  76. /// <summary>
  77. /// 创建时间
  78. /// </summary>
  79. [SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_time")]
  80. public DateTime? CreateTime { get; set; }
  81. /// <summary>
  82. /// 修改人
  83. /// </summary>
  84. [SugarColumn(ColumnDescription = "修改人", Length = 64, ColumnName = "update_by")]
  85. public string? UpdateBy { get; set; }
  86. /// <summary>
  87. /// 更新时间
  88. /// </summary>
  89. [SugarColumn(ColumnDescription = "更新时间", ColumnName = "update_time")]
  90. public DateTime? UpdateTime { get; set; }
  91. /// <summary>
  92. /// 删除标志,0未删除,1已删除
  93. /// </summary>
  94. [SugarColumn(ColumnDescription = "删除标志,0未删除,1已删除", Length = 1, ColumnName = "del_flag")]
  95. public string? DelFlag { get; set; }
  96. [SugarColumn(IsIgnore = true)]
  97. public TreeSelectMeta meta { get; set; }
  98. [SugarColumn(IsIgnore = true)]
  99. public long id { get; set; }
  100. /// <summary>
  101. /// 子菜单
  102. /// </summary>
  103. [SugarColumn(IsIgnore = true)]
  104. public List<SysMenu> children { get; set; } = new List<SysMenu>();
  105. /// <summary>
  106. /// 子菜单个数
  107. /// </summary>
  108. [SugarColumn(IsIgnore = true)]
  109. public int subNum { get; set; }
  110. /// <summary>
  111. /// 是否包含子节点,前端用
  112. /// </summary>
  113. [SugarColumn(IsIgnore = true)]
  114. public bool hasChildren
  115. {
  116. get
  117. {
  118. return subNum > 0 || children.Count > 0;
  119. }
  120. }
  121. }
  122. }