MenuDto.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System.ComponentModel.DataAnnotations;
  2. using MessagePack.Formatters;
  3. using MiniExcelLibs.Attributes;
  4. namespace Dto
  5. {
  6. public class MenuDto
  7. {
  8. //{"parentId":0,"menuName":"aaa","icon":"documentation","menuType":"M","orderNum":999,"visible":0,"status":0,"path":"aaa"}
  9. [ExcelColumn(Name = "菜单id")]
  10. public int menuId { get; set; }
  11. [ExcelColumn(Name = "菜单名")]
  12. public string? name { get; set; }
  13. public string? enName { get; set; }
  14. /// <summary>
  15. /// 父菜单ID
  16. /// </summary>
  17. public long parentId { get; set; }
  18. /// <summary>
  19. /// 显示顺序
  20. /// </summary>
  21. public int sortOrder { get; set; }
  22. /// <summary>
  23. /// 路由地址
  24. /// </summary>
  25. [ExcelColumn(Name = "路由地址")]
  26. public string? path { get; set; } = "#";
  27. /// <summary>
  28. /// 组件路径
  29. /// </summary>
  30. [ExcelColumn(Name = "组件地址")]
  31. public string? component { get; set; }
  32. /// <summary>
  33. /// 是否缓存(1缓存 0不缓存)
  34. /// </summary>
  35. [Required(ErrorMessage = "是否缓存不能为空")]
  36. [ExcelColumn(Name = "是否缓存")]
  37. public int keepAlive { get; set; }
  38. /// <summary>
  39. /// 是否外链 1、是 0、否
  40. /// </summary>
  41. public int embedded { get; set; }
  42. /// <summary>
  43. /// 类型(M目录 C菜单 F按钮 L链接)
  44. /// </summary>
  45. [Required(ErrorMessage = "菜单类型不能为空")]
  46. public string? menuType { get; set; }
  47. /// <summary>
  48. /// 显示状态(0显示 1隐藏)
  49. /// </summary>
  50. [Required(ErrorMessage = "显示状态不能为空")]
  51. public string? visible { get; set; }
  52. /// <summary>
  53. /// 菜单状态(0正常 1停用)
  54. /// </summary>
  55. // [Required(ErrorMessage = "菜单状态不能为空")]
  56. // public string? status { get; set; }
  57. /// <summary>
  58. /// 权限字符串
  59. /// </summary>
  60. public string? permission { get; set; }
  61. /// <summary>
  62. /// 菜单图标
  63. /// </summary>
  64. public string? icon { get; set; }
  65. /// <summary>
  66. /// 翻译key
  67. /// </summary>
  68. public string? menuNameKey { get; set; }
  69. public List<MenuDto> children { get; set; } = new List<MenuDto>();
  70. }
  71. public class MenuQueryDto
  72. {
  73. public string? menuName { get; set; }
  74. public string? visible { get; set; }
  75. public string? delFlag { get; set; }
  76. public string? menuTypeIds { get; set; }
  77. public int? parentId { get; set; }
  78. // public string[] menuTypeIdArr
  79. // {
  80. // get
  81. // {
  82. // return menuTypeIds?.Split(',', StringSplitOptions.RemoveEmptyEntries);
  83. // }
  84. // }
  85. }
  86. public class RoleMenuQueryDto
  87. {
  88. public int roleId { get; set; }
  89. }
  90. }