Compare commits
No commits in common. "2be4afd0e0892a35d4ec23e1f0aa2459fffe6418" and "fe6942aa8145d08304f28a920ac8f5b998001aef" have entirely different histories.
2be4afd0e0
...
fe6942aa81
2 changed files with 5 additions and 30 deletions
|
@ -32,17 +32,6 @@ const docTemplate = `{
|
||||||
"User"
|
"User"
|
||||||
],
|
],
|
||||||
"summary": "Register a new user",
|
"summary": "Register a new user",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"description": "User to register",
|
|
||||||
"name": "{string}",
|
|
||||||
"in": "body",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"$ref": "#/definitions/types.NewUser"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "User added",
|
"description": "User added",
|
||||||
|
@ -66,19 +55,6 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
|
||||||
"types.NewUser": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"externalDocs": {
|
"externalDocs": {
|
||||||
"description": "OpenAPI",
|
"description": "OpenAPI",
|
||||||
"url": "https://swagger.io/resources/open-api/"
|
"url": "https://swagger.io/resources/open-api/"
|
||||||
|
|
|
@ -15,12 +15,11 @@ import (
|
||||||
// @Description Register a new user
|
// @Description Register a new user
|
||||||
// @Tags User
|
// @Tags User
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce plain
|
// @Produce json
|
||||||
// @Param NewUser body types.NewUser true "User to register"
|
// @Success 200 {string} string "User added"
|
||||||
// @Success 200 {string} string "User added"
|
// @Failure 400 {string} string "Bad request"
|
||||||
// @Failure 400 {string} string "Bad request"
|
// @Failure 500 {string} string "Internal server error"
|
||||||
// @Failure 500 {string} string "Internal server error"
|
// @Router /api/register [post]
|
||||||
// @Router /register [post]
|
|
||||||
func (gs *GState) Register(c *fiber.Ctx) error {
|
func (gs *GState) Register(c *fiber.Ctx) error {
|
||||||
u := new(types.NewUser)
|
u := new(types.NewUser)
|
||||||
if err := c.BodyParser(u); err != nil {
|
if err := c.BodyParser(u); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue