swagger docs update
This commit is contained in:
parent
5952c8e320
commit
0d5d03ba0d
4 changed files with 121 additions and 8 deletions
45
docs/docs.go
45
docs/docs.go
|
|
@ -60,7 +60,7 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/merch/{uuid}": {
|
"/merch/": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
{
|
{
|
||||||
|
|
@ -95,6 +95,49 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/merch/{uuid}": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Получить всю информацию про мерч по его uuid",
|
||||||
|
"tags": [
|
||||||
|
"Merch"
|
||||||
|
],
|
||||||
|
"summary": "Получить всю информацию про мерч",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "merch_uuid",
|
||||||
|
"name": "uuid",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/merch.MerchDTO"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"security": [
|
"security": [
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/merch/{uuid}": {
|
"/merch/": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
{
|
{
|
||||||
|
|
@ -87,6 +87,49 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/merch/{uuid}": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"BearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Получить всю информацию про мерч по его uuid",
|
||||||
|
"tags": [
|
||||||
|
"Merch"
|
||||||
|
],
|
||||||
|
"summary": "Получить всю информацию про мерч",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "merch_uuid",
|
||||||
|
"name": "uuid",
|
||||||
|
"in": "path",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/merch.MerchDTO"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.ErrorResponse400"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/responses.ErrorResponse500"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"put": {
|
"put": {
|
||||||
"security": [
|
"security": [
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,29 @@ paths:
|
||||||
summary: Добавить новый мерч
|
summary: Добавить новый мерч
|
||||||
tags:
|
tags:
|
||||||
- Merch
|
- Merch
|
||||||
|
/merch/:
|
||||||
|
get:
|
||||||
|
description: Получить все записи мерча
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
items:
|
||||||
|
$ref: '#/definitions/merch.ListResponse'
|
||||||
|
type: array
|
||||||
|
"400":
|
||||||
|
description: Bad Request
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/responses.ErrorResponse400'
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/responses.ErrorResponse500'
|
||||||
|
security:
|
||||||
|
- BearerAuth: []
|
||||||
|
summary: Получить все записи мерча
|
||||||
|
tags:
|
||||||
|
- Merch
|
||||||
/merch/{uuid}:
|
/merch/{uuid}:
|
||||||
delete:
|
delete:
|
||||||
description: Пометить мерч как удаленный по его uuid
|
description: Пометить мерч как удаленный по его uuid
|
||||||
|
|
@ -153,14 +176,18 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- Merch
|
- Merch
|
||||||
get:
|
get:
|
||||||
description: Получить все записи мерча
|
description: Получить всю информацию про мерч по его uuid
|
||||||
|
parameters:
|
||||||
|
- description: merch_uuid
|
||||||
|
in: path
|
||||||
|
name: uuid
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
schema:
|
schema:
|
||||||
items:
|
$ref: '#/definitions/merch.MerchDTO'
|
||||||
$ref: '#/definitions/merch.ListResponse'
|
|
||||||
type: array
|
|
||||||
"400":
|
"400":
|
||||||
description: Bad Request
|
description: Bad Request
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -171,7 +198,7 @@ paths:
|
||||||
$ref: '#/definitions/responses.ErrorResponse500'
|
$ref: '#/definitions/responses.ErrorResponse500'
|
||||||
security:
|
security:
|
||||||
- BearerAuth: []
|
- BearerAuth: []
|
||||||
summary: Получить все записи мерча
|
summary: Получить всю информацию про мерч
|
||||||
tags:
|
tags:
|
||||||
- Merch
|
- Merch
|
||||||
put:
|
put:
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ func (co *controller) getSingleMerch(c *gin.Context) {
|
||||||
// @Success 200 {array} ListResponse
|
// @Success 200 {array} ListResponse
|
||||||
// @Failure 400 {object} responses.ErrorResponse400
|
// @Failure 400 {object} responses.ErrorResponse400
|
||||||
// @Failure 500 {object} responses.ErrorResponse500
|
// @Failure 500 {object} responses.ErrorResponse500
|
||||||
// @Router /merch/{uuid} [get]
|
// @Router /merch/ [get]
|
||||||
func (co *controller) getAllMerch(c *gin.Context) {
|
func (co *controller) getAllMerch(c *gin.Context) {
|
||||||
userUuid, err := co.utils.GetUserUuidFromContext(c)
|
userUuid, err := co.utils.GetUserUuidFromContext(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue