MSP-1756 update swagger

This commit is contained in:
riabovvo committed 2023-05-23 20:32:04 +03:00
1 parent da3ae21766
commit c25d6e3d3b
3 files changed
+256 -86

No files matched your search

+218 -40
View File
@@ -15,8 +15,16 @@ definitions:
type: string
lastName:
type: string
permissions:
items:
type: string
type: array
role:
type: string
roles:
items:
type: integer
type: array
required:
- email
type: object
@@ -40,8 +48,23 @@ definitions:
totalCount:
type: integer
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:
@@ -50,8 +73,10 @@ definitions:
type: string
password:
type: string
roleId:
type: integer
roles:
items:
type: integer
type: array
required:
- email
- password
@@ -61,6 +86,11 @@ definitions:
deleted:
type: integer
type: object
domain.DeleteRoleRequest:
properties:
id:
type: integer
type: object
domain.GrpcError:
properties:
details:
@@ -123,6 +153,13 @@ definitions:
required:
- limit
type: object
domain.Permission:
properties:
key:
type: string
name:
type: string
type: object
domain.RevokeRequest:
properties:
id:
@@ -132,14 +169,20 @@ definitions:
type: object
domain.Role:
properties:
changeMessage:
type: string
createdAt:
type: string
description:
externalGroup:
type: string
id:
type: integer
name:
type: string
permissions:
items:
type: string
type: array
updatedAt:
type: string
type: object
@@ -164,8 +207,27 @@ definitions:
offset:
type: integer
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:
@@ -174,10 +236,10 @@ definitions:
type: integer
lastName:
type: string
password:
type: string
roleId:
type: integer
roles:
items:
type: integer
type: array
required:
- id
type: object
@@ -187,6 +249,8 @@ definitions:
type: boolean
createdAt:
type: string
description:
type: string
email:
type: string
firstName:
@@ -195,10 +259,12 @@ definitions:
type: integer
lastName:
type: string
roleId:
type: integer
roleName:
lastSessionCreatedAt:
type: string
roles:
items:
type: integer
type: array
updatedAt:
type: string
type: object
@@ -360,6 +426,148 @@ paths:
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: ""
"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:
@@ -654,36 +862,6 @@ paths:
summary: Получить профиль
tags:
- user
/user/get_roles:
post:
consumes:
- application/json
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:
- user
/user/get_users:
post:
consumes: