DAS_2024_1/zhimolostnova_anna_lab_3/messageService/docs/swagger.json
2024-10-05 21:14:57 +03:00

244 lines
8.1 KiB
JSON
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.

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