api/docs/swagger.yaml
2025-10-26 19:54:51 +03:00

628 lines
17 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

basePath: /api/v2
definitions:
imageStorage.UploadMerchImageResponse:
properties:
fullImage:
type: string
thumbnail:
type: string
type: object
merch.ImageLink:
properties:
etag:
type: string
link:
type: string
type: object
merch.ListResponse:
properties:
merch_uuid:
type: string
name:
type: string
type: object
merch.MandarakeDTO:
properties:
link:
type: string
type: object
merch.MerchDTO:
properties:
merch_uuid:
type: string
name:
type: string
origin_mandarake:
$ref: '#/definitions/merch.MandarakeDTO'
origin_surugaya:
$ref: '#/definitions/merch.SurugayaDTO'
type: object
merch.OriginWithPrices:
properties:
origin:
type: integer
prices:
items:
$ref: '#/definitions/merch.PriceEntry'
type: array
type: object
merch.PriceEntry:
properties:
created_at:
type: integer
value:
type: integer
type: object
merch.PricesResponse:
properties:
merch_uuid:
type: string
name:
type: string
origins:
items:
$ref: '#/definitions/merch.OriginWithPrices'
type: array
type: object
merch.SurugayaDTO:
properties:
link:
type: string
type: object
merch.UpdateMerchDTO:
properties:
link:
type: string
merch_uuid:
type: string
name:
type: string
origin:
type: string
type: object
responses.ErrorResponse400:
properties:
error:
example: Bad Request
type: string
type: object
responses.ErrorResponse401:
properties:
error:
example: Unauthorized
type: string
type: object
responses.ErrorResponse500:
properties:
error:
example: Internal Server Error
type: string
type: object
shared.CurrentSession:
properties:
expires:
type: string
uuid:
type: string
type: object
user.Info:
properties:
created_at:
type: string
email:
type: string
username:
type: string
type: object
user.Login:
properties:
email:
type: string
password:
type: string
type: object
user.LoginResponse:
properties:
access_token:
type: string
type: object
user.Register:
properties:
email:
type: string
password:
type: string
username:
type: string
type: object
user.Update:
properties:
email:
type: string
username:
type: string
type: object
info:
contact: {}
title: Merch Parser
version: 2.0.0-alpha
paths:
/merch:
post:
consumes:
- application/json
description: Добавить новый мерч
parameters:
- description: новый мерч
in: body
name: body
required: true
schema:
$ref: '#/definitions/merch.MerchDTO'
responses:
"200":
description: OK
"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/:
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
put:
description: Обновить информацию про мерч по его uuid в json-е
parameters:
- description: merch_uuid
in: body
name: body
required: true
schema:
$ref: '#/definitions/merch.UpdateMerchDTO'
responses:
"200":
description: OK
"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}:
delete:
description: Пометить мерч как удаленный по его uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
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'
security:
- BearerAuth: []
summary: Пометить мерч как удаленный
tags:
- Merch
get:
description: Получить всю информацию про мерч по его uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
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'
security:
- BearerAuth: []
summary: Получить всю информацию про мерч
tags:
- Merch
/merch/images/{uuid}:
delete:
description: Удалить (безвозвратно) картинки по merch_uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Удалить (безвозвратно) картинки по merch_uuid
tags:
- Merch images
get:
description: Получить картинки по merch_uuid и query параметрам
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
- description: image type
in: query
name: type
required: true
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.ImageLink'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Получить картинки по merch_uuid и query параметрам
tags:
- Merch images
post:
consumes:
- multipart/form-data
description: Загрузить картинку по merch_uuid. В ответ будут выданы ссылки на
созданные картинки.
parameters:
- description: Merch UUID
in: path
name: uuid
required: true
type: string
- description: Image file
in: formData
name: file
required: true
type: file
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/imageStorage.UploadMerchImageResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Загрузить картинку по merch_uuid
tags:
- Merch images
/prices:
get:
description: Получить цены мерча за период
parameters:
- description: period in days
in: query
name: days
type: string
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/merch.PricesResponse'
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
/prices/{uuid}:
get:
description: Получить перепады цен мерча за период по его merch_uuid
parameters:
- description: merch_uuid
in: path
name: uuid
required: true
type: string
- description: period in days
in: query
name: days
type: string
responses:
"200":
description: OK
schema:
$ref: '#/definitions/merch.PricesResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Получить перепады цен мерча за период по его merch_uuid
tags:
- Merch
/user:
delete:
description: Помечает пользователя как удаленного по его uuid из токена
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.ErrorResponse401'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Удалить пользователя
tags:
- Users
get:
description: Получает информацию о пользователе по его uuid из токена
responses:
"200":
description: OK
schema:
$ref: '#/definitions/user.Info'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.ErrorResponse401'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Получить информацию о пользователе
tags:
- Users
post:
consumes:
- application/json
description: Регистрация нового пользователя
parameters:
- description: новый пользователь
in: body
name: body
required: true
schema:
$ref: '#/definitions/user.Register'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
summary: Регистрация нового пользователя
tags:
- Users
put:
consumes:
- application/json
description: Обновить информацию о пользователе по его uuid из токена
parameters:
- description: изменения
in: body
name: body
required: true
schema:
$ref: '#/definitions/user.Update'
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.ErrorResponse401'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Обновить информацию о пользователе
tags:
- Users
/user/auth/current-session:
get:
description: Возвращает информацию о текущей сессии пользователя
responses:
"200":
description: OK
schema:
$ref: '#/definitions/shared.CurrentSession'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/responses.ErrorResponse401'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
security:
- BearerAuth: []
summary: Возвращает информацию о текущей сессии пользователя
tags:
- Users
/user/auth/login:
post:
consumes:
- application/json
description: Логин
parameters:
- description: логин
in: body
name: body
required: true
schema:
$ref: '#/definitions/user.Login'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/user.LoginResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
summary: Логин
tags:
- Users - auth
/user/auth/logout:
post:
description: Логаут. Для логаута надо передать refresh token, он будет инвалидирован.
responses:
"200":
description: OK
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
summary: Логаут
tags:
- Users - auth
/user/auth/refresh:
post:
description: Принимает рефреш токен в http only куки
responses:
"200":
description: OK
schema:
$ref: '#/definitions/user.LoginResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/responses.ErrorResponse400'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/responses.ErrorResponse500'
summary: Обновление аксесс токена по рефреш токену.
tags:
- Users - auth
securityDefinitions:
BearerAuth:
description: Введите "Bearer {your_token}" для аутентификации
in: header
name: Authorization
type: apiKey
swagger: "2.0"