APIv2 Comment

This commit is contained in:
ruslan
2023-11-15 16:35:54 +02:00
parent ec4c5ca7de
commit c9cf6050b5
+472 -106
View File
@@ -47,6 +47,8 @@ tags:
description: Methods for getting dashboards and widgets data description: Methods for getting dashboards and widgets data
- name: user-status - name: user-status
description: Methods for getting user statuses data description: Methods for getting user statuses data
- name: comment
description: Methods for working with comments
paths: paths:
/mobile/bind/{id}/{token}: /mobile/bind/{id}/{token}:
@@ -1596,7 +1598,16 @@ paths:
content: content:
application/json: application/json:
schema: schema:
$ref: '#/components/schemas/ideaIndex' type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/ideaIndex'
_links:
$ref: '#/components/schemas/_links'
_meta:
$ref: '#/components/schemas/_meta'
400: 400:
description: Bad Request. description: Bad Request.
401: 401:
@@ -1604,7 +1615,7 @@ paths:
403: 403:
description: Unauthorized request. description: Unauthorized request.
404: 404:
description: Feedback not found. description: Not found.
500: 500:
description: Server Error. description: Server Error.
@@ -1856,7 +1867,7 @@ paths:
401: 401:
description: Unauthorized request. description: Unauthorized request.
404: 404:
description: Page not found. description: Not found.
500: 500:
description: Server Error. description: Server Error.
@@ -1888,8 +1899,205 @@ paths:
500: 500:
description: Server Error. description: Server Error.
/comment/statuses:
get:
tags:
- comment
summary: Comment statuses list. Role permissions are not required.
operationId: /comment/statuses
responses:
200:
description: Comment statuses object.
content:
application/json:
schema:
$ref: '#/components/schemas/commentStatuses'
401:
description: Unauthorized request.
403:
description: Unauthorized request.
500:
description: Server Error.
/comment/index:
get:
tags:
- comment
summary: Comment index. Access allowed with "Moderate comments" (content-moderate-comments) role permission.
operationId: /comment/index
parameters:
- name: created_at
in: query
description: Comment creation date range.
schema:
type: string
example: 2023-01-01|2023-01-01
- name: entity_id
in: query
description: Entity ID. You can pass multiple identifiers separated by commas.
schema:
type: string
example: 1
- name: reference_id
in: query
description: Reference ID. You can pass multiple identifiers separated by commas.
schema:
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
- name: user_id
in: query
description: User ID. You can pass multiple identifiers separated by commas.
schema:
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
- name: status_id
in: query
description: Comment status ID. You can pass multiple identifiers separated by commas.
schema:
type: string
example: 1
responses:
200:
description: Returns pagination and array of comment objects.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/commentIndex'
_links:
$ref: '#/components/schemas/_links'
_meta:
$ref: '#/components/schemas/_meta'
400:
description: Bad Request.
401:
description: Unauthorized request.
500:
description: Server Error.
/comment/view:
get:
tags:
- comment
summary: Comment view in the "Published" status (STATUS_APPROVED). Access allowed with "See comments" (show-content-comments) role permission.
operationId: /comment/view
parameters:
- name: id
in: query
description: Comment ID.
schema:
type: string
format: uuid
required: true
example: b726280a-2be6-4e62-ab24-1736389c6474
responses:
200:
description: Comment object.
content:
application/json:
schema:
$ref: '#/components/schemas/commentView'
400:
description: Bad Request.
401:
description: Unauthorized request.
404:
description: Not found.
500:
description: Server Error.
/comment/get:
get:
tags:
- comment
summary: Retrieving a list of top-level comments with replies in the "Published" status (STATUS_APPROVED) and sorted by creation date without pagination. Access allowed with "See comments" (show-content-comments) role permission.
operationId: /comment/get
parameters:
- name: entity_id
in: query
description: Entity ID.
schema:
type: string
example: 1
- name: reference_id
in: query
description: Reference ID.
schema:
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
responses:
200:
description: Comment object.
content:
application/json:
schema:
$ref: '#/components/schemas/commentGet'
400:
description: Bad Request.
401:
description: Unauthorized request.
404:
description: Not found.
500:
description: Server Error.
components: components:
schemas: schemas:
_meta:
type: object
properties:
totalCount:
description: Total rows count in database.
type: integer
example: 1
pageCount:
description: How much pages there are with current perPage value.
type: integer
example: 1
currentPage:
description: Current page number.
type: integer
default: 1
perPage:
description: Rows per page.
type: integer
default: 10
_links:
type: object
properties:
self:
description: Link to current page. Always available, even if there is no data.
type: object
properties:
href:
type: string
first:
description: Link to first page. Available when data is available.
type: object
properties:
href:
type: string
last:
description: Link to last page. Available when data is available.
type: object
properties:
href:
type: string
next:
description: Link to next page. Available when there is more than one page of data.
type: object
properties:
href:
type: string
arrayOfIds: arrayOfIds:
type: object type: object
properties: properties:
@@ -1902,6 +2110,73 @@ components:
- '53f2d03c-303a-4a3c-b57f-f7fb62fee538' - '53f2d03c-303a-4a3c-b57f-f7fb62fee538'
- '42862a16-affa-4ba5-86c5-61376f46d695' - '42862a16-affa-4ba5-86c5-61376f46d695'
status:
description: Status.
type: object
properties:
id:
description: Status ID.
type: integer
example: 1
name:
description: Status name.
type: string
example: Status name
userInfo:
description: User info.
type: object
properties:
id:
description: User ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
name:
description: User's full name.
type: string
example: FirstName LastName
iconUrl:
description: User profile face image URL.
type: string
example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg
files:
description: Attached files.
type: array
items:
type: object
properties:
id:
description: File ID.
type: string
format: uuid
example: 96cf98ed-2762-4f6b-9a5b-3eca76c56477
url:
description: File URL.
type: string
example: https://hrenot.hrbox.io/file/open/96cf98ed-2762-4f6b-9a5b-3eca76c56477.jpg
file_ype:
description: File type.
type: string
enum:
- image
- video
- document
- archive
- other
- encrypted
example: image
ext:
description: File extension.
type: string
example: jpg
name:
description: File name.
type: string
example: image.jpg
accountSecret: accountSecret:
type: object type: object
properties: properties:
@@ -2372,26 +2647,6 @@ components:
name: name:
type: string type: string
_meta:
type: object
properties:
totalCount:
description: Total items count in database
type: integer
example: 1
pageCount:
description: How much pages there are with current perPage value
type: integer
default: 1
currentPage:
description: Current page number
type: integer
default: 1
perPage:
description: How much items per page
type: integer
default: 10
contact: contact:
type: object type: object
properties: properties:
@@ -3808,32 +4063,9 @@ components:
type: boolean type: boolean
example: true example: true
status: status:
description: Статус идеи. $ref: '#/components/schemas/status'
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: Модерация
createdUser: createdUser:
description: Пользователь подавший идею. $ref: '#/components/schemas/userInfo'
type: object
properties:
id:
description: Идентификатор пользователя.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
iconUrl:
description: Ссылка на изображение лица профиля пользователя.
type: string
example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg
name:
description: Имя пользователя.
type: string
example: Иван Иванов
performerUser: performerUser:
description: Пользователь исполняющий идею. description: Пользователь исполняющий идею.
type: object type: object
@@ -3905,6 +4137,10 @@ components:
description: Текущий пользователь предложил помощь в реализации идеи. description: Текущий пользователь предложил помощь в реализации идеи.
type: boolean type: boolean
example: false example: false
entityId:
description: Идентификатор сущности.
type: number
example: 360
ideaView: ideaView:
type: object type: object
@@ -3938,32 +4174,9 @@ components:
type: boolean type: boolean
example: true example: true
status: status:
description: Статус идеи. $ref: '#/components/schemas/status'
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: Модерация
createdUser: createdUser:
description: Пользователь подавший идею. $ref: '#/components/schemas/userInfo'
type: object
properties:
id:
description: Идентификатор пользователя.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
iconUrl:
description: Ссылка на изображение лица профиля пользователя.
type: string
example: https://hrenot.hrbox.io/file/user-face/e2668a74-d171-4d47-b68f-9eb7e7d4e120/300.jpg
name:
description: Имя пользователя.
type: string
example: Иван Иванов
performerUser: performerUser:
description: Пользователь исполняющий идею. description: Пользователь исполняющий идею.
type: object type: object
@@ -4072,39 +4285,11 @@ components:
type: boolean type: boolean
example: false example: false
files: files:
description: Список файлов прикрепленных к идее. $ref: '#/components/schemas/files'
type: array entityId:
items: description: Идентификатор сущности.
type: object type: number
properties: example: 360
id:
description: Идентификатор файла.
type: string
format: uuid
example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e
url:
description: Адрес размещения файла.
type: string
example: https://hrenot.hrbox.io/file/open/96cf98ed-2762-4f6b-9a5b-3eca76c56477.jpg
file_ype:
description: Тип файла.
type: string
enum:
- image
- video
- document
- archive
- other
- encrypted
example: image
ext:
description: Расширение файла.
type: string
example: jpg
name:
description: Имя файла.
type: string
example: 2023-01-01 01.01.01.jpg
ideaEdit: ideaEdit:
type: object type: object
@@ -4212,3 +4397,184 @@ components:
description: Срок действия статуса. Обязателен для установки статусов у которых включен срок действия. description: Срок действия статуса. Обязателен для установки статусов у которых включен срок действия.
type: string type: string
format: date format: date
commentStatuses:
description: >
Comment statuses list:
* `1` - Moderation (STATUS_NEW).
* `2` - Published (STATUS_APPROVED).
* `3` - Rejected by moderator (STATUS_REJECTED).
* `4` - Deleted (STATUS_DELETED).
type: array
items:
$ref: '#/components/schemas/status'
commentIndex:
type: object
properties:
id:
description: Comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
parent_id:
description: Parent comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
reply_id:
description: Reply to comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
entity_id:
description: Entity ID.
type: number
example: 1
reference_id:
description: Reference ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
created_at:
description: Comment creation date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
updated_at:
description: Comment edit date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
message:
description: Comment text.
type: string
example: Test
files:
$ref: '#/components/schemas/files'
status:
$ref: '#/components/schemas/status'
createdUser:
$ref: '#/components/schemas/userInfo'
referenceName:
description: Reference title or name.
type: string
example: Test reference
referenceUrl:
description: Reference URL.
type: string
example: https://hrenot.hrbox.io/content/idea/view?id=4405d4aa-82ed-44d4-a2b4-5e2ab4f611f1
commentView:
type: object
properties:
id:
description: Comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
parent_id:
description: Parent comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
default: null
reply_id:
description: Reply to comment ID.
type: string
format: uuid
default: null
entity_id:
description: Entity ID.
type: number
example: 1
reference_id:
description: Reference ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
created_at:
description: Comment creation date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
updated_at:
description: Comment edit date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
message:
description: Comment text.
type: string
example: Test
files:
$ref: '#/components/schemas/files'
status:
$ref: '#/components/schemas/status'
createdUser:
$ref: '#/components/schemas/userInfo'
commentGet:
type: object
properties:
entity_id:
description: Requested entity ID.
type: number
example: 1
reference_id:
description: Requested reference ID.
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
data:
type: array
items:
properties:
id:
description: Comment ID.
type: string
format: uuid
example: a91fe4d9-b486-4e94-9114-18589aad7c7e
parent_id:
description: Parent comment ID.
type: string
format: uuid
default: null
reply_id:
description: Reply to comment ID.
type: string
format: uuid
default: null
entity_id:
description: Entity ID.
type: number
example: 1
reference_id:
description: Reference ID.
type: string
format: uuid
example: edee4e11-dab5-4aac-93ac-43c379aab6b2
created_at:
description: Comment creation date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
updated_at:
description: Comment edit date.
type: string
format: 'date-time'
example: 2023-01-01 00:00:00
message:
description: Comment text.
type: string
example: Test
replies:
type: array
items:
$ref: '#/components/schemas/commentView'
files:
$ref: '#/components/schemas/files'
status:
$ref: '#/components/schemas/status'
createdUser:
$ref: '#/components/schemas/userInfo'