You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB

  1. package model
  2. import (
  3. "gorm.io/gorm"
  4. )
  5. type SysBaseMenu struct {
  6. gorm.Model
  7. MenuLevel uint `json:"-"`
  8. ParentId string `json:"parentId" gorm:"comment:父菜单ID"`
  9. Path string `json:"path" gorm:"comment:路由path"`
  10. Name string `json:"name" gorm:"comment:路由name"`
  11. Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"`
  12. Component string `json:"component" gorm:"comment:对应前端文件路径"`
  13. Sort int `json:"sort" gorm:"comment:排序标记"`
  14. Meta `json:"meta" gorm:"comment:附加属性"`
  15. SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"`
  16. Children []SysBaseMenu `json:"children" gorm:"-"`
  17. Parameters []SysBaseMenuParameter `json:"parameters"`
  18. }
  19. type Meta struct {
  20. KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"`
  21. DefaultMenu bool `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"`
  22. Title string `json:"title" gorm:"comment:菜单名"`
  23. Icon string `json:"icon" gorm:"comment:菜单图标"`
  24. }
  25. type SysBaseMenuParameter struct {
  26. gorm.Model
  27. SysBaseMenuID uint
  28. Type string `json:"type" gorm:"commit:'地址栏携带参数为params还是query'"`
  29. Key string `json:"key" gorm:"commit:'地址栏携带参数的key'"`
  30. Value string `json:"value" gorm:"commit:'地址栏携带参数的值'"`
  31. }