Update Moderation API

This commit is contained in:
ruslan
2023-07-13 16:32:17 +03:00
parent fbdeefdef2
commit a6ae3f4e45
+254 -109
View File
@@ -2407,15 +2407,16 @@ components:
description: > description: >
Moderation types: Moderation types:
* `USER_AVATAR` - Change user profile photo. Fields - photo_file_id, settings. * `USER_AVATAR` - Change user profile photo. Fields - photo_file_id, settings.
* `USER_CABINET` - Change city, cabinet. Fields - city, cabinet.
* `USER_POSTCARD` - Send postcard. Fields - text, user_id, postcard_id. * `USER_POSTCARD` - Send postcard. Fields - text, user_id, postcard_id.
* `COMMENT` - Add comment. Fields - message, content_json. * `COMMENT` - Add comment. Fields - message, content_json.
* `IDEA` - Idea suggestion. Fields - idea_purpose_id, department_id, title, description, files. * `IDEA` - Idea suggestion. Fields - idea_purpose_id, department_id, title, description, files.
* `VOTING_NOMINEE` - Image participating in the voting. Fields - file_id, nomination_id, title, description. * `VOTING_NOMINEE` - Image participating in the voting. Fields - file_id, nomination_id, title, description.
# Временно отключено на портале
# * `USER_CABINET` - Change city, cabinet. Fields - city, cabinet.
type: string type: string
enum: enum:
- USER_AVATAR - USER_AVATAR
- USER_CABINET # - USER_CABINET
- USER_POSTCARD - USER_POSTCARD
- COMMENT - COMMENT
- IDEA - IDEA
@@ -2424,12 +2425,13 @@ components:
description: One of moderation types. Values of fields that has been changed. description: One of moderation types. Values of fields that has been changed.
type: object type: object
oneOf: oneOf:
# USER_AVATAR
- properties: - properties:
photo_file_id: photo_file_id:
description: Field "photo_file_id" in User model. File model ID. description: Field "photo_file_id" in User model. File model ID.
type: string type: string
format: uuid format: uuid
example: 4b7477f9-5000-49f1-9ce1-02cb95c0cac6 example: 37a57294-489b-4a1b-ac5c-a390de5e388d
settings: settings:
description: Field "settings" in User model. description: Field "settings" in User model.
type: object type: object
@@ -2454,11 +2456,13 @@ components:
description: Y-axis offset in percent. description: Y-axis offset in percent.
type: integer type: integer
example: 10 example: 10
- properties: # USER_CABINET
cabinet: # - properties:
description: User cabinet field. # cabinet:
type: string # description: User cabinet field.
example: 1a # type: string
# example: 1a
# USER_POSTCARD
- properties: - properties:
text: text:
description: Postcard text. description: Postcard text.
@@ -2474,6 +2478,7 @@ components:
type: string type: string
format: uuid format: uuid
example: e101d3be-ca63-49e0-9c94-a32fefc20c92 example: e101d3be-ca63-49e0-9c94-a32fefc20c92
# COMMENT
- properties: - properties:
message: message:
description: Field "message" in Comment model. description: Field "message" in Comment model.
@@ -2484,6 +2489,69 @@ components:
type: array type: array
items: items:
type: object type: object
properties:
id:
description: File model ID.
type: string
format: uuid
example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e
ext:
description: File extension.
type: string
example: jpg
fid:
description: File model ID with extension.
type: string
format: uuid
example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e.jpg
meta:
description: File meta information.
type: object
properties:
width:
description: Image width.
type: integer
example: 1920
height:
description: Image height.
type: integer
example: 1080
name:
description: File name.
type: string
example: 2023-01-01 01.01.01.jpg
size:
description: File size in bytes.
type: integer
example: 109531
fileType:
description: File type.
type: string
enum:
- image
- video
- document
- archive
- other
- encrypted
example: image
isCommon:
description: File is common.
type: boolean
example: false
isPublic:
description: File is public.
type: boolean
example: false
mimeType:
description: File MIME-Type.
type: string
example: image/jpeg
loadingState:
description: File loading state.
type: string
example: uploaded
# IDEA
- properties: - properties:
idea_purpose_id: idea_purpose_id:
description: Field "idea_purpose_id" in Idea model. description: Field "idea_purpose_id" in Idea model.
@@ -2570,6 +2638,7 @@ components:
description: File loading state. description: File loading state.
type: string type: string
example: uploaded example: uploaded
# VOTING_NOMINEE
- properties: - properties:
file_id: file_id:
description: File model ID. description: File model ID.
@@ -2608,8 +2677,9 @@ components:
description: Model fields that can be changed. Data formatted for use in view files. description: Model fields that can be changed. Data formatted for use in view files.
type: object type: object
oneOf: oneOf:
# USER_AVATAR
- properties: - properties:
photo_file_id: current_photo_url:
description: User profile photo. description: User profile photo.
type: object type: object
properties: properties:
@@ -2621,16 +2691,88 @@ components:
- img - img
- files - files
- html - html
example: string example: img
label: label:
description: Field label. description: Field label.
type: string type: string
example: Image example: Profile photo
value: value:
description: Field value. description: Field value.
type: string type: string
format: uuid example: https://demo.hrbox.io/file/open/faf61bb0-af79-4422-9ebd-da2e92924ce3.jpg
example: 4b7477f9-5000-49f1-9ce1-02cb95c0cac6 url:
type: string
default: null
current_face_url:
description: User face on profile photo.
type: object
properties:
type:
description: Field value type.
type: string
enum:
- string
- img
- files
- html
example: img
label:
description: Field label.
type: string
example: Face on profile photo
value:
description: Field value.
type: string
example: https://demo.hrbox.io/file/open/f3217a4b-02fd-400e-82c3-47cc7f36cf5f.jpg
url:
type: string
default: null
photo_file_id:
description: User new profile photo.
type: object
properties:
type:
description: Field value type.
type: string
enum:
- string
- img
- files
- html
example: img
label:
description: Field label.
type: string
example: New profile photo
value:
description: Field value.
type: string
example: https://demo.hrbox.io/file/open/37a57294-489b-4a1b-ac5c-a390de5e388d.jpg
url:
type: string
default: null
new_face_url:
description: New user-selected face in profile photo. Returns null because it is under development.
type: object
properties:
type:
description: Field value type.
type: string
enum:
- string
- img
- files
- html
example: img
label:
description: Field label.
type: string
example: Selected face on photo
value:
description: Field value.
type: string
default: null
example: https://demo.hrbox.io/file/open/faf61bb0-af79-4422-9ebd-da2e92924ce3.jpg
url: url:
type: string type: string
default: null default: null
@@ -2675,54 +2817,56 @@ components:
description: Y-axis offset in percent. description: Y-axis offset in percent.
type: integer type: integer
example: 10 example: 10
- properties: # USER_CABINET
city_id: # - properties:
description: Field "City". # city_id:
type: object # description: Field "City".
properties: # type: object
type: # properties:
description: Field value type. # type:
type: string # description: Field value type.
enum: # type: string
- string # enum:
- img # - string
- files # - img
- html # - files
example: string # - html
label: # example: string
description: Field label. # label:
type: string # description: Field label.
example: City # type: string
value: # example: City
description: Field value. # value:
type: string # description: Field value.
default: null # type: string
url: # default: null
type: string # url:
cabinet: # type: string
description: Field "Cabinet". # cabinet:
type: object # description: Field "Cabinet".
properties: # type: object
type: # properties:
description: Field value type. # type:
type: string # description: Field value type.
enum: # type: string
- string # enum:
- img # - string
- files # - img
- html # - files
example: string # - html
label: # example: string
description: Field label. # label:
type: string # description: Field label.
example: Cabinet # type: string
value: # example: Cabinet
description: Field value. # value:
type: string # description: Field value.
default: null # type: string
example: 1a # default: null
url: # example: 1a
type: string # url:
# type: string
# USER_POSTCARD
- properties: - properties:
text: text:
description: Postcard text. description: Postcard text.
@@ -2794,6 +2938,7 @@ components:
example: https://demo.hrbox.io/file/open/d6f5be76-58fa-4b61-a248-74e10b2b5ed0.jpg example: https://demo.hrbox.io/file/open/d6f5be76-58fa-4b61-a248-74e10b2b5ed0.jpg
url: url:
type: string type: string
# COMMENT
- properties: - properties:
subject: subject:
description: Comment subject. description: Comment subject.
@@ -2861,10 +3006,42 @@ components:
example: Files example: Files
value: value:
description: Field value. description: Field value.
type: string type: object
example: TODO properties:
item:
type: object
properties:
id:
description: File model ID.
type: string
format: uuid
example: 3f8d3db4-49da-4880-bfdb-e682f9d4876d
url:
description: File open URL.
type: string
example: https://demo.hrbox.io/file/open/3f8d3db4-49da-4880-bfdb-e682f9d4876d.jpg
file_type:
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: 2023-01-01 01.01.01.jpg
url: url:
type: string type: string
# IDEA
- properties: - properties:
idea_purpose_id: idea_purpose_id:
description: Idea purpose. description: Idea purpose.
@@ -2988,37 +3165,12 @@ components:
description: File model ID. description: File model ID.
type: string type: string
format: uuid format: uuid
example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e example: a91fe4d9-b486-4e94-9114-18589aad7c7e
ext: url:
description: File extension. description: File open URL.
type: string type: string
example: jpg example: https://demo.hrbox.io/file/open/a91fe4d9-b486-4e94-9114-18589aad7c7e.jpg
fid: file_type:
description: File model ID with extension.
type: string
format: uuid
example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e.jpg
meta:
description: File meta information.
type: object
properties:
width:
description: Image width.
type: integer
example: 1920
height:
description: Image height.
type: integer
example: 1080
name:
description: File name.
type: string
example: 2023-01-01 01.01.01.jpg
size:
description: File size in bytes.
type: integer
example: 109531
fileType:
description: File type. description: File type.
type: string type: string
enum: enum:
@@ -3029,24 +3181,17 @@ components:
- other - other
- encrypted - encrypted
example: image example: image
isCommon: ext:
description: File is common. description: File extension.
type: boolean
example: false
isPublic:
description: File is public.
type: boolean
example: false
mimeType:
description: File MIME-Type.
type: string type: string
example: image/jpeg example: jpg
loadingState: name:
description: File loading state. description: File name.
type: string type: string
example: uploaded example: 2023-01-01 01.01.01.jpg
url: url:
type: string type: string
# VOTING_NOMINEE
- properties: - properties:
file_id: file_id:
description: URL to file. description: URL to file.
@@ -3114,7 +3259,7 @@ components:
value: value:
description: Field value. description: Field value.
type: string type: string
example: Example idea title example: Example photo title
url: url:
type: string type: string
description: description:
@@ -3137,7 +3282,7 @@ components:
value: value:
description: Field value. description: Field value.
type: string type: string
example: Example idea description example: Example photo description
url: url:
type: string type: string
referenceAttributes: referenceAttributes: