route

package
v0.0.0-...-9138371 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoxRoute

type BoxRoute struct {
	gorm.Model
	FatherID uint
	Name     string `gorm:"not null" json:"name"`
	Desc     string `gorm:"not null" json:"desc,omitempty"`
	Sort     int    `gorm:"not null" json:"sort"`
	Path     string `gorm:"not null" json:"path"`
	Perm     string `gorm:"not null" json:"perm,omitempty"`

	Component  string `json:"component,omitempty"`
	AlwaysShow bool   `json:"alwaysShow"`
	Hidden     bool   `json:"hidden"`
	Redirect   string `json:"redirect,omitempty"`
	Title      string `json:"title,omitempty"`
	Icon       string `json:"icon,omitempty"`
	NoCache    bool   `json:"noCache"`
	Breadcrumb bool   `json:"breadcrumb"`
	Affix      bool   `json:"affix"`
}

BoxRoute Model

type Route

type Route struct {
	*BoxRoute
	Children []*Route `json:"children,omitempty"`
}

Route Tree

type Srv

type Srv struct {
	// contains filtered or unexported fields
}

Srv Route

func New

func New(db *gorm.DB) *Srv

New Route Srv

func (*Srv) DelRouter

func (s *Srv) DelRouter(id []string) error

DelRouter 删除菜单

func (*Srv) GetRouter

func (s *Srv) GetRouter(id int) *BoxRoute

GetRouter 查询菜单

func (*Srv) GetRouterCount

func (s *Srv) GetRouterCount() int

GetRouterCount 获取总数

func (*Srv) GetRouterlist

func (s *Srv) GetRouterlist(page, size int) []BoxRoute

GetRouterlist 获取菜单列表

func (*Srv) PostRouter

func (s *Srv) PostRouter(a BoxRoute) error

PostRouter 增加菜单

func (*Srv) PutRouter

func (s *Srv) PutRouter(id int, a BoxRoute) error

PutRouter 更新菜单

func (*Srv) Route

func (s *Srv) Route(perms ...string) []*Route

Route with perms

Jump to

Keyboard shortcuts

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