added tariff rest to openapi docs
This commit is contained in:
parent
5070cc9f50
commit
ff68956fb5
@ -8,6 +8,10 @@ tags:
|
|||||||
description: Внешний сервер
|
description: Внешний сервер
|
||||||
- name : PrivilegeInternal
|
- name : PrivilegeInternal
|
||||||
description: Внутренний сервер
|
description: Внутренний сервер
|
||||||
|
- name: TariffExternal
|
||||||
|
description: Внешний сервер
|
||||||
|
- name: TariffInternal
|
||||||
|
description: Внутренний сервер
|
||||||
paths:
|
paths:
|
||||||
/privilege/service:
|
/privilege/service:
|
||||||
get:
|
get:
|
||||||
@ -254,6 +258,172 @@ paths:
|
|||||||
$ref: "#/components/responses/404"
|
$ref: "#/components/responses/404"
|
||||||
'500':
|
'500':
|
||||||
$ref: "#/components/responses/500"
|
$ref: "#/components/responses/500"
|
||||||
|
/tariff/{id}:
|
||||||
|
get:
|
||||||
|
summary: получить тарифф по id
|
||||||
|
tags:
|
||||||
|
- TariffExternal
|
||||||
|
- TariffInternal
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Тарифф успешно получен
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Tariff"
|
||||||
|
'400':
|
||||||
|
$ref: "#/components/responses/400"
|
||||||
|
'404':
|
||||||
|
$ref: "#/components/responses/404"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
put:
|
||||||
|
summary: обновить тарифф по id
|
||||||
|
tags:
|
||||||
|
- TariffInternal
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: id тарифа для обновления
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Тариф успешно обновлен
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
'400':
|
||||||
|
$ref: "#/components/responses/400"
|
||||||
|
'404':
|
||||||
|
$ref: "#/components/responses/404"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
/tariff/getList:
|
||||||
|
get:
|
||||||
|
summary: получить тариффы с пагинацией
|
||||||
|
tags:
|
||||||
|
- TariffExternal
|
||||||
|
- TariffInternal
|
||||||
|
parameters:
|
||||||
|
- name: page
|
||||||
|
in: query
|
||||||
|
description: Номер страницы для пагинации
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
default: 1
|
||||||
|
- name: limit
|
||||||
|
in: query
|
||||||
|
description: Количество элементов на странице
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
default: 25
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Успешный ответ с тариффами
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/TariffPagination'
|
||||||
|
'401':
|
||||||
|
$ref: "#/components/responses/401"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
|
||||||
|
/tariff/:
|
||||||
|
post:
|
||||||
|
summary: создать тарифф
|
||||||
|
tags:
|
||||||
|
- TariffExternal
|
||||||
|
- TariffInternal
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Тариф успешно создан
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
'400':
|
||||||
|
$ref: "#/components/responses/400"
|
||||||
|
'401':
|
||||||
|
$ref: "#/components/responses/401"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
delete:
|
||||||
|
summary: метод мягкого удаления тариффа
|
||||||
|
tags:
|
||||||
|
- TariffInternal
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
description: id тарифа для удаления
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Тариф успешно удален
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
'400':
|
||||||
|
$ref: "#/components/responses/400"
|
||||||
|
'404':
|
||||||
|
$ref: "#/components/responses/404"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
/tariff/restore:
|
||||||
|
post:
|
||||||
|
summary: метод восстановления тариффа из мягко удаленных
|
||||||
|
tags:
|
||||||
|
- TariffInternal
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
description: id тарифа для восстановления
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Тариф успешно восстановлен
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
|
'400':
|
||||||
|
$ref: "#/components/responses/400"
|
||||||
|
'404':
|
||||||
|
$ref: "#/components/responses/404"
|
||||||
|
'500':
|
||||||
|
$ref: "#/components/responses/500"
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
@ -350,6 +520,61 @@ components:
|
|||||||
description: Массив объектов для создания или обновления привилегий
|
description: Массив объектов для создания или обновления привилегий
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/CreateUpdateReq"
|
$ref: "#/components/schemas/CreateUpdateReq"
|
||||||
|
Tariff:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
_id:
|
||||||
|
type: string
|
||||||
|
format: objectId
|
||||||
|
description: id тарифа objectID в mongo
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
description: Название тариффа
|
||||||
|
userID:
|
||||||
|
type: string
|
||||||
|
description: id пользователя котторому принадлежит тариф, либо пустое если тарифф создаваля админом
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
description: Описание тариффа
|
||||||
|
price:
|
||||||
|
type: integer
|
||||||
|
description: цена тарифа
|
||||||
|
order:
|
||||||
|
type: integer
|
||||||
|
description:
|
||||||
|
isCustom:
|
||||||
|
type: boolean
|
||||||
|
description: Флаг состояни кастомного тариффа
|
||||||
|
privileges:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Privilege'
|
||||||
|
description: Привилегии входящие в тарифф
|
||||||
|
isDeleted:
|
||||||
|
type: boolean
|
||||||
|
description: Флаг состояния удаления
|
||||||
|
createdAt:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
description: Время создания
|
||||||
|
updatedAt:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
description: Последнее время удаления
|
||||||
|
deletedAt:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
description: Время удаления
|
||||||
|
TariffPagination:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
totalPages:
|
||||||
|
type: integer
|
||||||
|
description: количество страниц на количесво элементов
|
||||||
|
tariffs:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Tariff'
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: Success
|
description: Success
|
||||||
|
Loading…
Reference in New Issue
Block a user