package v1

import (
	"kami/api/commonApi"
)

type SysAuthRule struct {
	commonApi.CommonIntId
	Name      string         `json:"name"      description:"规则名称"`
	Title     string         `json:"title"     description:"规则名称"`
	MenuType  uint           `json:"menuType"  description:"类型 0目录 1菜单 2按钮"`
	Weigh     int            `json:"weigh"     description:"权重"`
	IsHide    uint           `json:"isHide"    description:"显示状态"`
	Path      string         `json:"path"      description:"路由地址"`
	IdAdmin   int            `json:"idAdmin"   description:"是否管理员独享 1是2.否"`
	Component string         `json:"component" description:"组件路径"`
	Children  []*SysAuthRule `json:"children"`
}

type SysAuthRuleReq struct {
	Name      string `json:"name"      description:"规则名称" v:"required"`
	Title     string `json:"title"     description:"规则名称" v:"required"`
	PID       uint   `json:"pid" description:"父ID" v:"required"`
	MenuType  uint   `json:"menuType"  description:"类型 0目录 1菜单 2按钮" v:"required|between:0,2"`
	Weigh     int    `json:"weigh"     description:"权重"`
	IsHide    uint   `json:"isHide"    description:"显示状态"`
	Path      string `json:"path"      description:"路由地址" v:"required"`
	IsAdmin   int    `json:"idAdmin"   description:"是否管理员独享 1是2.否" v:"required"`
	Component string `json:"component" description:"组件路径"`
}

type SysAuthRuleWithID struct {
	SysAuthRuleReq
	commonApi.CommonIntId
}
