This commit is contained in:
parent
e39d286742
commit
0b470ec9ad
4 changed files with 82 additions and 12 deletions
34
docs/docs.go
34
docs/docs.go
|
|
@ -1070,17 +1070,20 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"description": "Marks user as deleted by user uuid",
|
"description": "Returns user data",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"User"
|
"User"
|
||||||
],
|
],
|
||||||
"summary": "Delete user",
|
"summary": "Returns user data",
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"200": {
|
||||||
"description": "No Content"
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/user.MeDTO"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
|
|
@ -1094,6 +1097,12 @@ const docTemplate = `{
|
||||||
"$ref": "#/definitions/responses.Unauthorized"
|
"$ref": "#/definitions/responses.Unauthorized"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"404": {
|
||||||
|
"description": "Not Found",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.NotFound"
|
||||||
|
}
|
||||||
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|
@ -1377,6 +1386,15 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"responses.NotFound": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses.Unauthorized": {
|
"responses.Unauthorized": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -1385,6 +1403,14 @@ const docTemplate = `{
|
||||||
"example": "error"
|
"example": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"user.MeDTO": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"user_uuid": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
|
|
|
||||||
|
|
@ -1063,17 +1063,20 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"delete": {
|
"delete": {
|
||||||
"description": "Marks user as deleted by user uuid",
|
"description": "Returns user data",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"User"
|
"User"
|
||||||
],
|
],
|
||||||
"summary": "Delete user",
|
"summary": "Returns user data",
|
||||||
"responses": {
|
"responses": {
|
||||||
"204": {
|
"200": {
|
||||||
"description": "No Content"
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/user.MeDTO"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"400": {
|
"400": {
|
||||||
"description": "Bad Request",
|
"description": "Bad Request",
|
||||||
|
|
@ -1087,6 +1090,12 @@
|
||||||
"$ref": "#/definitions/responses.Unauthorized"
|
"$ref": "#/definitions/responses.Unauthorized"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"404": {
|
||||||
|
"description": "Not Found",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.NotFound"
|
||||||
|
}
|
||||||
|
},
|
||||||
"500": {
|
"500": {
|
||||||
"description": "Internal Server Error",
|
"description": "Internal Server Error",
|
||||||
"schema": {
|
"schema": {
|
||||||
|
|
@ -1370,6 +1379,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"responses.NotFound": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"error": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"responses.Unauthorized": {
|
"responses.Unauthorized": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
@ -1378,6 +1396,14 @@
|
||||||
"example": "error"
|
"example": "error"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"user.MeDTO": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"user_uuid": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -175,12 +175,23 @@ definitions:
|
||||||
example: error
|
example: error
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
responses.NotFound:
|
||||||
|
properties:
|
||||||
|
error:
|
||||||
|
example: error
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
responses.Unauthorized:
|
responses.Unauthorized:
|
||||||
properties:
|
properties:
|
||||||
error:
|
error:
|
||||||
example: error
|
example: error
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
|
user.MeDTO:
|
||||||
|
properties:
|
||||||
|
user_uuid:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
info:
|
info:
|
||||||
contact: {}
|
contact: {}
|
||||||
description: Stores data about merch and prices
|
description: Stores data about merch and prices
|
||||||
|
|
@ -851,10 +862,12 @@ paths:
|
||||||
delete:
|
delete:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Marks user as deleted by user uuid
|
description: Returns user data
|
||||||
responses:
|
responses:
|
||||||
"204":
|
"200":
|
||||||
description: No Content
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/user.MeDTO'
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -863,11 +876,15 @@ paths:
|
||||||
description: Unauthorized
|
description: Unauthorized
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/responses.Unauthorized'
|
$ref: '#/definitions/responses.Unauthorized'
|
||||||
|
"404":
|
||||||
|
description: Not Found
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/responses.NotFound'
|
||||||
"500":
|
"500":
|
||||||
description: Internal Server Error
|
description: Internal Server Error
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/responses.InternalServerError'
|
$ref: '#/definitions/responses.InternalServerError'
|
||||||
summary: Delete user
|
summary: Returns user data
|
||||||
tags:
|
tags:
|
||||||
- User
|
- User
|
||||||
post:
|
post:
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ func (h *Handler) RegisterRoutes(r *gin.RouterGroup, mw *router.Middlewares) {
|
||||||
|
|
||||||
userGroup.POST("", mw.RegMW, h.controller.create)
|
userGroup.POST("", mw.RegMW, h.controller.create)
|
||||||
userGroup.DELETE("", mw.AuthMW, h.controller.delete)
|
userGroup.DELETE("", mw.AuthMW, h.controller.delete)
|
||||||
|
userGroup.GET("/me", h.controller.me)
|
||||||
}
|
}
|
||||||
|
|
||||||
// create godoc
|
// create godoc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue