163 lines
4.1 KiB
YAML
163 lines
4.1 KiB
YAML
|
definitions:
|
|||
|
models.Message:
|
|||
|
description: Сообщение
|
|||
|
properties:
|
|||
|
content:
|
|||
|
description: Содержание комментария
|
|||
|
type: string
|
|||
|
created_at:
|
|||
|
description: Время отправления комментария
|
|||
|
example: "2024-10-04T14:48:00Z"
|
|||
|
type: string
|
|||
|
id:
|
|||
|
description: Идентификатор сообщения
|
|||
|
type: integer
|
|||
|
stream_id:
|
|||
|
description: Идентификатор стрима
|
|||
|
type: integer
|
|||
|
type: object
|
|||
|
models.MessageResponse:
|
|||
|
properties:
|
|||
|
content:
|
|||
|
type: string
|
|||
|
created_at:
|
|||
|
example: "2024-10-04T14:48:00Z"
|
|||
|
type: string
|
|||
|
id:
|
|||
|
type: integer
|
|||
|
stream_title:
|
|||
|
type: string
|
|||
|
type: object
|
|||
|
info:
|
|||
|
contact: { }
|
|||
|
version: '2.0'
|
|||
|
title: 'API'
|
|||
|
paths:
|
|||
|
/messages:
|
|||
|
get:
|
|||
|
consumes:
|
|||
|
- application/json
|
|||
|
description: Возвращает список всех сообщений
|
|||
|
produces:
|
|||
|
- application/json
|
|||
|
responses:
|
|||
|
"200":
|
|||
|
description: OK
|
|||
|
schema:
|
|||
|
items:
|
|||
|
$ref: '#/definitions/models.Message'
|
|||
|
type: array
|
|||
|
summary: Получить все сообщения
|
|||
|
tags:
|
|||
|
- messages
|
|||
|
post:
|
|||
|
consumes:
|
|||
|
- application/json
|
|||
|
description: Создает новое сообщение
|
|||
|
parameters:
|
|||
|
- description: Данные сообщения
|
|||
|
in: body
|
|||
|
name: message
|
|||
|
required: true
|
|||
|
schema:
|
|||
|
$ref: '#/definitions/models.Message'
|
|||
|
produces:
|
|||
|
- application/json
|
|||
|
responses:
|
|||
|
"200":
|
|||
|
description: OK
|
|||
|
schema:
|
|||
|
$ref: '#/definitions/models.Message'
|
|||
|
summary: Создать сообщение
|
|||
|
tags:
|
|||
|
- messages
|
|||
|
/messages/{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:
|
|||
|
- messages
|
|||
|
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.Message'
|
|||
|
summary: Получить сообщение по ID
|
|||
|
tags:
|
|||
|
- messages
|
|||
|
put:
|
|||
|
consumes:
|
|||
|
- application/json
|
|||
|
description: Обновляет данные сообщения по ID
|
|||
|
parameters:
|
|||
|
- description: ID сообщения
|
|||
|
in: path
|
|||
|
name: id
|
|||
|
required: true
|
|||
|
type: integer
|
|||
|
- description: Обновленные данные сообщения
|
|||
|
in: body
|
|||
|
name: message
|
|||
|
required: true
|
|||
|
schema:
|
|||
|
$ref: '#/definitions/models.Message'
|
|||
|
produces:
|
|||
|
- application/json
|
|||
|
responses:
|
|||
|
"200":
|
|||
|
description: OK
|
|||
|
schema:
|
|||
|
$ref: '#/definitions/models.Message'
|
|||
|
summary: Обновить данные сообщения
|
|||
|
tags:
|
|||
|
- messages
|
|||
|
/messages/all/{streamId}:
|
|||
|
get:
|
|||
|
consumes:
|
|||
|
- application/json
|
|||
|
description: Возвращает список сообщений с указанным StreamID
|
|||
|
parameters:
|
|||
|
- description: StreamID сообщения
|
|||
|
in: path
|
|||
|
name: streamId
|
|||
|
required: true
|
|||
|
type: integer
|
|||
|
produces:
|
|||
|
- application/json
|
|||
|
responses:
|
|||
|
"200":
|
|||
|
description: OK
|
|||
|
schema:
|
|||
|
items:
|
|||
|
$ref: '#/definitions/models.MessageResponse'
|
|||
|
type: array
|
|||
|
summary: Получить список сообщений по StreamID
|
|||
|
tags:
|
|||
|
- messages
|
|||
|
swagger: "2.0"
|