sys_menu.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package model
  2. import (
  3. model2 "Medical_OAuth/common/model"
  4. )
  5. type SysMenu struct {
  6. model2.Model
  7. ParentId int `json:"parentId" gorm:"size:11;"` // 父id
  8. ServiceMenuId int `json:"serviceMenuId" gorm:"size:4;not null;comment:服务菜单ID"` //服务菜单ID
  9. ServiceId int `json:"serviceId" gorm:"size:4;not null;comment:服务ID"` // 服务ID
  10. Sort int `json:"sort" gorm:"size:4;"` // 排序
  11. Visible string `json:"visible" gorm:"size:1;"` // 1-显示 0-隐藏
  12. MenuPath string `json:"paths" gorm:"size:128;" swaggerignore:"true"` //
  13. Name string `json:"name" gorm:"-"` // 菜单名称
  14. MenuType string `json:"menuType" gorm:"-"` // 菜单类型
  15. Icon string `json:"icon" gorm:"-"` // 图标
  16. Component string `json:"component" gorm:"-"` // 组件路径
  17. IsFrame string `json:"isFrame" gorm:"-"` // 是否外链 1-是 2-否
  18. Path string `json:"path" gorm:"-"` // 外链路由地址
  19. Permission string `json:"permission" gorm:"-"` // 权限标识
  20. Children []SysMenu `json:"children,omitempty" gorm:"-"`
  21. model2.ControlBy
  22. model2.ModelTime
  23. }
  24. type SysMenuSlice []SysMenu
  25. func (x SysMenuSlice) Len() int { return len(x) }
  26. func (x SysMenuSlice) Less(i, j int) bool { return x[i].Sort < x[j].Sort }
  27. func (x SysMenuSlice) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
  28. func (SysMenu) TableName() string {
  29. return "sys_menu"
  30. }
  31. func (e *SysMenu) Generate() model2.ActiveRecord {
  32. o := *e
  33. return &o
  34. }
  35. func (e *SysMenu) GetId() interface{} {
  36. return e.Id
  37. }