menu

package
v0.2.54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMenu

type BaseMenu struct {
	models.BaseModel

	MenuLevel uint   `json:"-"`
	ParentId  string `json:"parentId"`
	Path      string `json:"path"`
	Name      string `json:"name"`
	Hidden    bool   `json:"hidden"`
	Component string `json:"component"`

	NickName string     `json:"nickName"`
	Children []BaseMenu `json:"children"`
}
type Menu struct {
	BaseMenu

	MenuId      string `json:"menuId"`
	AuthorityId string `json:"-"`
	Children    []Menu `json:"children"`
}

menu需要构建的点有点多 这里关联关系表直接把所有数据拿过来 用代码实现关联 后期实现主外键模式

func (m *Menu) AddMenuAuthority(menus []BaseMenu, authorityId string) (err error)

为角色增加menu树

func (m *Menu) GetMenuAuthority(authorityId string) (err error, menus []Menu)

查看当前角色树

func (m *Menu) GetMenuTree(authorityId string) (err error, menus []Menu)

获取动态路由树

type Meta

type Meta struct {
	Title string `json:"title"`
	Icon  string `json:"icon"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL