From bd15743784f328fcafda58a2cc7371628dbef063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=93=D1=80?= =?UTF-8?q?=D0=B8=D0=B1=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 8 Jan 2024 16:22:32 +0300 Subject: [PATCH] update postman collection and swagger --- api/postman_collection.json | 158 ++++++++++++++++++++++++------------ api/swagger.json | 2 +- 2 files changed, 105 insertions(+), 55 deletions(-) diff --git a/api/postman_collection.json b/api/postman_collection.json index 10e4985..c335361 100644 --- a/api/postman_collection.json +++ b/api/postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "2040f8a6-7526-4287-b578-3c38e7a3ac74", + "_postman_id": "9e9a6113-1be9-49d6-95eb-014e5d2cf3f9", "name": "Spring auth backend service", "description": "Описание Api\n\nContact Support:\n Name: Evgeny Gribanov\n Email: egribanov@yandex.com", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -371,7 +371,7 @@ "name": "v1", "item": [ { - "name": "role/{userId}", + "name": "role", "item": [ { "name": "Получить роль пользователя", @@ -412,6 +412,108 @@ }, "response": [] }, + { + "name": "Получить список пользователей", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "*/*" + } + ], + "url": { + "raw": "{{baseUrl}}/v1/role/users?page=0&size=10&sort=id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "role", + "users" + ], + "query": [ + { + "key": "page", + "value": "0", + "description": "required or default 0" + }, + { + "key": "size", + "value": "10", + "description": "required or default 10" + }, + { + "key": "sort", + "value": "id", + "description": "optional. property in user object" + } + ] + } + }, + "response": [] + }, + { + "name": "Получить список модераторов", + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "*/*" + } + ], + "url": { + "raw": "{{baseUrl}}/v1/role/moders?page=0&size=10&sort=id", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "role", + "moders" + ], + "query": [ + { + "key": "page", + "value": "0", + "description": "required or default 0" + }, + { + "key": "size", + "value": "10", + "description": "required or default 10" + }, + { + "key": "sort", + "value": "id", + "description": "optional. property in user object" + } + ] + } + }, + "response": [] + }, { "name": "Обновить роль до пользователя", "request": { @@ -671,58 +773,6 @@ }, "response": [] }, - { - "name": "Получить список всех пользователей", - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{bearerToken}}", - "type": "string" - } - ] - }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "*/*" - } - ], - "url": { - "raw": "{{baseUrl}}/v1/moderator/users-list?page=0&size=10", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "v1", - "moderator", - "users-list" - ], - "query": [ - { - "key": "page", - "value": "0", - "description": "(Required) " - }, - { - "key": "size", - "value": "10", - "description": "(Required) " - }, - { - "key": "sort", - "value": "[\"enim dolore\",\"laborum eu lab\"]", - "description": "(Required) ", - "disabled": true - } - ] - } - }, - "response": [] - }, { "name": "Удалить пользователя", "request": { diff --git a/api/swagger.json b/api/swagger.json index d9aef3d..2a9fa06 100644 --- a/api/swagger.json +++ b/api/swagger.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"Spring auth backend service","description":"Сервис авторизации и управления пользователями для мобильного приложения","contact":{"name":"Evgeny Gribanov","url":"https://codecow.pw","email":"gribanoveu@yandex.com"},"version":"1.0.0"},"servers":[{"url":"https://localhost:8443/api","description":"Generated server url"}],"tags":[{"name":"Аутентификация пользователя","description":"Позволяет получить и обновить токен"},{"name":"Контроллер для модерации","description":"Управляет ограничениями пользователя"},{"name":"Контроллер пользователя","description":"Юзер управляет своим аккаунтом"},{"name":"Контроллер для назначения модераторов","description":"Управляет ролями пользователя"},{"name":"Управление аккаунтом без авторизации","description":"Позволяет управлять данными учетной записи"},{"name":"Управление аккаунтом с авторизацией","description":"Позволяет управлять данными учетной записи"}],"paths":{"/open/v1/auth":{"post":{"tags":["Аутентификация пользователя"],"summary":"Получить токен","description":"Получение access token и refresh token","operationId":"authenticateUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}},"patch":{"tags":["Аутентификация пользователя"],"summary":"Обновить токен","description":"Получение нового токена на основе refresh token","operationId":"refreshToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}}},"/open/v1/account/restore-password":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Восстановить пароль через OTP код","operationId":"restorePassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestorePasswordDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/open/v1/account/generate-code":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Сгенерировать OTP код","operationId":"generateOtpCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateOtpDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/open/v1/account/create":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Регистрация нового пользователя","operationId":"registerUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/v1/role":{"get":{"tags":["Контроллер для назначения модераторов"],"summary":"Получить роль пользователя","operationId":"getUserRole","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]},"delete":{"tags":["Контроллер для назначения модераторов"],"summary":"Обновить роль до пользователя","operationId":"updateToUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]},"patch":{"tags":["Контроллер для назначения модераторов"],"summary":"Обновить роль до модератора","operationId":"updateToModerator","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/mercy":{"patch":{"tags":["Контроллер для модерации"],"summary":"Снять бан с пользователя","operationId":"mercyUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/enable":{"patch":{"tags":["Контроллер для модерации"],"summary":"Включить пользователя","operationId":"enableUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/disable":{"patch":{"tags":["Контроллер для модерации"],"summary":"Отключить пользователя","operationId":"disableUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestrictionDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/ban":{"patch":{"tags":["Контроллер для модерации"],"summary":"Выдать бан пользователю","operationId":"banUserReq","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestrictionDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/v1/account/change-password":{"patch":{"tags":["Управление аккаунтом с авторизацией"],"summary":"Сменить пароль","operationId":"changePassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/account/change-email":{"patch":{"tags":["Управление аккаунтом с авторизацией"],"summary":"Сменить Email","operationId":"changeEmail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeEmailDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/user":{"get":{"tags":["Контроллер пользователя"],"summary":"Получить данные текущего пользователя","operationId":"getUserData","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/User"}}}}},"security":[{"JWT":[]}]},"delete":{"tags":["Контроллер пользователя"],"summary":"Удалить текущего авторизованного пользователя","operationId":"deleteUser","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/users-list":{"get":{"tags":["Контроллер для модерации"],"summary":"Получить список всех пользователей","operationId":"getAllUsersList","parameters":[{"name":"pageable","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Pageable"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/open/v1/account/restrictions":{"get":{"tags":["Управление аккаунтом без авторизации"],"summary":"Получить причину блокировки","operationId":"getRestrictionsReason","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/v1/moderator/delete":{"delete":{"tags":["Контроллер для модерации"],"summary":"Удалить пользователя","operationId":"deleteUser_1","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}}},"components":{"schemas":{"LoginDto":{"required":["email","password"],"type":"object","properties":{"email":{"maxLength":80,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль пользователя","example":"Qwerty123"}},"description":"Сущность для авторизации"},"TokenResponse":{"type":"object","properties":{"timestamp":{"type":"string","description":"Время выполнения запроса","format":"date-time"},"access_token":{"type":"string","description":"Токен доступа"},"token_type":{"type":"string","description":"Тип токена","default":"Bearer"},"expires_in":{"type":"integer","description":"Время жизни токена в секундах","format":"int64","default":900},"refresh_token":{"type":"string","description":"Токен для обновления"}},"description":"Ответ после успешной авторизации"},"RestorePasswordDto":{"required":["confirmPassword","email","otpCode","password"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"otpCode":{"pattern":"^\\d{6}$","type":"string","description":"Временный код подтверждения OTP"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль повторно"}},"description":"Сущность для восстановления пароля"},"ResponseDetails":{"type":"object","properties":{"type":{"type":"string","description":"Тип операции"},"code":{"type":"string","description":"Код операции"},"message":{"type":"string","description":"Подробное описание операции"}},"description":"Сущность для описания деталей операции"},"StatusResponse":{"type":"object","properties":{"timestamp":{"type":"string","description":"Время выполнения запроса","format":"date-time"},"status":{"type":"string","description":"Уровень статуса запроса","default":"INFO","enum":["INFO","WARNING","ERROR","SUCCESS"]},"details":{"type":"array","description":"Детали запроса","items":{"$ref":"#/components/schemas/ResponseDetails"}}},"description":"Сущность для возврата статуса операции"},"GenerateOtpDto":{"required":["email"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Email","example":"user@email.com"}},"description":"Сущность для генерации временного кода OTP"},"RegisterDto":{"required":["confirmPassword","email","password"],"type":"object","properties":{"email":{"maxLength":80,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"birthDate":{"type":"string","description":"Дата рождения","example":"2001-12-13"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль повторно"}},"description":"Сущность для регистрации нового пользователя"},"RestrictionDto":{"required":["reasonCode","userEmail"],"type":"object","properties":{"userEmail":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Email","example":"user@email.com"},"reasonCode":{"maxLength":15,"minLength":0,"type":"string","description":"Пункт правил причины","example":"CR-1.1"}},"description":"Сущность для установки ограничений на пользователя"},"ChangePasswordDto":{"required":["confirmPassword","oldPassword","password"],"type":"object","properties":{"oldPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Старый пароль","example":"Qwerty123"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Новый пароль","example":"Qwerty1234"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Повторный ввод нового пароля","example":"Qwerty1234"}},"description":"Сущность для смены пароля авторизованным пользователем"},"ChangeEmailDto":{"required":["email"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"}},"description":"Сущность для смены email авторизованным пользователем"},"RefreshTokenDto":{"required":["refreshToken"],"type":"object","properties":{"refreshToken":{"type":"string","description":"Токен обновления (refresh token)"}},"description":"Сущность для получения нового access token"},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"version":{"type":"integer","format":"int64"},"email":{"type":"string"},"password":{"type":"string","writeOnly":true},"registrationDate":{"type":"string","format":"date-time"},"birthDate":{"type":"string","format":"date"},"banExpiration":{"type":"string","format":"date-time"},"restrictionReason":{"type":"string"},"accountNonExpired":{"type":"boolean"},"accountNonLocked":{"type":"boolean"},"credentialsNonExpired":{"type":"boolean"},"enabled":{"type":"boolean"}},"description":"Базовая сущность пользователя"},"Pageable":{"type":"object","properties":{"page":{"minimum":0,"type":"integer","format":"int32"},"size":{"minimum":1,"type":"integer","format":"int32"},"sort":{"type":"array","items":{"type":"string"}}}}},"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}} \ No newline at end of file +{"openapi":"3.0.1","info":{"title":"Spring auth backend service","description":"Сервис авторизации и управления пользователями для мобильного приложения","contact":{"name":"Evgeny Gribanov","url":"https://codecow.pw","email":"gribanoveu@yandex.com"},"version":"1.0.0"},"servers":[{"url":"https://localhost:8443/api","description":"Generated server url"}],"tags":[{"name":"Аутентификация пользователя","description":"Позволяет получить и обновить токен"},{"name":"Контроллер для модерации","description":"Управляет ограничениями пользователя"},{"name":"Контроллер пользователя","description":"Юзер управляет своим аккаунтом"},{"name":"Контроллер для назначения модераторов","description":"Управляет ролями пользователя"},{"name":"Управление аккаунтом без авторизации","description":"Позволяет управлять данными учетной записи"},{"name":"Управление аккаунтом с авторизацией","description":"Позволяет управлять данными учетной записи"}],"paths":{"/open/v1/auth":{"post":{"tags":["Аутентификация пользователя"],"summary":"Получить токен","description":"Получение access token и refresh token","operationId":"authenticateUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}},"patch":{"tags":["Аутентификация пользователя"],"summary":"Обновить токен","description":"Получение нового токена на основе refresh token","operationId":"refreshToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}}}},"/open/v1/account/restore-password":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Восстановить пароль через OTP код","operationId":"restorePassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestorePasswordDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/open/v1/account/generate-code":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Сгенерировать OTP код","operationId":"generateOtpCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateOtpDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/open/v1/account/create":{"post":{"tags":["Управление аккаунтом без авторизации"],"summary":"Регистрация нового пользователя","operationId":"registerUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/v1/role":{"get":{"tags":["Контроллер для назначения модераторов"],"summary":"Получить роль пользователя","operationId":"getUserRole","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]},"delete":{"tags":["Контроллер для назначения модераторов"],"summary":"Обновить роль до пользователя","operationId":"updateToUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]},"patch":{"tags":["Контроллер для назначения модераторов"],"summary":"Обновить роль до модератора","operationId":"updateToModerator","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/mercy":{"patch":{"tags":["Контроллер для модерации"],"summary":"Снять бан с пользователя","operationId":"mercyUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/enable":{"patch":{"tags":["Контроллер для модерации"],"summary":"Включить пользователя","operationId":"enableUser","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/disable":{"patch":{"tags":["Контроллер для модерации"],"summary":"Отключить пользователя","operationId":"disableUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestrictionDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/ban":{"patch":{"tags":["Контроллер для модерации"],"summary":"Выдать бан пользователю","operationId":"banUserReq","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestrictionDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/account/change-password":{"patch":{"tags":["Управление аккаунтом с авторизацией"],"summary":"Сменить пароль","operationId":"changePassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/account/change-email":{"patch":{"tags":["Управление аккаунтом с авторизацией"],"summary":"Сменить Email","operationId":"changeEmail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeEmailDto"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/user":{"get":{"tags":["Контроллер пользователя"],"summary":"Получить данные текущего пользователя","operationId":"getUserData","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/User"}}}}},"security":[{"JWT":[]}]},"delete":{"tags":["Контроллер пользователя"],"summary":"Удалить текущего авторизованного пользователя","operationId":"deleteUser","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/role/users":{"get":{"tags":["Контроллер для назначения модераторов"],"summary":"Получить список всех пользователей","operationId":"getUsersList","parameters":[{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":10}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UsersResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/role/moders":{"get":{"tags":["Контроллер для назначения модераторов"],"summary":"Получить список всех модераторов","operationId":"getModersList","parameters":[{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":10}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/UsersResponse"}}}}},"security":[{"JWT":[]}]}},"/v1/moderator/users":{"get":{"tags":["Контроллер для модерации"],"summary":"Получить список всех пользователей","operationId":"getAllUsersList","parameters":[{"name":"page","in":"query","description":"Zero-based page index (0..N)","required":false,"schema":{"minimum":0,"type":"integer","default":0}},{"name":"size","in":"query","description":"The size of the page to be returned","required":false,"schema":{"minimum":1,"type":"integer","default":10}},{"name":"sort","in":"query","description":"Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.","required":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}},"security":[{"JWT":[]}]}},"/open/v1/account/restrictions":{"get":{"tags":["Управление аккаунтом без авторизации"],"summary":"Получить причину блокировки","operationId":"getRestrictionsReason","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}}}},"/v1/moderator/delete":{"delete":{"tags":["Контроллер для модерации"],"summary":"Удалить пользователя","operationId":"deleteUser_1","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"JWT":[]}]}}},"components":{"schemas":{"LoginDto":{"required":["email","password"],"type":"object","properties":{"email":{"maxLength":80,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль пользователя","example":"Qwerty123"}},"description":"Сущность для авторизации"},"TokenResponse":{"type":"object","properties":{"timestamp":{"type":"string","description":"Время выполнения запроса","format":"date-time"},"access_token":{"type":"string","description":"Токен доступа"},"token_type":{"type":"string","description":"Тип токена","default":"Bearer"},"expires_in":{"type":"integer","description":"Время жизни токена в секундах","format":"int64","default":900},"refresh_token":{"type":"string","description":"Токен для обновления"}},"description":"Ответ после успешной авторизации"},"RestorePasswordDto":{"required":["confirmPassword","email","otpCode","password"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"otpCode":{"pattern":"^\\d{6}$","type":"string","description":"Временный код подтверждения OTP"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль повторно"}},"description":"Сущность для восстановления пароля"},"ResponseDetails":{"type":"object","properties":{"type":{"type":"string","description":"Тип операции"},"code":{"type":"string","description":"Код операции"},"message":{"type":"string","description":"Подробное описание операции"}},"description":"Сущность для описания деталей операции"},"StatusResponse":{"type":"object","properties":{"timestamp":{"type":"string","description":"Время выполнения запроса","format":"date-time"},"status":{"type":"string","description":"Уровень статуса запроса","default":"INFO","enum":["INFO","WARNING","ERROR","SUCCESS"]},"details":{"type":"array","description":"Детали запроса","items":{"$ref":"#/components/schemas/ResponseDetails"}}},"description":"Сущность для возврата статуса операции"},"GenerateOtpDto":{"required":["email"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Email","example":"user@email.com"}},"description":"Сущность для генерации временного кода OTP"},"RegisterDto":{"required":["confirmPassword","email","password"],"type":"object","properties":{"email":{"maxLength":80,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"},"birthDate":{"type":"string","description":"Дата рождения","example":"2001-12-13"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Пароль повторно"}},"description":"Сущность для регистрации нового пользователя"},"RestrictionDto":{"required":["reasonCode","userEmail"],"type":"object","properties":{"userEmail":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Email","example":"user@email.com"},"reasonCode":{"maxLength":15,"minLength":0,"type":"string","description":"Пункт правил причины","example":"CR-1.1"}},"description":"Сущность для установки ограничений на пользователя"},"ChangePasswordDto":{"required":["confirmPassword","oldPassword","password"],"type":"object","properties":{"oldPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Старый пароль","example":"Qwerty123"},"password":{"maxLength":80,"minLength":0,"type":"string","description":"Новый пароль","example":"Qwerty1234"},"confirmPassword":{"maxLength":80,"minLength":0,"type":"string","description":"Повторный ввод нового пароля","example":"Qwerty1234"}},"description":"Сущность для смены пароля авторизованным пользователем"},"ChangeEmailDto":{"required":["email"],"type":"object","properties":{"email":{"maxLength":30,"minLength":0,"pattern":"^[_A-Za-z0-9-+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$","type":"string","description":"Электронная почта","example":"user@email.com"}},"description":"Сущность для смены email авторизованным пользователем"},"RefreshTokenDto":{"required":["refreshToken"],"type":"object","properties":{"refreshToken":{"type":"string","description":"Токен обновления (refresh token)"}},"description":"Сущность для получения нового access token"},"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"version":{"type":"integer","format":"int64"},"email":{"type":"string"},"password":{"type":"string","writeOnly":true},"registrationDate":{"type":"string","format":"date-time"},"birthDate":{"type":"string","format":"date"},"banExpiration":{"type":"string","format":"date-time"},"restrictionReason":{"type":"string"},"accountNonExpired":{"type":"boolean"},"accountNonLocked":{"type":"boolean"},"credentialsNonExpired":{"type":"boolean"},"enabled":{"type":"boolean"}},"description":"Базовая сущность пользователя"},"UsersResponse":{"type":"object","properties":{"timestamp":{"type":"string","description":"Время выполнения запроса","format":"date-time"},"status":{"type":"string","description":"Уровень статуса запроса","default":"INFO","enum":["INFO","WARNING","ERROR","SUCCESS"]},"users":{"type":"array","description":"Информация о пользователе","items":{"$ref":"#/components/schemas/User"}}},"description":"Ответ со списком всех пользователей"}},"securitySchemes":{"JWT":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}}} \ No newline at end of file