Mounting handlers and basic swagger docs example
This commit is contained in:
parent
f75cb7e9fc
commit
13c12b424a
2 changed files with 28 additions and 0 deletions
|
@ -46,6 +46,17 @@ type GState struct {
|
|||
ButtonCount int
|
||||
}
|
||||
|
||||
// Register is a simple handler that registers a new user
|
||||
//
|
||||
// @Summary Register a new user
|
||||
// @Description Register a new user
|
||||
// @Tags User
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {string} string "User added"
|
||||
// @Failure 400 {string} string "Bad request"
|
||||
// @Failure 500 {string} string "Internal server error"
|
||||
// @Router /api/register [post]
|
||||
func (gs *GState) Register(c *fiber.Ctx) error {
|
||||
u := new(types.User)
|
||||
if err := c.BodyParser(u); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue