Add api key for use rest api
Test Workflow / test (push) Has been cancelled

This commit is contained in:
2026-07-01 11:49:54 +07:00
parent be63fc3c10
commit 7b7a366d78
4 changed files with 1800 additions and 9 deletions
+221 -6
View File
@@ -4,12 +4,15 @@ info:
description: |
API для работы с файлами, платежами, выплатами, поиском и пользователями.
Включает контроллеры:
- FileController
- GlobalSearchController
- PaymentController
- PayoutController
- SearchSettingsController
- UserController
- FileController (GET/POST файлы, защита, проверка)
- GlobalSearchController (глобальный поиск, нарушения, статус)
- PaymentController (платежи, методы оплаты, авто-продление)
- PayoutController (выплаты, методы выплат, управление)
- SearchSettingsController (настройки поисковых систем)
- UserController (профиль, регистрация, смена пароля)
- ApiKeyController (управление API ключами)
- HealtCheckController (мониторинг здоровья, информация о приложении)
- MigrationController (администраторские инструменты миграции)
version: 1.0.0
contact:
name: NoCopy
@@ -31,6 +34,12 @@ tags:
description: Выплаты и управление методами выплат
- name: User
description: Управление пользователями и профилем
- name: API Keys
description: Управление API ключами пользователя
- name: Health Check
description: Мониторинг здоровья приложения
- name: Migration
description: Администраторские инструменты миграции
paths:
/api/files/public/{fileId}:
@@ -978,6 +987,212 @@ paths:
type: string
example: "true"
/api/user/api-keys:
post:
tags:
- API Keys
summary: Создание API ключа
description: Создаёт новый API ключ для текущего пользователя
operationId: createApiKey
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: Название ключа
example: "Production Key"
responses:
'200':
description: API ключ создан
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
get:
tags:
- API Keys
summary: Получение списка API ключей
description: Получение всех API ключей текущего пользователя
operationId: listApiKeys
security:
- BearerAuth: []
responses:
'200':
description: Список API ключей
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
/api/user/api-keys/{keyId}:
delete:
tags:
- API Keys
summary: Отзыв API ключа
description: Деактивирует API ключ пользователя
operationId: revokeApiKey
security:
- BearerAuth: []
parameters:
- name: keyId
in: path
required: true
schema:
type: integer
format: int64
description: ID ключа для отзыва
responses:
'200':
description: Ключ отозван
content:
application/json:
schema:
$ref: '#/components/schemas/BaseResponse'
/check/api/healt:
get:
tags:
- Health Check
summary: Проверка здоровья приложения
description: Проверяет, работает ли приложение
operationId: healthCheck
responses:
'200':
description: Приложение работает нормально
/check/api/build:
get:
tags:
- Health Check
summary: Информация о сборке
description: Получение информации о времени сборки приложения
operationId: getBuildInfo
responses:
'200':
description: Информация о сборке
content:
application/json:
schema:
type: object
properties:
buildTimeBack:
type: string
example: "2025-06-30T10:30:00Z"
/check/api/api/debug/memory:
get:
tags:
- Health Check
summary: Информация о памяти
description: Получение информации об использовании памяти JVM
operationId: getMemoryInfo
responses:
'200':
description: Информация о памяти
content:
application/json:
schema:
type: object
properties:
maxMemory (MB):
type: string
totalMemory (MB):
type: string
freeMemory (MB):
type: string
usedMemory (MB):
type: string
availableProcessors:
type: string
/check/api/test/monitoring/{fileId}:
post:
tags:
- Health Check
summary: Тестирование мониторинга
description: Запускает тестовый мониторинг для файла
operationId: testMonitoring
parameters:
- name: fileId
in: path
required: true
schema:
type: string
description: ID файла для тестирования
responses:
'200':
description: Мониторинг запущен
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: "OK"
/api/admin/migration/start:
post:
tags:
- Migration
summary: Запуск миграции
description: Запускает миграцию файлов в S3 хранилище
operationId: startMigration
responses:
'200':
description: Миграция запущена
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Migration started. Check logs for progress."
/api/admin/migration/status:
post:
tags:
- Migration
summary: Статус миграции
description: Получение статуса выполняемой миграции
operationId: getMigrationStatus
responses:
'200':
description: Статус миграции
content:
application/json:
schema:
type: object
properties:
message:
type: string
/api/admin/migration/fill-dock-view:
post:
tags:
- Migration
summary: Заполнение dock view
description: Заполнение данных просмотров документов из миграции
operationId: fillDockView
responses:
'200':
description: Данные заполнены
content:
application/json:
schema:
type: object
properties:
message:
type: string
components:
schemas:
BaseResponse: