sys_auth_rule.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * @desc:菜单model
  3. * @company:云南奇讯科技有限公司
  4. * @Author: yixiaohu
  5. * @Date: 2022/3/11 14:53
  6. */
  7. package model
  8. type SysAuthRuleInfoRes struct {
  9. Id uint `orm:"id,primary" json:"id"` //
  10. Pid uint `orm:"pid" json:"pid"` // 父ID
  11. Name string `orm:"name,unique" json:"name"` // 规则名称
  12. Title string `orm:"title" json:"title"` // 规则名称
  13. Icon string `orm:"icon" json:"icon"` // 图标
  14. Condition string `orm:"condition" json:"condition"` // 条件
  15. Remark string `orm:"remark" json:"remark"` // 备注
  16. MenuType uint `orm:"menu_type" json:"menuType"` // 类型 0目录 1菜单 2按钮
  17. Weigh int `orm:"weigh" json:"weigh"` // 权重
  18. IsHide uint `orm:"is_hide" json:"isHide"` // 显示状态
  19. IsCached uint `orm:"is_cached" json:"isCached"` // 是否缓存
  20. IsAffix uint `orm:"is_affix" json:"isAffix"` //是否固定
  21. Path string `orm:"path" json:"path"` // 路由地址
  22. Redirect string `orm:"redirect" json:"redirect"` // 跳转路由
  23. Component string `orm:"component" json:"component"` // 组件路径
  24. IsIframe uint `orm:"is_iframe" json:"isIframe"` // 是否iframe
  25. IsLink uint `orm:"is_link" json:"isLink"` // 是否外链 1是 0否
  26. LinkUrl string `orm:"link_url" json:"linkUrl"` //链接地址
  27. }
  28. // SysAuthRuleTreeRes 菜单树形结构
  29. type SysAuthRuleTreeRes struct {
  30. *SysAuthRuleInfoRes
  31. Children []*SysAuthRuleTreeRes `json:"children"`
  32. }
  33. type UserMenu struct {
  34. Id uint `json:"id"`
  35. Pid uint `json:"pid"`
  36. Name string `json:"name"`
  37. Component string `json:"component"`
  38. Path string `json:"path"`
  39. *MenuMeta `json:"meta"`
  40. }
  41. type UserMenus struct {
  42. *UserMenu `json:""`
  43. Children []*UserMenus `json:"children"`
  44. }
  45. type MenuMeta struct {
  46. Icon string `json:"icon"`
  47. Title string `json:"title"`
  48. IsLink string `json:"isLink"`
  49. IsHide bool `json:"isHide"`
  50. IsKeepAlive bool `json:"isKeepAlive"`
  51. IsAffix bool `json:"isAffix"`
  52. IsIframe bool `json:"isIframe"`
  53. }