Documentation ¶
Index ¶
- Constants
- type ListMenuRequest
- type Menu
- type Repo
- type UseCase
- func (u *UseCase) CreateMenu(ctx kratosx.Context, req *Menu) (uint32, error)
- func (u *UseCase) DeleteMenu(ctx kratosx.Context, ids []uint32) (uint32, error)
- func (u *UseCase) ListMenu(ctx kratosx.Context, req *ListMenuRequest) ([]tree.Tree, uint32, error)
- func (u *UseCase) ListMenuByCurRole(ctx kratosx.Context) ([]tree.Tree, uint32, error)
- func (u *UseCase) UpdateMenu(ctx kratosx.Context, req *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 ListMenuRequest ¶ added in v1.0.15
type Menu ¶
type Menu struct { Id uint32 `json:"id"` ParentId uint32 `json:"parentId"` 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"` Component *string `json:"component"` Redirect *string `json:"redirect"` Weight *int32 `json:"weight"` IsHidden *bool `json:"isHidden"` IsCache *bool `json:"isCache"` IsHome *bool `json:"isHome"` IsAffix *bool `json:"isAffix"` CreatedAt int64 `json:"createdAt"` UpdatedAt int64 `json:"updatedAt"` Children []*Menu `json:"Children"` }
type Repo ¶
type Repo interface { // ListMenu 获取菜单信息列表 ListMenu(ctx kratosx.Context, req *ListMenuRequest) ([]*Menu, uint32, error) // ListMenuByRoleId 获取指定角色的菜单列表 ListMenuByRoleId(ctx kratosx.Context, id uint32) ([]*Menu, uint32, error) // CreateMenu 创建菜单信息 CreateMenu(ctx kratosx.Context, req *Menu) (uint32, error) // UpdateMenu 更新菜单信息 UpdateMenu(ctx kratosx.Context, req *Menu) error // DeleteMenu 删除菜单信息 DeleteMenu(ctx kratosx.Context, ids []uint32) (uint32, error) // GetMenuParentIds 获取父菜单信息ID列表 GetMenuParentIds(ctx kratosx.Context, id uint32) ([]uint32, error) // GetMenuChildrenIds 获取子菜单信息ID列表 GetMenuChildrenIds(ctx kratosx.Context, id uint32) ([]uint32, error) // InitBasicMenu 初始化基础菜单api InitBasicMenu(ctx kratosx.Context) }
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
func (*UseCase) CreateMenu ¶ added in v1.0.15
CreateMenu 创建菜单信息
func (*UseCase) DeleteMenu ¶
DeleteMenu 删除菜单信息
func (*UseCase) ListMenuByCurRole ¶ added in v1.0.15
ListMenuByCurRole 获取当前角色的菜单树
Click to show internal directories.
Click to hide internal directories.