Documentation ¶
Index ¶
- Constants
- type AllMenuRequest
- type Menu
- type Repo
- type UseCase
- func (u *UseCase) AddMenu(ctx kratosx.Context, in *Menu) (uint32, error)
- func (u *UseCase) DeleteMenu(ctx kratosx.Context, id uint32) error
- func (u *UseCase) MenuTree(ctx kratosx.Context, in *AllMenuRequest) ([]tree.Tree, error)
- func (u *UseCase) MenuTreeFromRole(ctx kratosx.Context) ([]tree.Tree, error)
- func (u *UseCase) UpdateMenu(ctx kratosx.Context, in *Menu) error
Constants ¶
View Source
const ( MenuRoot = "R" MenuApi = "A" MenuPage = "M" MenuGroup = "G" MenuBasic = "BA" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllMenuRequest ¶
type Menu ¶
type Menu struct { types.BaseModel ParentId uint32 `json:"parent_id"` App string `json:"app"` Title string `json:"title"` Type string `json:"type"` Keyword *string `json:"keyword"` Icon *string `json:"icon"` Api *string `json:"api"` Method *string `json:"method"` Path *string `json:"path"` Permission *string `json:"permission"` CheckObject *bool `json:"check_object"` CheckObjectRule *string `json:"check_object_rule"` Component *string `json:"component"` Redirect *string `json:"redirect"` Weight *uint32 `json:"weight"` IsHidden *bool `json:"is_hidden"` IsCache *bool `json:"is_cache"` IsHome *bool `json:"is_home"` IsAffix *bool `json:"is_affix"` Children []*Menu `json:"children" gorm:"-"` }
type Repo ¶
type Repo interface { InitBasicMenu(ctx kratosx.Context) AllRoleKeyword(ctx kratosx.Context, id uint32) ([]string, error) AllMenu(ctx kratosx.Context, in *AllMenuRequest) ([]*Menu, error) GetMenu(ctx kratosx.Context, id uint32) (*Menu, error) GetMenuByApi(ctx kratosx.Context, api, method string) (*Menu, error) AddMenu(ctx kratosx.Context, in *Menu) (uint32, error) UseHome(ctx kratosx.Context, app string, id uint32) error UpdateMenu(ctx kratosx.Context, in *Menu) error DeleteMenu(ctx kratosx.Context, ids []uint32) error }
Click to show internal directories.
Click to hide internal directories.