From a5d571d09a2e588950bb9013cf502f032354d60f Mon Sep 17 00:00:00 2001 From: Anton Pomorzin Date: Wed, 21 May 2025 11:33:43 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20=D0=BB=D0=B0=D0=B9=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2/swagger.yaml | 172 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index 704de62..39d3cdf 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -4907,6 +4907,178 @@ paths: 403: description: Unauthorized request. + /api/v2/like/add: + post: + tags: + - like + summary: Добавить лайк + description: Добавляет лайк к сущности по entity_id и item_id. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + entity_id: + type: integer + description: ID сущности + example: 100 + item_id: + type: string + description: ID записи + example: "e456bfb3-31dc-4c94-81ca-17dc49043a2b" + responses: + 200: + description: Результат добавления лайка + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + description: Результат операции + example: true + 400: + description: Ошибка валидации данных + content: + application/json: + schema: + type: array + items: + type: object + properties: + field: + type: string + example: entityId + message: + type: string + example: Необходимо заполнить «Entity Id». + 404: + description: Не найдено + 500: + description: Внутренняя ошибка сервера + paths: + /api/v2/like/delete: + delete: + tags: + - like + summary: Удалить лайк + operationId: LikeDelete + parameters: + - name: entity_id + in: query + required: true + schema: + type: integer + description: ID сущности + - name: item_id + in: query + required: true + schema: + type: string + description: ID записи + responses: + 204: + description: Успешно удалено (нет тела ответа) + 404: + description: Запись не найдена + 422: + description: Ошибка валидации + content: + application/json: + schema: + type: array + items: + type: object + properties: + field: + type: string + message: + type: string + example: + - field: entityId + message: Необходимо заполнить «Entity Id». + /api/v2/like/content-items-state: + get: + tags: + - like + summary: Получить статистику лайков по контенту из редактора (галерея типа карусель) + description: | + Возвращает: + - `counts`: список ID файлов (из редактора, из галереи), у которых есть лайки, и количество этих лайков. + - `states`: список ID файлов, которым текущий пользователь поставил лайк. + operationId: ContentItemsState + parameters: + - name: entity_id + in: query + schema: + type: number + enum: + - 50 + - 100 + - 300 + - 375 + - 500 + - 550 + description: > + Entity ID - Идентификатор сущности, которая имеет контет, из редактора. + * `22` - Department (Тренинги) + * `100` - Article (Новости/Страницы) + * `119` - CalendarEvent (Тренинги) + * `500` - WfWorkflow (Процессы) + * `550` - Training (Тренинги) + - name: item_id + in: query + required: true + schema: + type: string + description: ID записи + responses: + 200: + description: Успешный ответ + content: + application/json: + schema: + type: object + properties: + success: + type: boolean + example: true + data: + type: object + properties: + counts: + type: object + example: + e456bfb3-31dc-4c94-81ca-17dc49043a2b: 5 + ee56bfb3-31dc-4c94-81ca-17dc49043a2b: 2 + states: + type: array + items: + type: string + example: + - e456bfb3-31dc-4c94-81ca-17dc49043a2b + - ee56bfb3-31dc-4c94-81ca-17dc49043a2b + 404: + description: Сущность не найдена или не реализует ContentEditorInterface + 422: + description: Ошибка валидации + content: + application/json: + schema: + type: array + items: + type: object + properties: + field: + type: string + message: + type: string + example: + - field: entityId + message: Необходимо заполнить «Entity Id». components: securitySchemes: SessionAuth: