sys_auth_rule.go 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. Fill this file as you wish.
  3. // ==========================================================================
  4. package model
  5. import (
  6. "gfast/app/system/model/internal"
  7. )
  8. // SysAuthRule is the golang structure for table sys_auth_rule.
  9. type SysAuthRule internal.SysAuthRule
  10. // Fill with you ideas below.
  11. type SysAuthRuleInfoRes struct {
  12. Id uint `orm:"id,primary" json:"id"` //
  13. Pid uint `orm:"pid" json:"pid"` // 父ID
  14. Name string `orm:"name,unique" json:"name"` // 规则名称
  15. Title string `orm:"title" json:"title"` // 规则名称
  16. Icon string `orm:"icon" json:"icon"` // 图标
  17. Condition string `orm:"condition" json:"condition"` // 条件
  18. Remark string `orm:"remark" json:"remark"` // 备注
  19. MenuType uint `orm:"menu_type" json:"menuType"` // 类型 0目录 1菜单 2按钮
  20. Weigh int `orm:"weigh" json:"weigh"` // 权重
  21. Status uint `orm:"status" json:"status"` // 状态
  22. AlwaysShow uint `orm:"always_show" json:"alwaysShow"` // 显示状态
  23. Path string `orm:"path" json:"path"` // 路由地址
  24. JumpPath string `orm:"jump_path" json:"jumpPath"` // 跳转路由
  25. Component string `orm:"component" json:"component"` // 组件路径
  26. IsFrame uint `orm:"is_frame" json:"isFrame"` // 是否外链 1是 0否
  27. ModuleType string `orm:"module_type" json:"moduleType"` // 所属模块
  28. ModelId uint `orm:"model_id" json:"modelId"` // 模型ID
  29. }
  30. type SysAuthRuleReqSearch struct {
  31. Status string `p:"status" `
  32. Title string `p:"menuName" `
  33. }
  34. // SysAuthRuleTreeRes 菜单树形结构
  35. type SysAuthRuleTreeRes struct {
  36. *SysAuthRuleInfoRes
  37. Children []*SysAuthRuleTreeRes `json:"children"`
  38. }
  39. func (req *SysAuthRuleReqSearch) IsEmpty() bool {
  40. return req.Status == "" && req.Title == ""
  41. }
  42. //菜单对象
  43. type MenuReq struct {
  44. MenuType uint `orm:"menu_type" p:"menuType" v:"min:0|max:2#菜单类型最小值为:min|菜单类型最大值为:max"`
  45. Pid uint `orm:"pid" p:"parentId" v:"min:0"`
  46. Name string `orm:"name,unique" p:"name" v:"required#请填写规则名称"`
  47. Title string `orm:"title" p:"menuName" v:"required|length:1,100#请填写标题|标题长度在:min到:max位"`
  48. Icon string `orm:"icon" p:"icon"`
  49. Weigh int `orm:"weigh" p:"orderNum" `
  50. Condition string `orm:"condition" p:"condition" `
  51. Remark string `orm:"remark" p:"remark" `
  52. Status uint `orm:"status" p:"status" `
  53. AlwaysShow uint `orm:"always_show" p:"visible"`
  54. Path string `orm:"path" p:"path"`
  55. Component string `orm:"component" p:"component" v:"required-if:menuType,1#组件路径不能为空"`
  56. IsFrame uint `orm:"is_frame" p:"is_frame"`
  57. ModuleType string `orm:"module_type" p:"moduleType"`
  58. ModelId uint `orm:"model_id" p:"modelId"`
  59. }