1262 lines
32 KiB
YAML
1262 lines
32 KiB
YAML
basePath: /api/admin
|
|
definitions:
|
|
apierrors.Error:
|
|
properties:
|
|
details:
|
|
additionalProperties: {}
|
|
type: object
|
|
errorCode:
|
|
type: integer
|
|
errorMessage:
|
|
type: string
|
|
type: object
|
|
conf.UIDesign:
|
|
properties:
|
|
name:
|
|
type: string
|
|
primaryColor:
|
|
type: string
|
|
type: object
|
|
domain.AdminUserShort:
|
|
properties:
|
|
email:
|
|
type: string
|
|
firstName:
|
|
type: string
|
|
idleTimeoutMs:
|
|
type: integer
|
|
lastName:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
role:
|
|
type: string
|
|
roleNames:
|
|
items:
|
|
type: string
|
|
type: array
|
|
roles:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
required:
|
|
- email
|
|
type: object
|
|
domain.Audit:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
userId:
|
|
type: integer
|
|
type: object
|
|
domain.AuditEvent:
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
event:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type: object
|
|
domain.AuditPageRequest:
|
|
properties:
|
|
limit:
|
|
type: integer
|
|
offset:
|
|
format: int64
|
|
type: integer
|
|
order:
|
|
$ref: '#/definitions/domain.OrderParams'
|
|
query:
|
|
$ref: '#/definitions/domain.AuditQuery'
|
|
required:
|
|
- limit
|
|
type: object
|
|
domain.AuditQuery:
|
|
properties:
|
|
createdAt:
|
|
$ref: '#/definitions/domain.DateFromToParams'
|
|
id:
|
|
type: integer
|
|
message:
|
|
type: string
|
|
userId:
|
|
type: integer
|
|
type: object
|
|
domain.AuditResponse:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/definitions/domain.Audit'
|
|
type: array
|
|
totalCount:
|
|
type: integer
|
|
type: object
|
|
domain.ChangePasswordRequest:
|
|
properties:
|
|
newPassword:
|
|
type: string
|
|
oldPassword:
|
|
type: string
|
|
required:
|
|
- newPassword
|
|
- oldPassword
|
|
type: object
|
|
domain.CreateRoleRequest:
|
|
properties:
|
|
changeMessage:
|
|
type: string
|
|
externalGroup:
|
|
type: string
|
|
name:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
type: object
|
|
domain.CreateUserRequest:
|
|
properties:
|
|
description:
|
|
type: string
|
|
email:
|
|
type: string
|
|
firstName:
|
|
type: string
|
|
lastName:
|
|
type: string
|
|
password:
|
|
type: string
|
|
roles:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
required:
|
|
- email
|
|
- password
|
|
type: object
|
|
domain.DateFromToParams:
|
|
properties:
|
|
from:
|
|
type: string
|
|
to:
|
|
type: string
|
|
required:
|
|
- from
|
|
- to
|
|
type: object
|
|
domain.DeleteResponse:
|
|
properties:
|
|
deleted:
|
|
type: integer
|
|
type: object
|
|
domain.DeleteRoleRequest:
|
|
properties:
|
|
id:
|
|
type: integer
|
|
type: object
|
|
domain.GrpcError:
|
|
properties:
|
|
details:
|
|
items: {}
|
|
type: array
|
|
errorCode:
|
|
type: string
|
|
errorMessage:
|
|
type: string
|
|
type: object
|
|
domain.IdRequest:
|
|
properties:
|
|
userId:
|
|
type: integer
|
|
required:
|
|
- userId
|
|
type: object
|
|
domain.IdentitiesRequest:
|
|
properties:
|
|
ids:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
required:
|
|
- ids
|
|
type: object
|
|
domain.LoginRequest:
|
|
properties:
|
|
email:
|
|
type: string
|
|
password:
|
|
type: string
|
|
required:
|
|
- email
|
|
- password
|
|
type: object
|
|
domain.LoginResponse:
|
|
properties:
|
|
expired:
|
|
type: string
|
|
headerName:
|
|
type: string
|
|
token:
|
|
type: string
|
|
type: object
|
|
domain.LoginSudirRequest:
|
|
properties:
|
|
authCode:
|
|
type: string
|
|
required:
|
|
- authCode
|
|
type: object
|
|
domain.LogoutRequest:
|
|
properties:
|
|
reason:
|
|
type: string
|
|
type: object
|
|
domain.OrderParams:
|
|
properties:
|
|
field:
|
|
type: string
|
|
type:
|
|
enum:
|
|
- asc
|
|
- desc
|
|
- ASC
|
|
- DESC
|
|
type: string
|
|
type: object
|
|
domain.Permission:
|
|
properties:
|
|
key:
|
|
type: string
|
|
name:
|
|
type: string
|
|
type: object
|
|
domain.RevokeRequest:
|
|
properties:
|
|
id:
|
|
type: integer
|
|
required:
|
|
- id
|
|
type: object
|
|
domain.Role:
|
|
properties:
|
|
changeMessage:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
exclusive:
|
|
type: boolean
|
|
externalGroup:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
immutable:
|
|
type: boolean
|
|
name:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.SecureAuthRequest:
|
|
properties:
|
|
token:
|
|
type: string
|
|
type: object
|
|
domain.SecureAuthResponse:
|
|
properties:
|
|
adminId:
|
|
format: int64
|
|
type: integer
|
|
authenticated:
|
|
type: boolean
|
|
errorReason:
|
|
type: string
|
|
type: object
|
|
domain.SecureAuthzRequest:
|
|
properties:
|
|
adminId:
|
|
type: integer
|
|
permission:
|
|
type: string
|
|
type: object
|
|
domain.SecureAuthzResponse:
|
|
properties:
|
|
authorized:
|
|
type: boolean
|
|
type: object
|
|
domain.Session:
|
|
properties:
|
|
createdAt:
|
|
type: string
|
|
expiredAt:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
status:
|
|
type: string
|
|
userId:
|
|
type: integer
|
|
type: object
|
|
domain.SessionPageRequest:
|
|
properties:
|
|
limit:
|
|
type: integer
|
|
offset:
|
|
format: int64
|
|
type: integer
|
|
order:
|
|
$ref: '#/definitions/domain.OrderParams'
|
|
query:
|
|
$ref: '#/definitions/domain.SessionQuery'
|
|
required:
|
|
- limit
|
|
type: object
|
|
domain.SessionQuery:
|
|
properties:
|
|
createdAt:
|
|
$ref: '#/definitions/domain.DateFromToParams'
|
|
expiredAt:
|
|
$ref: '#/definitions/domain.DateFromToParams'
|
|
id:
|
|
type: integer
|
|
status:
|
|
type: string
|
|
userId:
|
|
type: integer
|
|
type: object
|
|
domain.SessionResponse:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/definitions/domain.Session'
|
|
type: array
|
|
totalCount:
|
|
type: integer
|
|
type: object
|
|
domain.SetAuditEvent:
|
|
properties:
|
|
enabled:
|
|
type: boolean
|
|
event:
|
|
type: string
|
|
type: object
|
|
domain.UpdateRoleRequest:
|
|
properties:
|
|
changeMessage:
|
|
type: string
|
|
externalGroup:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
name:
|
|
type: string
|
|
permissions:
|
|
items:
|
|
type: string
|
|
type: array
|
|
type: object
|
|
domain.UpdateUserRequest:
|
|
properties:
|
|
blocked:
|
|
type: boolean
|
|
description:
|
|
type: string
|
|
email:
|
|
type: string
|
|
firstName:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
lastName:
|
|
type: string
|
|
roles:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
required:
|
|
- id
|
|
type: object
|
|
domain.User:
|
|
properties:
|
|
blocked:
|
|
type: boolean
|
|
createdAt:
|
|
type: string
|
|
description:
|
|
type: string
|
|
email:
|
|
type: string
|
|
firstName:
|
|
type: string
|
|
id:
|
|
format: int64
|
|
type: integer
|
|
lastName:
|
|
type: string
|
|
lastSessionCreatedAt:
|
|
type: string
|
|
roles:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
updatedAt:
|
|
type: string
|
|
type: object
|
|
domain.UserQuery:
|
|
properties:
|
|
description:
|
|
type: string
|
|
email:
|
|
type: string
|
|
id:
|
|
type: integer
|
|
lastSessionCreatedAt:
|
|
$ref: '#/definitions/domain.DateFromToParams'
|
|
roles:
|
|
items:
|
|
type: integer
|
|
type: array
|
|
userId:
|
|
type: integer
|
|
type: object
|
|
domain.UsersPageRequest:
|
|
properties:
|
|
limit:
|
|
type: integer
|
|
offset:
|
|
format: int64
|
|
type: integer
|
|
order:
|
|
$ref: '#/definitions/domain.OrderParams'
|
|
query:
|
|
$ref: '#/definitions/domain.UserQuery'
|
|
required:
|
|
- limit
|
|
type: object
|
|
domain.UsersResponse:
|
|
properties:
|
|
items:
|
|
items:
|
|
$ref: '#/definitions/domain.User'
|
|
type: array
|
|
type: object
|
|
host: localhost:9000
|
|
info:
|
|
contact: {}
|
|
description: сервис управления администраторами
|
|
license:
|
|
name: GNU GPL v3.0
|
|
title: msp-admin-service
|
|
version: 1.0.0
|
|
paths:
|
|
/auth/login:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Авторизация с получением токена администратора
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"401":
|
|
description: Данные для авторизации не верны
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Авторизация по логину и паролю
|
|
tags:
|
|
- auth
|
|
/auth/login_with_sudir:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Авторизация с получением токена администратора
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginSudirRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.LoginResponse'
|
|
"401":
|
|
description: Некорректный код для авторизации
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"412":
|
|
description: Авторизация СУДИР не настроена на сервере
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Авторизация по авторизационному коду от СУДИР
|
|
tags:
|
|
- auth
|
|
/auth/logout:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Выход из авторизованной сессии администрирования
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидный токен
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Выход из авторизованной сессии
|
|
tags:
|
|
- auth
|
|
/auth/logout_with_reason:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Выход по бездействию из авторизованной сессии администрирования
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.LogoutRequest'
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидный токен
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Выход по бездействию из авторизованной сессии
|
|
tags:
|
|
- auth
|
|
/log/all:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.AuditPageRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.AuditResponse'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получение списка логов
|
|
tags:
|
|
- log
|
|
/log/events:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Возвращает полный список доступных событий аудита
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.AuditResponse'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.AuditEvent'
|
|
type: array
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получение списка логов
|
|
tags:
|
|
- log
|
|
/log/set_events:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Всегда возвращает полный список доступных событий аудита
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.SetAuditEvent'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получение списка логов
|
|
tags:
|
|
- log
|
|
/role/all:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Получить список ролей
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
items:
|
|
$ref: '#/definitions/domain.Role'
|
|
type: array
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Список ролей
|
|
tags:
|
|
- role
|
|
/role/create:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Создать роль
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateRoleRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.User'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"409":
|
|
description: Роль с указанным именем уже существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Создать роль
|
|
tags:
|
|
- user
|
|
/role/delete:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удалить существующую роль
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteRoleRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Удалить роль
|
|
tags:
|
|
- role
|
|
/role/update:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Обновить данные существующую роль
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateRoleRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.Role'
|
|
"404":
|
|
description: Роль с указанным id не существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"409":
|
|
description: Роль с указанным именем уже существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Обновить роль
|
|
tags:
|
|
- role
|
|
/secure/authenticate:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Проверяет токен и возвращает идентификатор администратора
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.SecureAuthRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.SecureAuthResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Метод аутентификации токена
|
|
tags:
|
|
- secure
|
|
/secure/authorize:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Проверяет наличие у администратора необходимого разрешения
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.SecureAuthzRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.SecureAuthzResponse'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Метод авторизации для администратора
|
|
tags:
|
|
- secure
|
|
/session/all:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.SessionPageRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.SessionResponse'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получение списка сессий
|
|
tags:
|
|
- session
|
|
/session/revoke:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.RevokeRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Отзыв сессии
|
|
tags:
|
|
- session
|
|
/user/block_user:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.IdRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Метод блокировки/разблокировки пользователя
|
|
tags:
|
|
- user
|
|
/user/change_password:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.ChangePasswordRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
"500":
|
|
description: внутренняя ошибка
|
|
schema:
|
|
$ref: '#/definitions/apierrors.Error'
|
|
summary: Метод изменения пароля пользователя
|
|
tags:
|
|
- user
|
|
/user/create_user:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Создать пользователя
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.CreateUserRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.User'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"409":
|
|
description: Пользователь с указанным email уже существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Создать пользователя
|
|
tags:
|
|
- user
|
|
/user/delete_user:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Удалить существующего пользователя
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.IdentitiesRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.DeleteResponse'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Удалить пользователя
|
|
tags:
|
|
- user
|
|
/user/get_by_id:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
parameters:
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.IdRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.User'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Метод получения данных по пользователю
|
|
tags:
|
|
- user
|
|
/user/get_design:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Получение внешнего вида (палитра и наименование) админ-интерфейса
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/conf.UIDesign'
|
|
"400":
|
|
description: Невалидный токен
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получение внешнего вида
|
|
tags:
|
|
- user
|
|
/user/get_profile:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Получить данные профиля
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.AdminUserShort'
|
|
"400":
|
|
description: Невалидный токен
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"404":
|
|
description: Пользователя не существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Получить профиль
|
|
tags:
|
|
- user
|
|
/user/get_users:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Получить список пользователей
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UsersPageRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.UsersResponse'
|
|
"400":
|
|
description: Bad Request
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Список пользователей
|
|
tags:
|
|
- user
|
|
/user/update_user:
|
|
post:
|
|
consumes:
|
|
- application/json
|
|
description: Обновить данные существующего пользователя
|
|
parameters:
|
|
- description: Токен администратора
|
|
in: header
|
|
name: X-AUTH-ADMIN
|
|
required: true
|
|
type: string
|
|
- description: Тело запроса
|
|
in: body
|
|
name: body
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/domain.UpdateUserRequest'
|
|
produces:
|
|
- application/json
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
schema:
|
|
$ref: '#/definitions/domain.User'
|
|
"400":
|
|
description: Невалидное тело запроса
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"404":
|
|
description: Пользователь с указанным id не существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"409":
|
|
description: Пользователь с указанным email уже существует
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
"500":
|
|
description: Internal Server Error
|
|
schema:
|
|
$ref: '#/definitions/domain.GrpcError'
|
|
summary: Обновить пользователя
|
|
tags:
|
|
- user
|
|
swagger: "2.0"
|