forked from Alexey/DAS_2024_1
128 lines
3.1 KiB
YAML
128 lines
3.1 KiB
YAML
definitions:
|
||
models.Stream:
|
||
description: Стрим
|
||
properties:
|
||
ended_at:
|
||
description: Время окончания стрима
|
||
type: string
|
||
id:
|
||
description: Идентификатор стрима
|
||
type: integer
|
||
started_at:
|
||
description: Время запуска стрима
|
||
example: "2024-10-04T14:48:00Z"
|
||
type: string
|
||
title:
|
||
description: Название стрима
|
||
type: string
|
||
type: object
|
||
info:
|
||
contact: { }
|
||
version: '2.0'
|
||
title: 'API'
|
||
paths:
|
||
/streams:
|
||
get:
|
||
consumes:
|
||
- application/json
|
||
description: Возвращает список всех стримов
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
items:
|
||
$ref: '#/definitions/models.Stream'
|
||
type: array
|
||
summary: Получить все стримы
|
||
tags:
|
||
- streams
|
||
post:
|
||
consumes:
|
||
- application/json
|
||
description: Создает новый стрим
|
||
parameters:
|
||
- description: Данные стримы
|
||
in: body
|
||
name: stream
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.Stream'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.Stream'
|
||
summary: Создать стрим
|
||
tags:
|
||
- streams
|
||
/streams/{id}:
|
||
delete:
|
||
consumes:
|
||
- application/json
|
||
description: Удаляет стрим по ID
|
||
parameters:
|
||
- description: ID стрима
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"204":
|
||
description: No Content
|
||
summary: Удалить стрим
|
||
tags:
|
||
- streams
|
||
get:
|
||
consumes:
|
||
- application/json
|
||
description: Возвращает стрим с указанным ID
|
||
parameters:
|
||
- description: ID стрима
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.Stream'
|
||
summary: Получить стрим по ID
|
||
tags:
|
||
- streams
|
||
put:
|
||
consumes:
|
||
- application/json
|
||
description: Обновляет данные стрима по ID
|
||
parameters:
|
||
- description: ID стрима
|
||
in: path
|
||
name: id
|
||
required: true
|
||
type: integer
|
||
- description: Обновленные данные стрима
|
||
in: body
|
||
name: stream
|
||
required: true
|
||
schema:
|
||
$ref: '#/definitions/models.Stream'
|
||
produces:
|
||
- application/json
|
||
responses:
|
||
"200":
|
||
description: OK
|
||
schema:
|
||
$ref: '#/definitions/models.Stream'
|
||
summary: Обновить данные стрима
|
||
tags:
|
||
- streams
|
||
swagger: "2.0"
|