web

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMenuReq

type CreateMenuReq struct {
	Pid           int64      `json:"pid"`
	Path          string     `json:"path"`
	Name          string     `json:"name"`
	Component     string     `json:"component"`
	ComponentPath string     `json:"component_path"`
	Redirect      string     `json:"redirect"`
	Sort          int64      `json:"sort"`
	Type          uint8      `json:"type"`
	Status        uint8      `json:"status"`
	Meta          Meta       `json:"meta"`
	Endpoints     []Endpoint `json:"endpoints"`
}

type DeleteMenuReq

type DeleteMenuReq struct {
	Id int64 `json:"id"`
}

type Endpoint

type Endpoint struct {
	Path   string `json:"path"`
	Method string `json:"method"`
	Desc   string `json:"desc"`
}

type Handler

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

func NewHandler

func NewHandler(svc service.Service) *Handler

func (*Handler) CreateMenu

func (h *Handler) CreateMenu(ctx *gin.Context, req CreateMenuReq) (ginx.Result, error)

func (*Handler) DeleteMenu

func (h *Handler) DeleteMenu(ctx *gin.Context, req DeleteMenuReq) (ginx.Result, error)

func (*Handler) ListMenuTree

func (h *Handler) ListMenuTree(ctx *gin.Context) (ginx.Result, error)

func (*Handler) PrivateRoutes

func (h *Handler) PrivateRoutes(server *gin.Engine)

func (*Handler) UpdateMenu

func (h *Handler) UpdateMenu(ctx *gin.Context, req UpdateMenuReq) (ginx.Result, error)

UpdateMenu 修改菜单信息

type Menu struct {
	Id        int64      `json:"id"`
	Pid       int64      `json:"pid"`
	Name      string     `json:"name"`
	Path      string     `json:"path"`
	Redirect  string     `json:"redirect"`
	Sort      int64      `json:"sort"`
	Component string     `json:"component"`
	Status    uint8      `json:"status"`
	Type      uint8      `json:"type"`
	Meta      Meta       `json:"meta"`
	Endpoints []Endpoint `json:"endpoints"`
	Children  []*Menu    `json:"children"`
}

func GetMenusTree

func GetMenusTree(ms []domain.Menu) []*Menu

type Meta

type Meta struct {
	Title       string `json:"title"`        // 展示名称
	IsHidden    bool   `json:"is_hidden"`    // 是否展示
	IsAffix     bool   `json:"is_affix"`     // 是否固定
	IsKeepAlive bool   `json:"is_keepalive"` // 是否缓存
	Icon        string `json:"icon"`         // Icon图标
}

type UpdateMenuReq

type UpdateMenuReq struct {
	Id            int64      `json:"id"`
	Pid           int64      `json:"pid"`
	Name          string     `json:"name"`
	Path          string     `json:"path"`
	Component     string     `json:"component"`
	ComponentPath string     `json:"component_path"`
	Redirect      string     `json:"redirect"`
	Sort          int64      `json:"sort"`
	Type          uint8      `json:"type"`
	Status        uint8      `json:"status"`
	Meta          Meta       `json:"meta"`
	Endpoints     []Endpoint `json:"endpoints"`
}

Jump to

Keyboard shortcuts

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