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.
Copyright 2019-2020 Axetroy. All rights reserved. MIT license.
Index ¶
- Variables
- func Create(c helper.Context, input CreateParams) (res schema.Response)
- func Delete(c helper.Context, roleName string) (res schema.Response)
- func DeleteRoleByName(name string)
- func Get(roleName string) (res schema.Response)
- func GetAccession() (res schema.Response)
- func GetList(c helper.Context, input Query) (res schema.Response)
- func Update(c helper.Context, roleName string, input UpdateParams) (res schema.Response)
- func UpdateUserRole(c helper.Context, userId string, input UpdateUserRoleParams) (res schema.Response)
- type CreateParams
- type Query
- type UpdateParams
- type UpdateUserRoleParams
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateRouter = router.Handler(func(c router.Context) { var ( input CreateParams ) c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return Create(helper.NewContext(&c), input) }) })
View Source
var DeleteRouter = router.Handler(func(c router.Context) { roleName := c.Param("name") c.ResponseFunc(nil, func() schema.Response { return Delete(helper.NewContext(&c), roleName) }) })
View Source
var GetAccessionRouter = router.Handler(func(c router.Context) { c.ResponseFunc(nil, func() schema.Response { return GetAccession() }) })
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 GetRouter = router.Handler(func(c router.Context) { roleName := c.Param("name") c.ResponseFunc(nil, func() schema.Response { return Get(roleName) }) })
View Source
var UpdateRouter = router.Handler(func(c router.Context) { var ( input UpdateParams ) roleName := c.Param("name") c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return Update(helper.NewContext(&c), roleName, input) }) })
View Source
var UpdateUserRoleRouter = router.Handler(func(c router.Context) { var ( input UpdateUserRoleParams ) userId := c.Param("user_id") c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return UpdateUserRole(helper.NewContext(&c), userId, input) }) })
Functions ¶
func DeleteRoleByName ¶
func DeleteRoleByName(name string)
func GetAccession ¶
func UpdateUserRole ¶
Types ¶
type CreateParams ¶
type UpdateParams ¶
type UpdateUserRoleParams ¶
type UpdateUserRoleParams struct {
Roles []string `json:"role"` // 要更新的用户角色
}
Click to show internal directories.
Click to hide internal directories.