Documentation ¶
Overview ¶
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Index ¶
- Variables
- func Create(c helper.Context, input CreateMenuParams) (res schema.Response)
- func CreateFromTree(c helper.Context, input []TreeParams) (res schema.Response)
- func Delete(c helper.Context, menuId string) (res schema.Response)
- func DeleteMenuById(id string)
- func GetList(c helper.Context, input Query) (res schema.Response)
- func GetMenu(ctx helper.Context, id string) (res schema.Response)
- func Update(c helper.Context, bannerId string, input UpdateParams) (res schema.Response)
- type CreateMenuParams
- type Query
- type TreeParams
- type UpdateParams
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateFromTreeRouter = router.Handler(func(c router.Context) { var ( input []TreeParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return CreateFromTree(helper.NewContext(&c), input) }) })
View Source
var CreateRouter = router.Handler(func(c router.Context) { var ( input CreateMenuParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return Create(helper.NewContext(&c), input) }) })
View Source
var DeleteRouter = router.Handler(func(c router.Context) { id := c.Param("menu_id") c.ResponseFunc(nil, func() schema.Response { return Delete(helper.NewContext(&c), id) }) })
View Source
var GetListRouter = router.Handler(func(c router.Context) { var ( input Query ) c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response { return GetList(helper.NewContext(&c), input) }) })
View Source
var GetMenuRouter = router.Handler(func(c router.Context) { id := c.Param("menu_id") c.ResponseFunc(nil, func() schema.Response { return GetMenu(helper.NewContext(&c), id) }) })
View Source
var UpdateRouter = router.Handler(func(c router.Context) { var ( input UpdateParams ) id := c.Param("menu_id") c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return Update(helper.NewContext(&c), id, input) }) })
Functions ¶
func CreateFromTree ¶ added in v0.3.0
func CreateFromTree(c helper.Context, input []TreeParams) (res schema.Response)
func DeleteMenuById ¶
func DeleteMenuById(id string)
Types ¶
type CreateMenuParams ¶
type CreateMenuParams struct { Name string `json:"name" valid:"required~请填写菜单名"` // 菜单名 Url *string `json:"url"` // 菜单链接的 URL 地址 Icon *string `json:"icon"` // 菜单的图标 Accession *[]string `json:"accession"` // 该菜单所需要的权限 Sort *int `json:"sort" ` // 菜单排序, 越大的越靠前 ParentId *string `json:"parent_id"` // 该菜单的父级 ID }
type TreeParams ¶ added in v0.3.0
type TreeParams struct { CreateMenuParams Children []TreeParams `json:"children"` }
type UpdateParams ¶
Click to show internal directories.
Click to hide internal directories.