feat: Настройки авторизации
This commit is contained in:
+422
@@ -331,6 +331,152 @@ paths:
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/mobile/user-index:
|
||||
get:
|
||||
tags:
|
||||
- mobile
|
||||
summary: Список подключённых мобильных устройств пользователя
|
||||
description: >
|
||||
Возвращает список устройств, подключённых к учётной записи пользователя.
|
||||
Обычный пользователь видит только свои устройства.
|
||||
Администратор с правом `user-edit` может просматривать устройства конкретного пользователя, указав `user_id`.
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: >
|
||||
UUID пользователя.
|
||||
По умолчанию используется ID пользователя, если запрос выполняется обычным пользователем.
|
||||
Для админа параметр обязателен, если он хочет получить устройства конкретного пользователя.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
- name: page
|
||||
in: query
|
||||
required: false
|
||||
description: Номер страницы
|
||||
schema:
|
||||
type: integer
|
||||
example: 1
|
||||
- name: per-page
|
||||
in: query
|
||||
required: false
|
||||
description: Количество элементов на странице
|
||||
schema:
|
||||
type: integer
|
||||
example: 10
|
||||
responses:
|
||||
'200':
|
||||
description: Успешный ответ с пагинацией
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/dataProviderResponse'
|
||||
- type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/mobileConnect'
|
||||
403:
|
||||
description: Недостаточно прав для просмотра устройств другого пользователя
|
||||
401:
|
||||
description: Пользователь не авторизован
|
||||
500:
|
||||
description: Server Error
|
||||
|
||||
/mobile/user-unbind:
|
||||
delete:
|
||||
tags:
|
||||
- mobile
|
||||
summary: Отвязка конкретного устройства пользователя
|
||||
description: >
|
||||
Отвязывает одно устройство по `device_id`.
|
||||
Обычный пользователь может отвязать только свои устройства.
|
||||
Администратор с правом `user-edit` может указать `user_id`, чтобы отвязать устройство другого пользователя.
|
||||
parameters:
|
||||
- name: device_id
|
||||
in: query
|
||||
required: true
|
||||
description: >
|
||||
Device ID устройства, которое необходимо отвязать.
|
||||
schema:
|
||||
type: string
|
||||
example: "43835f8b44dd3116382c7ecaeaf15d88"
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: >
|
||||
UUID пользователя, которому принадлежит устройство.
|
||||
По умолчанию используется ID пользователя.
|
||||
Передаётся только администратором.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
responses:
|
||||
'200':
|
||||
description: Устройство успешно отвязано
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/httpJsonResponse'
|
||||
- type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: "Устройство было отвязано"
|
||||
403:
|
||||
description: Недостаточно прав для выполнения операции
|
||||
401:
|
||||
description: Пользователь не авторизован
|
||||
500:
|
||||
description: Server Error
|
||||
|
||||
/mobile/unbind-all:
|
||||
delete:
|
||||
tags:
|
||||
- mobile
|
||||
summary: Отвязка всех устройств пользователя
|
||||
description: >
|
||||
Отвязывает все устройства, подключённые к пользователю.
|
||||
Обычный пользователь может отвязать только свои устройства.
|
||||
Администратор с правом `user-edit` может передать `user_id`, чтобы отвязать устройства другого пользователя.
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: >
|
||||
UUID пользователя, чьи устройства нужно отвязать.
|
||||
По умолчанию используется ID пользователя.
|
||||
Передаётся только администратором.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
responses:
|
||||
'200':
|
||||
description: Устройства успешно отвязаны
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: '#/components/schemas/httpJsonResponse'
|
||||
- type: object
|
||||
properties:
|
||||
message:
|
||||
type: string
|
||||
example: "Устройства были отвязаны"
|
||||
403:
|
||||
description: Недостаточно прав для выполнения операции
|
||||
401:
|
||||
description: Пользователь не авторизован
|
||||
500:
|
||||
description: Server Error
|
||||
|
||||
/user/profile:
|
||||
get:
|
||||
tags:
|
||||
@@ -403,6 +549,226 @@ paths:
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/user/unlock-status:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Запрос статуса разблокировки настроек авторизации
|
||||
description: >
|
||||
Проверяет, может ли текущий пользователь разблокировать свой статус.
|
||||
Администратор с правом `user-edit` может указать `user_id` другого пользователя.
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: UUID пользователя (только для админа). По умолчанию текущий пользователь.
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
responses:
|
||||
200:
|
||||
description: Статус разблокировки
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/user/auth-settings:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Получение настроек авторизации пользователя
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: UUID пользователя (только для админа)
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
responses:
|
||||
200:
|
||||
description: Настройки авторизации
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
example:
|
||||
success: true
|
||||
data:
|
||||
userAuthSettingsForm:
|
||||
email: "ivanov@example.com"
|
||||
phone_auth: "+79991234567"
|
||||
login: "ivanov"
|
||||
emailsList:
|
||||
- "ivanov@example.com"
|
||||
- "ivanov@corporate.com"
|
||||
phonesList:
|
||||
"+79991234567": "+7 (999) 123-45-67"
|
||||
errors: [ ]
|
||||
message: ""
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Сохранение настроек авторизации пользователя
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
description: Только для админа
|
||||
email:
|
||||
type: string
|
||||
example: "ivanov@example.com"
|
||||
phone_auth:
|
||||
type: string
|
||||
example: "+79991234567"
|
||||
login:
|
||||
type: string
|
||||
example: "ivanov"
|
||||
password:
|
||||
type: string
|
||||
example: "newpassword123"
|
||||
responses:
|
||||
200:
|
||||
description: Результат сохранения
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
example:
|
||||
success: true
|
||||
data: { }
|
||||
errors: [ ]
|
||||
message: "Успешно сохранено!"
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/user/get-options:
|
||||
get:
|
||||
tags:
|
||||
- user
|
||||
summary: Получение опций доступа пользователя. Доступно только с ролью user-edit
|
||||
parameters:
|
||||
- name: user_id
|
||||
in: query
|
||||
required: false
|
||||
description: UUID пользователя
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
responses:
|
||||
200:
|
||||
description: Опции пользователя
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
example:
|
||||
success: true
|
||||
data:
|
||||
is_external: false
|
||||
isBlocked: false
|
||||
errors: [ ]
|
||||
message: ""
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/user/set-options:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Установка опций пользователя. Доступно только с ролью user-edit
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
is_external:
|
||||
type: boolean
|
||||
example: false
|
||||
isBlocked:
|
||||
type: boolean
|
||||
example: true
|
||||
responses:
|
||||
200:
|
||||
description: Результат установки опций
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
example:
|
||||
success: true
|
||||
data: { }
|
||||
errors: [ ]
|
||||
message: "Успешно сохранено!"
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/user/reset-sessions:
|
||||
post:
|
||||
tags:
|
||||
- user
|
||||
summary: Сброс сессий пользователя
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
description: Только для админа. По умолчанию текущий пользователь.
|
||||
responses:
|
||||
'200':
|
||||
description: Сессии успешно сброшены
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/httpJsonResponse'
|
||||
example:
|
||||
success: true
|
||||
data: { }
|
||||
errors: [ ]
|
||||
message: "Сессии были успешно сброшены"
|
||||
401:
|
||||
description: Unauthorized request.
|
||||
500:
|
||||
description: Server Error.
|
||||
|
||||
/employment/index:
|
||||
get:
|
||||
tags:
|
||||
@@ -11144,6 +11510,62 @@ components:
|
||||
description: Прикрепляемые файлы
|
||||
maxItems: 10
|
||||
|
||||
mobileConnect:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Идентификатор подключения устройства
|
||||
example: "b5d12b08-3f6b-4e43-8f42-6f4db5a12345"
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Идентификатор пользователя
|
||||
example: "c83b3e5b-90b6-4a7c-bb0a-5a6e8c9f44f2"
|
||||
device_id:
|
||||
type: string
|
||||
description: Уникальный идентификатор устройства
|
||||
example: "2a5f6e7d-8b90-4c12-a345-6789abcdef12"
|
||||
device_model:
|
||||
type: string
|
||||
description: Модель устройства
|
||||
example: "iPhone 15 Pro"
|
||||
device_name:
|
||||
type: string
|
||||
description: Имя устройства
|
||||
example: "Телефон Ивана"
|
||||
device_os:
|
||||
type: string
|
||||
description: Название операционной системы
|
||||
example: "iOS"
|
||||
device_os_version:
|
||||
type: string
|
||||
description: Версия операционной системы
|
||||
example: "17.2"
|
||||
created_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Дата и время регистрации устройства
|
||||
example: "2025-09-15T12:45:00Z"
|
||||
created_at_localized:
|
||||
type: string
|
||||
description: Локализованное значение даты регистрации
|
||||
example: "15 сентября 2025, 15:45"
|
||||
last_login_at:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Дата и время последнего входа
|
||||
example: "2025-10-01T09:30:00Z"
|
||||
last_login_at_localized:
|
||||
type: string
|
||||
description: Локализованное значение даты последнего входа
|
||||
example: "1 октября 2025, 12:30"
|
||||
ip:
|
||||
type: string
|
||||
description: IP-адрес последнего подключения
|
||||
example: "192.168.1.42"
|
||||
|
||||
parameters:
|
||||
boardDateTypeParam:
|
||||
in: query
|
||||
|
||||
Reference in New Issue
Block a user