APIv2 User Status

This commit is contained in:
ruslan
2023-10-19 14:04:48 +03:00
parent 2132e2508a
commit 3384a92c42
+274 -95
View File
@@ -45,6 +45,8 @@ tags:
description: Methods for working with postcards
- name: dashboard
description: Methods for getting dashboards and widgets data
- name: user-status
description: Methods for getting user statuses data
paths:
/mobile/bind/{id}/{token}:
@@ -560,7 +562,7 @@ paths:
type: object
properties:
_meta:
$ref: '#/components/schemas/meta'
$ref: '#/components/schemas/_meta'
data:
type: array
items:
@@ -773,7 +775,7 @@ paths:
type: object
properties:
_meta:
$ref: '#/components/schemas/meta'
$ref: '#/components/schemas/_meta'
data:
type: array
items:
@@ -1511,26 +1513,6 @@ paths:
500:
description: Server Error.
# /idea/settings:
# get:
# tags:
# - idea
# summary: Idea module settings.
# operationId: /idea/settings
# responses:
# 200:
# description: Idea settings object.
# content:
# application/json:
# schema:
# $ref: '#/components/schemas/ideaSettings'
# 401:
# description: Unauthorized request.
# 403:
# description: Unauthorized request.
# 500:
# description: Server Error.
/idea/statuses:
get:
tags:
@@ -1583,35 +1565,30 @@ paths:
description: Дата создания идеи.
schema:
type: string
required: false
example: 2023-01-01|2023-01-01
- name: created_user_id
in: query
description: Идентификатор пользователя. Можно передать несколько идентификаторов разделенные запятой.
schema:
type: string
required: false
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
- name: idea_status_id
in: query
description: Статус идеи. Можно передать несколько идентификаторов разделенные запятой.
schema:
type: string
required: false
example: 1
- name: idea_purpose_id
in: query
description: Направление идеи. Можно передать несколько идентификаторов разделенные запятой.
schema:
type: string
required: false
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
- name: performer_id
in: query
description: Исполнитель идеи. Можно передать несколько идентификаторов разделенные запятой.
schema:
type: string
required: false
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
responses:
200:
@@ -1643,7 +1620,7 @@ paths:
description: Idea ID.
schema:
type: string
required: false
required: true
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
responses:
200:
@@ -1668,7 +1645,7 @@ paths:
tags:
- idea
summary: Idea edit.
operationId: idea/edit
operationId: /idea/edit
parameters:
- name: id
in: query
@@ -1706,7 +1683,7 @@ paths:
tags:
- idea
summary: Vote for idea.
operationId: idea/vote
operationId: /idea/vote
parameters:
- name: id
in: query
@@ -1750,7 +1727,7 @@ paths:
tags:
- idea
summary: Participate an idea.
operationId: idea/participate
operationId: /idea/participate
parameters:
- name: id
in: query
@@ -1789,6 +1766,128 @@ paths:
500:
description: Server Error.
/user-status/index:
get:
tags:
- user-status
summary: User status index.
operationId: /user-status/index
parameters:
- name: name
in: query
description: Название статуса (like).
schema:
type: string
example: В отпуске
- name: slug
in: query
description: Уникальный именуемый идентификатор статуса (equals).
schema:
type: string
example: vacation
- name: is_custom
in: query
description: Статус создан администратором.
schema:
type: boolean
example: 1
- name: is_editable
in: query
description: Возможность редактирования статуса.
schema:
type: boolean
example: 1
- name: is_expire
in: query
description: Статус со сроком действия.
schema:
type: boolean
example: 1
- name: display_in_modal
in: query
description: Запрашивать статус в модальном окне запроса статуса.
schema:
type: boolean
example: 1
responses:
200:
description: Returns pagination and array of user status objects.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/userStatus'
_meta:
$ref: '#/components/schemas/_meta'
400:
description: Bad Request.
401:
description: Unauthorized request.
500:
description: Server Error.
/user-status/view:
get:
tags:
- user-status
summary: User status view.
operationId: /user-status/view
parameters:
- name: id
in: query
description: User status ID.
schema:
type: string
required: true
example: b726280a-2be6-4e62-ab24-1736389c6474
responses:
200:
description: User status detailed object.
content:
application/json:
schema:
$ref: '#/components/schemas/userStatus'
400:
description: Bad Request.
401:
description: Unauthorized request.
404:
description: Page not found.
500:
description: Server Error.
/user-status/set:
post:
tags:
- user-status
summary: Set user statuses.
operationId: /user-status/set
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/userStatusSetRequestBody'
responses:
200:
description: Result as boolean value.
content:
application/json:
schema:
type: boolean
400:
description: Bad Request.
401:
description: Unauthorized request.
500:
description: Server Error.
components:
schemas:
arrayOfIds:
@@ -1847,8 +1946,10 @@ components:
modules:
type: object
properties:
userStatus:
$ref: '#/components/schemas/tenantInfoModuleUserStatus'
idea:
$ref: '#/components/schemas/ideaSettings'
$ref: '#/components/schemas/tenantInfoModuleIdea'
xml:
name: tenantInfo
@@ -2271,25 +2372,25 @@ components:
name:
type: string
meta:
_meta:
type: object
properties:
totalCount:
type: integer
default: 0
description: Total items count in database
type: integer
example: 1
pageCount:
type: integer
default: 1
description: How much pages there are with current perPage value
currentPage:
type: integer
default: 1
currentPage:
description: Current page number
type: integer
default: 1
perPage:
description: How much items per page
type: integer
default: 10
description: How much items per page
contact:
type: object
@@ -2708,7 +2809,7 @@ components:
type: string
enum:
- USER_AVATAR
# - USER_CABINET
# - USER_CABINET
- USER_POSTCARD
- COMMENT
- IDEA
@@ -2749,11 +2850,11 @@ components:
type: integer
example: 10
# USER_CABINET
# - properties:
# cabinet:
# description: User cabinet field.
# type: string
# example: 1a
# - properties:
# cabinet:
# description: User cabinet field.
# type: string
# example: 1a
# USER_POSTCARD
- properties:
text:
@@ -3110,54 +3211,54 @@ components:
type: integer
example: 10
# USER_CABINET
# - properties:
# city_id:
# description: Field "City".
# type: object
# properties:
# type:
# description: Field value type.
# type: string
# enum:
# - string
# - img
# - files
# - html
# example: string
# label:
# description: Field label.
# type: string
# example: City
# value:
# description: Field value.
# type: string
# default: null
# url:
# type: string
# cabinet:
# description: Field "Cabinet".
# type: object
# properties:
# type:
# description: Field value type.
# type: string
# enum:
# - string
# - img
# - files
# - html
# example: string
# label:
# description: Field label.
# type: string
# example: Cabinet
# value:
# description: Field value.
# type: string
# default: null
# example: 1a
# url:
# type: string
# - properties:
# city_id:
# description: Field "City".
# type: object
# properties:
# type:
# description: Field value type.
# type: string
# enum:
# - string
# - img
# - files
# - html
# example: string
# label:
# description: Field label.
# type: string
# example: City
# value:
# description: Field value.
# type: string
# default: null
# url:
# type: string
# cabinet:
# description: Field "Cabinet".
# type: object
# properties:
# type:
# description: Field value type.
# type: string
# enum:
# - string
# - img
# - files
# - html
# example: string
# label:
# description: Field label.
# type: string
# example: Cabinet
# value:
# description: Field value.
# type: string
# default: null
# example: 1a
# url:
# type: string
# USER_POSTCARD
- properties:
text:
@@ -3609,8 +3710,8 @@ components:
description: Moderated user name.
type: string
ideaSettings:
description: Список настроек модуля идей.
tenantInfoModuleIdea:
description: Настройки модуля идей.
type: object
properties:
isModuleEnabled:
@@ -4034,3 +4135,81 @@ components:
example:
- '53f2d03c-303a-4a3c-b57f-f7fb62fee538'
- '42862a16-affa-4ba5-86c5-61376f46d695'
tenantInfoModuleUserStatus:
description: Настройки модуля статусов пользователей.
type: object
properties:
isUserStatusEnabled:
description: Модуль статусов пользователей вкл/выкл.
type: boolean
example: true
default: true
checkUserStatus:
description: Спрашивать статус пользователя.
type: boolean
example: true
default: false
modalHeaderText:
description: Текст заголовка модального окна.
type: string
default: Где вы сегодня работаете?
modalBodyText:
description: Текст описания в модальном окне.
type: string
default: Друзья, в текущей ситуации нам особенно важно знать, что с вами все в порядке. Поэтому просим вас каждое утро обновлять свой статус, чтобы мы понимали, где вы работаете.
userStatus:
type: object
properties:
id:
description: Идентификатор статуса.
type: string
format: uuid
example: b726280a-2be6-4e62-ab24-1736389c6474
name:
description: Название статуса.
type: string
example: В отпуске
slug:
description: Уникальный именуемый идентификатор статуса.
type: string
example: vacation
is_custom:
description: Статус создан администратором.
type: boolean
example: false
is_editable:
description: Возможность редактирования статуса.
type: boolean
example: false
is_expire:
description: Статус со сроком действия.
type: boolean
example: false
display_in_modal:
description: Запрашивать статус в модальном окне запроса статуса.
type: boolean
example: false
labelColorHEX:
description: Цвет статуса в HEX кодировке.
type: string
example: '#D90000'
userStatusSetRequestBody:
type: object
properties:
id:
description: Идентификатор статуса.
type: string
format: uuid
example: b726280a-2be6-4e62-ab24-1736389c6474
is_enabled:
description: Состояние статуса.
type: boolean
example: true
expire_at:
description: Срок действия статуса. Обязателен для установки статусов у которых включен срок действия.
type: string
format: 'date'
example: 2024-01-01