sys_menu.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. Fill this file as you wish.
  3. // ==========================================================================
  4. package model
  5. import (
  6. "dashoo.cn/micro/app/model/internal"
  7. )
  8. // SysMenu is the golang structure for table sys_menu.
  9. type SysMenu internal.SysMenu
  10. // Fill with you ideas below.
  11. // SysMenuReq 新增页面请求参数
  12. type SysMenuReq struct {
  13. Id int `json:"id"` // ID
  14. MenuName string `json:"menuName" v:"required#菜单名称不能为空"` // 菜单名称
  15. ParentId int `json:"parentId"` // 父菜单ID
  16. Path string `json:"path"` // 路由地址
  17. Component string `json:"component"` // 组件路径
  18. Query string `json:"query"` // 路由参数
  19. IsFrame int `json:"isFrame"` // 是否为外链(10是20否)
  20. IsCache int `json:"isCache"` // 是否缓存(10缓存20不缓存)
  21. MenuType string `json:"menuType" v:"required#菜单类型不能为空"` // 菜单类型(M目录C菜单 F按钮)
  22. Visible string `json:"visible"` // 显示状态(10显示20隐藏)
  23. Status string `json:"status"` // 菜单状态(10正常20停用)
  24. Perms string `json:"perms"` // 权限标识
  25. Icon string `json:"icon"` // 菜单图标
  26. PlatformId int `json:"platformId"` // 所属平台
  27. Sort int `json:"sort"` // 显示顺序
  28. Remark string `json:"remark"` // 备注
  29. }
  30. type MenuTree struct {
  31. Id int `json:"id"`
  32. ParentId int `json:"parent_id"`
  33. Name string `json:"name"`
  34. Component string `json:"component"`
  35. Path string `json:"path"`
  36. Redirect string `json:"redirect"`
  37. Hidden bool `json:"hidden"`
  38. Meta Meta `json:"meta"`
  39. Children []MenuTree `json:"children,omitempty"`
  40. }
  41. type Meta struct {
  42. Title string `json:"title"`
  43. Icon string `json:"icon"`
  44. Link string `json:"link"`
  45. BreadcrumbHidden bool `json:"breadcrumbHidden"`
  46. NoCache bool `json:"noCache"`
  47. }
  48. func (m SysMenu) ConvMenuTree() MenuTree {
  49. menuTree := MenuTree{
  50. Id: m.Id,
  51. ParentId: m.ParentId,
  52. Name: m.MenuName,
  53. Component: m.Component,
  54. Path: m.Path,
  55. //Redirect: m.Redirect,
  56. //Hidden: m.Hidden,
  57. Meta: Meta{
  58. Title: m.MenuName,
  59. Icon: m.Icon,
  60. //Link: m.Link,
  61. //BreadcrumbHidden: m.BreadcrumbHidden,
  62. NoCache: m.IsCache == 1,
  63. },
  64. Children: nil,
  65. }
  66. return menuTree
  67. }