ruspet_portal_back/service/rest_admin_service/docs/swagger.yaml

2646 lines
79 KiB
YAML
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.

basePath: /
definitions:
handlers.ErrorResponse:
properties:
error_code:
description: Код ошибки
type: integer
error_description:
description: Описание ошибки
type: string
type: object
handlers_user_roles.AssignUserRoleRequest:
properties:
role_id:
type: integer
user_id:
type: integer
type: object
handlers_user_roles.BulkAssignRolesRequest:
properties:
role_ids:
items:
type: integer
type: array
user_id:
type: integer
type: object
typescore.Admin:
properties:
created_at:
description: Дата создания записи
type: string
id:
description: Автоматически заполняемое уникальное поле для большого числа
записей
type: integer
is_blocked:
description: Заблокирован ли администратор
type: boolean
last_ip_login:
description: Последний IP входа
type: string
last_login:
description: Дата входа
type: string
login:
description: Логин администратора
type: string
type: object
typescore.AdminReq:
properties:
login:
type: string
password:
description: Пароль пользователя
type: string
type: object
typescore.ApiResponseBase:
properties:
data:
description: данные полученные от api
total_amount:
type: number
total_count:
type: integer
type: object
typescore.Approval:
properties:
content:
description: введённые пользователем данные по шаблону
type: string
created_at:
type: string
department:
$ref: '#/definitions/typescore.Department'
department_id:
description: снимок отдела на момент создания
type: integer
files:
items:
$ref: '#/definitions/typescore.ApprovalFile'
type: array
id:
type: integer
initiator:
$ref: '#/definitions/typescore.User'
initiator_id:
type: integer
metadata:
type: string
revision_at:
type: string
revision_by_id:
type: integer
revision_comment:
type: string
revision_count:
type: integer
revoked_at:
type: string
revoked_by:
$ref: '#/definitions/typescore.User'
revoked_by_id:
type: integer
status:
type: string
steps:
items:
$ref: '#/definitions/typescore.ApprovalStep'
type: array
topic:
$ref: '#/definitions/typescore.ApprovalTopic'
topic_id:
type: integer
updated_at:
type: string
type: object
typescore.ApprovalFile:
properties:
approval_id:
type: integer
attached_by_id:
type: integer
created_at:
type: string
file_base64:
type: string
file_name:
type: string
id:
type: integer
task_id:
type: integer
type: object
typescore.ApprovalStep:
properties:
acted_at:
type: string
approval:
$ref: '#/definitions/typescore.Approval'
approval_id:
type: integer
approver:
$ref: '#/definitions/typescore.User'
approver_department_snapshot:
type: string
approver_id:
type: integer
approver_name_snapshot:
type: string
comment:
type: string
created_at:
type: string
id:
type: integer
returned_at:
type: string
status:
type: string
step_order:
type: integer
updated_at:
type: string
type: object
typescore.ApprovalTopic:
properties:
allow_approver_selection:
type: boolean
allow_observer_selection:
type: boolean
allows_file:
type: boolean
approvalMode:
type: string
category:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
category_id:
type: integer
code:
type: string
created_at:
type: string
duration_type:
type: string
first_approver_role_code:
description: если задан — первый согласующий выбирается из этой роли
type: string
id:
type: integer
instructions:
type: string
is_active:
type: boolean
name:
type: string
payment_type:
type: string
require_approver_comment:
type: boolean
require_observer_selection:
type: boolean
requires_file:
type: boolean
template:
type: string
time_type:
type: string
updated_at:
type: string
type: object
typescore.ApprovalTopicCategory:
properties:
code:
description: otgul, vacation, sick_leave
type: string
created_at:
type: string
description:
type: string
id:
type: integer
is_active:
type: boolean
name:
type: string
topics:
items:
$ref: '#/definitions/typescore.ApprovalTopic'
type: array
updated_at:
type: string
type: object
typescore.ApprovalTopicExecutor:
properties:
created_at:
type: string
id:
type: integer
is_active:
type: boolean
require_file:
type: boolean
step_order:
type: integer
target_system:
type: string
task_text:
type: string
topic:
$ref: '#/definitions/typescore.ApprovalTopic'
topic_id:
type: integer
updated_at:
type: string
user:
$ref: '#/definitions/typescore.User'
user_id:
type: integer
type: object
typescore.AuthHandlerResponse:
properties:
temp_session:
description: Временный токен для 2FA
type: string
token:
description: токен аутентификации
type: string
type: object
typescore.AuthReqAccount:
properties:
access_code:
type: string
login:
type: string
password:
type: string
redirect_uri:
type: string
token:
type: string
type: object
typescore.Department:
properties:
code:
description: finance, hr, it
type: string
created_at:
type: string
description:
type: string
id:
type: integer
is_active:
type: boolean
name:
type: string
updated_at:
type: string
type: object
typescore.Permission:
properties:
action:
type: string
created_at:
type: string
id:
type: integer
role:
$ref: '#/definitions/typescore.Role'
role_id:
type: integer
topic:
$ref: '#/definitions/typescore.ApprovalTopic'
topic_category:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
topic_category_id:
type: integer
topic_id:
type: integer
updated_at:
type: string
type: object
typescore.Role:
properties:
code:
type: string
created_at:
type: string
description:
type: string
id:
type: integer
is_approver:
type: boolean
is_default:
type: boolean
is_director:
type: boolean
is_executor:
type: boolean
is_observer:
type: boolean
name:
type: string
permissions:
items:
$ref: '#/definitions/typescore.Permission'
type: array
updated_at:
type: string
type: object
typescore.UpdateUserReqAdmin:
properties:
department_id:
description: Логин пользователя
type: integer
id:
type: integer
is_blocked:
description: Заблокирован ли пользователь
type: boolean
is_fired:
description: Заблокирован ли пользователь
type: boolean
type: object
typescore.User:
properties:
blocked_at:
type: string
created_at:
type: string
department:
$ref: '#/definitions/typescore.Department'
department_id:
type: integer
full_name:
type: string
id:
type: integer
is_blocked:
type: boolean
is_fired:
type: boolean
language_code:
description: |-
FirstName *string `gorm:"type:text;not null;column:first_name" json:"first_name" db:"first_name" mapstructure:"first_name"`
LastName *string `gorm:"type:text;not null;column:last_name" json:"last_name" db:"last_name" mapstructure:"last_name"`
Patronymic *string `gorm:"type:text;column:patronymic" json:"patronymic,omitempty" db:"patronymic" mapstructure:"patronymic"`
type: string
last_login:
type: string
telegram_id:
type: integer
updated_at:
type: string
user_roles:
items:
$ref: '#/definitions/typescore.UserRole'
type: array
username:
type: string
type: object
typescore.UserHierarchy:
properties:
approver:
$ref: '#/definitions/typescore.User'
approver_id:
type: integer
created_at:
type: string
department:
$ref: '#/definitions/typescore.Department'
department_id:
type: integer
id:
type: integer
priority:
type: integer
subordinate:
$ref: '#/definitions/typescore.User'
subordinate_id:
type: integer
topic_category_id:
type: integer
topic_id:
type: integer
updated_at:
type: string
type: object
typescore.UserRole:
properties:
created_at:
type: string
id:
description: Автоматически заполняемое уникальное поле для большого числа
записей
type: integer
role:
allOf:
- $ref: '#/definitions/typescore.Role'
description: ← добавить gorm:"-"
role_id:
type: integer
updated_at:
type: string
user:
allOf:
- $ref: '#/definitions/typescore.User'
description: ← добавить gorm:"-"
user_id:
type: integer
type: object
host: localhost:8080
info:
contact: {}
description: |-
API админ-панели для системы согласований
## Возможности
- Управление отделами, ролями и пользователями
- Настройка тем и категорий согласований
- Управление иерархией согласований
- Назначение исполнителей и прав
- Просмотр заявок и шагов согласования
## Аутентификация
Все защищённые эндпоинты требуют:
- `Authorization: Bearer <JWT_TOKEN>` — JWT токен администратора
- `ApiKey: <HMAC_SIGNATURE>` — HMAC подпись для верификации клиента
- `X-Timestamp: <UNIX_TIMESTAMP>` — Unix timestamp (не старше 3 минут)
- `x-device-id: <DEVICE_ID>` — ID устройства
title: RusPet Admin API
version: "0.1"
paths:
/api/admin:
delete:
consumes:
- application/json
description: Удаление администратора
parameters:
- description: Запрос
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.AdminReq'
produces:
- application/json
responses:
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление администратора
tags:
- admin
get:
consumes:
- application/json
description: Получение списка администраторов
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по активности
in: query
name: is_active
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Admin'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка администраторов
tags:
- admin
post:
consumes:
- application/json
description: Создание администратора
parameters:
- description: Запрос
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.AdminReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/typescore.Admin'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание администратора
tags:
- admin
/api/admin/profile:
get:
consumes:
- application/json
description: Получение профиля пользователя
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/typescore.Admin'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение профиля пользователя
tags:
- profile
put:
consumes:
- application/json
description: Обновление профиля пользователя
parameters:
- description: Запрос
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.AdminReq'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/typescore.Admin'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление профиля пользователя
tags:
- profile
/api/approval-steps:
delete:
consumes:
- application/json
description: Удаление шага согласования (только для заявок в статусе pending)
parameters:
- description: ID шага для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalStep'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"403":
description: Нельзя удалить шаг завершённой заявки
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Шаг не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление шага
tags:
- approval-steps
get:
consumes:
- application/json
description: Получение списка шагов согласования с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по заявке
in: query
name: approval_id
type: integer
- description: Фильтр по согласующему
in: query
name: approver_id
type: integer
- description: Фильтр по статусу (pending, waiting, approved, rejected, cancelled_any_of)
in: query
name: status
type: string
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка шагов
tags:
- approval-steps
post:
consumes:
- application/json
description: Создание нового шага согласования для заявки
parameters:
- description: Данные шага
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalStep'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalStep'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Заявка или согласующий не найдены
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание шага
tags:
- approval-steps
put:
consumes:
- application/json
description: Обновление данных шага согласования (статус, комментарий)
parameters:
- description: Данные шага
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalStep'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalStep'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Шаг не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление шага
tags:
- approval-steps
/api/approval-steps/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о шаге согласования по его ID
parameters:
- description: ID шага
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalStep'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Шаг не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение шага по ID
tags:
- approval-steps
/api/approval-steps/by-approval/{approval_id}:
get:
consumes:
- application/json
description: Получение списка всех шагов согласования для указанной заявки,
отсортированных по step_order
parameters:
- description: ID заявки
in: path
name: approval_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Заявка не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение шагов по заявке
tags:
- approval-steps
/api/approvals:
delete:
consumes:
- application/json
description: Удаление заявки (только для черновиков)
parameters:
- description: ID заявки для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Approval'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"403":
description: Нельзя удалить не-черновую заявку
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Заявка не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление заявки
tags:
- approvals
get:
consumes:
- application/json
description: Получение списка заявок с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по статусу (pending, approved, rejected, revoked, revision)
in: query
name: status
type: string
- description: Фильтр по инициатору
in: query
name: initiator_id
type: integer
- description: Фильтр по теме
in: query
name: topic_id
type: integer
- description: Фильтр по отделу
in: query
name: department_id
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка заявок
tags:
- approvals
put:
consumes:
- application/json
description: Обновление данных заявки (статус, комментарии и т.д.)
parameters:
- description: Данные заявки
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Approval'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Approval'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Заявка не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление заявки
tags:
- approvals
/api/approvals/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о заявке по её ID со всеми связанными
данными
parameters:
- description: ID заявки
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Approval'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Заявка не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение заявки по ID
tags:
- approvals
/api/approvals/report:
get:
consumes:
- application/json
description: Получение списка заявок для отчёта с учётом периода и доступа пользователя
parameters:
- description: ID пользователя (если не указан - все заявки)
in: query
name: user_id
type: integer
- description: Начальная дата (YYYY-MM-DD)
in: query
name: date_from
type: string
- description: Конечная дата (YYYY-MM-DD)
in: query
name: date_to
type: string
- description: Полный доступ (игнорировать фильтрацию по пользователю)
in: query
name: all_access
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение заявок для отчёта
tags:
- approvals
/api/auth/login:
post:
consumes:
- application/json
description: авторизация с помощью связки логин-пароль
parameters:
- description: Запрос
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.AuthReqAccount'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/typescore.AuthHandlerResponse'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: авторизация с помощью связки логин-пароль
tags:
- auth
/api/auth/token:
post:
consumes:
- application/json
description: Авторизация при помощи JWT-токена
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/typescore.AuthHandlerResponse'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Авторизация при помощи JWT-токена
tags:
- auth
/api/categories:
delete:
consumes:
- application/json
description: Удаление категории по ID
parameters:
- description: ID категории для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Категория не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Категория содержит темы
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление категории
tags:
- categories
get:
consumes:
- application/json
description: Получение списка категорий тем с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по активности
in: query
name: is_active
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка категорий тем
tags:
- categories
post:
consumes:
- application/json
description: Создание новой категории тем
parameters:
- description: Данные категории
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание категории тем
tags:
- categories
put:
consumes:
- application/json
description: Обновление данных существующей категории
parameters:
- description: Данные категории
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Категория не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление категории
tags:
- categories
/api/categories/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о категории по её ID
parameters:
- description: ID категории
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicCategory'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Категория не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение категории по ID
tags:
- categories
/api/departments:
delete:
consumes:
- application/json
description: Удаление отдела по ID
parameters:
- description: ID отдела для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Department'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Отдел не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление отдела
tags:
- departments
get:
consumes:
- application/json
description: Получение списка отделов с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по активности
in: query
name: is_active
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка отделов
tags:
- departments
post:
consumes:
- application/json
description: Создание нового отдела
parameters:
- description: Данные отдела
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Department'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Department'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание отдела
tags:
- departments
put:
consumes:
- application/json
description: Обновление данных существующего отдела
parameters:
- description: Данные отдела
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Department'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Department'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Отдел не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление отдела
tags:
- departments
/api/departments/{id}:
get:
consumes:
- application/json
description: Получение детальной информации об отделе по его ID
parameters:
- description: ID отдела
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Department'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Отдел не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение отдела по ID
tags:
- departments
/api/hierarchies:
delete:
consumes:
- application/json
description: Удаление связи подчинённый-согласующий по ID
parameters:
- description: ID записи для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.UserHierarchy'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Запись не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление записи иерархии
tags:
- hierarchies
get:
consumes:
- application/json
description: Получение списка связей подчинённый-согласующий с пагинацией и
фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по подчинённому
in: query
name: subordinate_id
type: integer
- description: Фильтр по согласующему
in: query
name: approver_id
type: integer
- description: Фильтр по отделу
in: query
name: department_id
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка записей иерархии
tags:
- hierarchies
post:
consumes:
- application/json
description: Создание новой связи подчинённый-согласующий
parameters:
- description: Данные иерархии
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.UserHierarchy'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.UserHierarchy'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Такая связь уже существует
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание записи иерархии
tags:
- hierarchies
put:
consumes:
- application/json
description: Обновление данных существующей записи иерархии
parameters:
- description: Данные иерархии
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.UserHierarchy'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.UserHierarchy'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Запись не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление записи иерархии
tags:
- hierarchies
/api/hierarchies/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о записи иерархии по её ID
parameters:
- description: ID записи
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.UserHierarchy'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Запись не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение записи иерархии по ID
tags:
- hierarchies
/api/permissions:
delete:
consumes:
- application/json
description: Удаление права по ID
parameters:
- description: ID права для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Permission'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Право не найдено
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление права
tags:
- permissions
get:
consumes:
- application/json
description: Получение списка прав ролей с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по роли
in: query
name: role_id
type: integer
- description: Фильтр по действию (create, read, update, delete, approve, revoke)
in: query
name: action
type: string
- description: Фильтр по категории тем
in: query
name: topic_category_id
type: integer
- description: Фильтр по теме
in: query
name: topic_id
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка прав
tags:
- permissions
post:
consumes:
- application/json
description: Назначение права на действие для роли
parameters:
- description: Данные права
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Permission'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Permission'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Роль, категория или тема не найдены
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Такое право уже существует
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание права
tags:
- permissions
put:
consumes:
- application/json
description: Обновление данных существующего права
parameters:
- description: Данные права
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Permission'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Permission'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Право не найдено
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление права
tags:
- permissions
/api/permissions/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о праве по его ID
parameters:
- description: ID права
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Permission'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Право не найдено
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение права по ID
tags:
- permissions
/api/permissions/by-role/{role_id}:
get:
consumes:
- application/json
description: Получение списка всех прав для указанной роли
parameters:
- description: ID роли
in: path
name: role_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Роль не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение прав по роли
tags:
- permissions
/api/roles:
delete:
consumes:
- application/json
description: Удаление роли по ID
parameters:
- description: ID роли для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Role'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Роль не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление роли
tags:
- roles
get:
consumes:
- application/json
description: Получение списка ролей с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка ролей
tags:
- roles
post:
consumes:
- application/json
description: Создание новой роли
parameters:
- description: Данные роли
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Role'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Role'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание роли
tags:
- roles
put:
consumes:
- application/json
description: Обновление данных существующей роли
parameters:
- description: Данные роли
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.Role'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Role'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Роль не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление роли
tags:
- roles
/api/roles/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о роли по её ID
parameters:
- description: ID роли
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.Role'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Роль не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение роли по ID
tags:
- roles
/api/topic-executors:
delete:
consumes:
- application/json
description: Удаление исполнителя из темы по ID
parameters:
- description: ID записи для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Запись не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление исполнителя
tags:
- topic-executors
get:
consumes:
- application/json
description: Получение списка исполнителей с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по теме
in: query
name: topic_id
type: integer
- description: Фильтр по пользователю
in: query
name: user_id
type: integer
- description: Фильтр по активности
in: query
name: is_active
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка исполнителей тем
tags:
- topic-executors
post:
consumes:
- application/json
description: Назначение исполнителя для конкретной темы согласования
parameters:
- description: Данные исполнителя
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Тема или пользователь не найдены
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Такой исполнитель уже назначен на этот шаг
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание исполнителя
tags:
- topic-executors
put:
consumes:
- application/json
description: Обновление данных исполнителя для темы
parameters:
- description: Данные исполнителя
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Исполнитель не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление исполнителя
tags:
- topic-executors
/api/topic-executors/{id}:
get:
consumes:
- application/json
description: Получение детальной информации об исполнителе по его ID
parameters:
- description: ID исполнителя
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopicExecutor'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Исполнитель не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение исполнителя по ID
tags:
- topic-executors
/api/topic-executors/by-topic/{topic_id}:
get:
consumes:
- application/json
description: Получение списка всех активных исполнителей для указанной темы,
отсортированных по step_order
parameters:
- description: ID темы
in: path
name: topic_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Тема не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение исполнителей по теме
tags:
- topic-executors
/api/topics:
delete:
consumes:
- application/json
description: Удаление темы по ID
parameters:
- description: ID темы для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Тема не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Тема содержит заявки
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление темы
tags:
- topics
get:
consumes:
- application/json
description: Получение списка тем с пагинацией и фильтрацией
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по категории
in: query
name: category_id
type: integer
- description: Фильтр по активности
in: query
name: is_active
type: boolean
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка тем
tags:
- topics
post:
consumes:
- application/json
description: Создание новой темы согласования
parameters:
- description: Данные темы
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Создание темы
tags:
- topics
put:
consumes:
- application/json
description: Обновление данных существующей темы
parameters:
- description: Данные темы
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Тема не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление темы
tags:
- topics
/api/topics/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о теме по её ID
parameters:
- description: ID темы
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApprovalTopic'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Тема не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение темы по ID
tags:
- topics
/api/user-roles:
delete:
consumes:
- application/json
description: Удаление связи user_id + role_id по ID записи
parameters:
- description: ID записи для удаления
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.UserRole'
produces:
- application/json
responses:
"200":
description: Успех
schema:
type: boolean
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Запись не найдена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Удаление роли у пользователя
tags:
- user-roles
get:
consumes:
- application/json
description: Получение списка ролей, назначенных конкретному пользователю
parameters:
- description: ID пользователя
in: query
name: user_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка ролей пользователя
tags:
- user-roles
post:
consumes:
- application/json
description: Назначение роли пользователю (создание связи user_id + role_id)
parameters:
- description: user_id и role_id
in: body
name: request
required: true
schema:
$ref: '#/definitions/handlers_user_roles.AssignUserRoleRequest'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.UserRole'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Пользователь или роль не найдены
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"409":
description: Роль уже назначена
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Назначение роли пользователю
tags:
- user-roles
/api/user-roles/bulk:
post:
consumes:
- application/json
description: 'Полная замена ролей пользователя: удаляет все текущие роли и назначает
новые'
parameters:
- description: user_id и список role_ids
in: body
name: request
required: true
schema:
$ref: '#/definitions/handlers_user_roles.BulkAssignRolesRequest'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Пользователь не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Массовое назначение ролей
tags:
- user-roles
/api/users:
get:
consumes:
- application/json
description: Получение списка пользователей с пагинацией, фильтрацией и подгрузкой
связанных данных
parameters:
- description: Смещение для пагинации
in: query
name: offset
type: integer
- description: Количество записей на странице
in: query
name: limit
type: integer
- description: Фильтр по блокировке
in: query
name: is_blocked
type: boolean
- description: Фильтр по увольнению
in: query
name: is_fired
type: boolean
- description: Фильтр по отделу
in: query
name: department_id
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка пользователей
tags:
- users
put:
consumes:
- application/json
description: Обновление данных существующего пользователя
parameters:
- description: Данные пользователя
in: body
name: request
required: true
schema:
$ref: '#/definitions/typescore.UpdateUserReqAdmin'
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.User'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Пользователь не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Обновление пользователя
tags:
- users
/api/users/{id}:
get:
consumes:
- application/json
description: Получение детальной информации о пользователе по его ID с подгрузкой
связанных данных
parameters:
- description: ID пользователя
in: path
name: id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.User'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Пользователь не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение пользователя по ID
tags:
- users
/api/users/{user_id}/roles:
get:
consumes:
- application/json
description: Получение списка ролей, назначенных пользователю с указанным ID
parameters:
- description: ID пользователя
in: path
name: user_id
required: true
type: integer
produces:
- application/json
responses:
"200":
description: Успех
schema:
$ref: '#/definitions/typescore.ApiResponseBase'
"400":
description: Некорректный запрос
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Пользователь не найден
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Ошибка сервера
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Получение списка ролей пользователя по ID
tags:
- user-roles
securityDefinitions:
ApiKeyAuth:
in: header
name: ApiKey
type: apiKey
BearerAuth:
in: header
name: Authorization
type: apiKey
DeviceID:
in: header
name: x-device-id
type: apiKey
Timestamp:
in: header
name: X-Timestamp
type: apiKey
swagger: "2.0"