234 lines
5.7 KiB
YAML
234 lines
5.7 KiB
YAML
basePath: /
|
||
definitions:
|
||
handler.CreateSubscriptionRequest:
|
||
properties:
|
||
end_date:
|
||
example: 12-2025
|
||
type: string
|
||
price:
|
||
example: 400
|
||
type: integer
|
||
service_name:
|
||
example: Yandex Plus
|
||
type: string
|
||
start_date:
|
||
example: 07-2025
|
||
type: string
|
||
user_id:
|
||
example: 60601fee-2bf1-4721-ae6f-7636e79a0cba
|
||
type: string
|
||
type: object
|
||
model.Subscription:
|
||
properties:
|
||
end_date:
|
||
type: string
|
||
id:
|
||
type: integer
|
||
price:
|
||
type: integer
|
||
service_name:
|
||
type: string
|
||
start_date:
|
||
type: string
|
||
user_id:
|
||
type: string
|
||
type: object
|
||
info:
|
||
contact: {}
|
||
description: API для агрегации онлайн-подписок пользователей.
|
||
title: Subscription API
|
||
version: "1.0"
|
||
paths:
|
||
/subscriptions:
|
||
get:
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
items:
|
||
$ref: '#/definitions/model.Subscription'
|
||
type: array
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Список подписок
|
||
tags:
|
||
- subscriptions
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
parameters:
|
||
- description: Создание подписки
|
||
in: body
|
||
name: subscription
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/handler.CreateSubscriptionRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"201":
|
||
description: Created
|
||
schema:
|
||
$ref: '#/definitions/model.Subscription'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Создать подписку
|
||
tags:
|
||
- subscriptions
|
||
/subscriptions/{id}:
|
||
delete:
|
||
parameters:
|
||
- description: ID подписки
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
responses:
|
||
"204":
|
||
description: No Content
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Удалить подписку по ID
|
||
tags:
|
||
- subscriptions
|
||
get:
|
||
parameters:
|
||
- description: ID подписки
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/model.Subscription'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
"404":
|
||
description: Not Found
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Получить подписку по ID
|
||
tags:
|
||
- subscriptions
|
||
put:
|
||
consumes:
|
||
- application/json
|
||
parameters:
|
||
- description: ID подписки
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
- description: Обновление подписки
|
||
in: body
|
||
name: subscription
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/handler.CreateSubscriptionRequest'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/model.Subscription'
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Обновить подписку по ID
|
||
tags:
|
||
- subscriptions
|
||
/subscriptions/sum:
|
||
get:
|
||
parameters:
|
||
- description: UUID пользователя
|
||
in: query
|
||
name: user_id
|
||
type: string
|
||
- description: Название сервиса
|
||
in: query
|
||
name: service_name
|
||
type: string
|
||
- description: Начало периода, формат MM-YYYY
|
||
example: '"07-2025"'
|
||
in: query
|
||
name: start
|
||
required: true
|
||
type: string
|
||
- description: Конец периода, формат MM-YYYY
|
||
example: '"08-2025"'
|
||
in: query
|
||
name: end
|
||
required: true
|
||
type: string
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
additionalProperties:
|
||
type: integer
|
||
type: object
|
||
"400":
|
||
description: Bad Request
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
"500":
|
||
description: Internal Server Error
|
||
schema:
|
||
additionalProperties:
|
||
type: string
|
||
type: object
|
||
summary: Суммарная стоимость подписок за период с фильтрацией
|
||
tags:
|
||
- subscriptions
|
||
swagger: "2.0"
|