From a6ae3f4e45a6733a0cb6f3d79bea32aae5d734b8 Mon Sep 17 00:00:00 2001 From: ruslan Date: Thu, 13 Jul 2023 16:32:17 +0300 Subject: [PATCH] Update Moderation API --- v2/swagger.yaml | 363 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 254 insertions(+), 109 deletions(-) diff --git a/v2/swagger.yaml b/v2/swagger.yaml index b494b12..d7200ff 100644 --- a/v2/swagger.yaml +++ b/v2/swagger.yaml @@ -2407,15 +2407,16 @@ components: description: > Moderation types: * `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. * `COMMENT` - Add comment. Fields - message, content_json. * `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. + # Временно отключено на портале + # * `USER_CABINET` - Change city, cabinet. Fields - city, cabinet. type: string enum: - USER_AVATAR - - USER_CABINET +# - USER_CABINET - USER_POSTCARD - COMMENT - IDEA @@ -2424,12 +2425,13 @@ components: description: One of moderation types. Values of fields that has been changed. type: object oneOf: + # USER_AVATAR - properties: photo_file_id: description: Field "photo_file_id" in User model. File model ID. type: string format: uuid - example: 4b7477f9-5000-49f1-9ce1-02cb95c0cac6 + example: 37a57294-489b-4a1b-ac5c-a390de5e388d settings: description: Field "settings" in User model. type: object @@ -2454,11 +2456,13 @@ components: description: Y-axis offset in percent. type: integer example: 10 - - properties: - cabinet: - description: User cabinet field. - type: string - example: 1a + # USER_CABINET +# - properties: +# cabinet: +# description: User cabinet field. +# type: string +# example: 1a + # USER_POSTCARD - properties: text: description: Postcard text. @@ -2474,6 +2478,7 @@ components: type: string format: uuid example: e101d3be-ca63-49e0-9c94-a32fefc20c92 + # COMMENT - properties: message: description: Field "message" in Comment model. @@ -2484,6 +2489,69 @@ components: type: array items: 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: idea_purpose_id: description: Field "idea_purpose_id" in Idea model. @@ -2570,6 +2638,7 @@ components: description: File loading state. type: string example: uploaded + # VOTING_NOMINEE - properties: file_id: description: File model ID. @@ -2608,8 +2677,9 @@ components: description: Model fields that can be changed. Data formatted for use in view files. type: object oneOf: + # USER_AVATAR - properties: - photo_file_id: + current_photo_url: description: User profile photo. type: object properties: @@ -2621,16 +2691,88 @@ components: - img - files - html - example: string + example: img label: description: Field label. type: string - example: Image + example: Profile photo value: description: Field value. type: string - format: uuid - example: 4b7477f9-5000-49f1-9ce1-02cb95c0cac6 + example: https://demo.hrbox.io/file/open/faf61bb0-af79-4422-9ebd-da2e92924ce3.jpg + 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: type: string default: null @@ -2675,54 +2817,56 @@ components: description: Y-axis offset in percent. type: integer example: 10 - - 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_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 + # USER_POSTCARD - properties: text: description: Postcard text. @@ -2794,6 +2938,7 @@ components: example: https://demo.hrbox.io/file/open/d6f5be76-58fa-4b61-a248-74e10b2b5ed0.jpg url: type: string + # COMMENT - properties: subject: description: Comment subject. @@ -2861,10 +3006,42 @@ components: example: Files value: description: Field value. - type: string - example: TODO + type: object + 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: type: string + # IDEA - properties: idea_purpose_id: description: Idea purpose. @@ -2988,37 +3165,12 @@ components: description: File model ID. type: string format: uuid - example: bf052a5e-eb70-4eb9-b3f1-9ea50d751b0e - ext: - description: File extension. + example: a91fe4d9-b486-4e94-9114-18589aad7c7e + url: + description: File open URL. 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: + example: https://demo.hrbox.io/file/open/a91fe4d9-b486-4e94-9114-18589aad7c7e.jpg + file_type: description: File type. type: string enum: @@ -3029,24 +3181,17 @@ components: - 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. + ext: + description: File extension. type: string - example: image/jpeg - loadingState: - description: File loading state. + example: jpg + name: + description: File name. type: string - example: uploaded + example: 2023-01-01 01.01.01.jpg url: type: string + # VOTING_NOMINEE - properties: file_id: description: URL to file. @@ -3114,7 +3259,7 @@ components: value: description: Field value. type: string - example: Example idea title + example: Example photo title url: type: string description: @@ -3137,7 +3282,7 @@ components: value: description: Field value. type: string - example: Example idea description + example: Example photo description url: type: string referenceAttributes: