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.
Index ¶
- Variables
- func Create(c helper.Context, input CreateParams) (res schema.Response)
- func Delete(c helper.Context, id string) (res schema.Response)
- func DeleteHelpById(id string)
- func GetHelp(id string) (res schema.Response)
- func GetHelpList(c helper.Context, q Query) (res schema.Response)
- func Update(c helper.Context, helpId string, input UpdateParams) (res schema.Response)
- type CreateParams
- type Query
- type UpdateParams
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) { id := c.Param("help_id") c.ResponseFunc(nil, func() schema.Response { return Delete(helper.NewContext(&c), id) }) })
View Source
var GetHelpListRouter = router.Handler(func(c router.Context) { var ( query Query ) c.ResponseFunc(c.ShouldBindQuery(&query), func() schema.Response { return GetHelpList(helper.NewContext(&c), query) }) })
View Source
var GetHelpRouter = router.Handler(func(c router.Context) { id := c.Param("help_id") c.ResponseFunc(nil, func() schema.Response { return GetHelp(id) }) })
View Source
var UpdateRouter = router.Handler(func(c router.Context) { var ( input UpdateParams ) id := c.Param("help_id") c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response { return Update(helper.NewContext(&c), id, input) }) })
Functions ¶
func DeleteHelpById ¶
func DeleteHelpById(id string)
Types ¶
type CreateParams ¶
type CreateParams struct { Title string `json:"title" valid:"required~请填写标题"` Content string `json:"content" valid:"required~请填写内容"` Tags []string `json:"tags"` Status model.HelpStatus `json:"status" valid:"required~请填写状态"` Type model.HelpType `json:"type" valid:"required~请填写类型"` ParentId *string `json:"parent_id"` }
type UpdateParams ¶
Click to show internal directories.
Click to hide internal directories.