> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mastermindcms.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TranslationServiceImpl

> Вызов публичных методов сервиса через REST API: translationServiceImpl

<ResponseField name="beanId" type="string">
  Идентификатор Spring bean, который содержит вызываемый сервис.

  translationServiceImpl
</ResponseField>

<ResponseField name="scope" type="string" default="PROTOTYPE">
  Область действия bean. Для вызовов сервисов используется PROTOTYPE.
</ResponseField>

<ResponseField name="functionName" type="string">
  Имя публичного метода сервиса, указанное в сигнатуре ниже.
</ResponseField>

<ResponseField name="args" type="object[]">
  Массив аргументов метода. Каждый аргумент передаётся объектом с индексом 0, 1 и т. д.; значение должно соответствовать Java-типу параметра.
</ResponseField>

## Headers

```http theme={null}
POST /api/v1/bean/request
Content-Type: application/json
Lang-Context: ru
Site-Context: my-site
Authorization: Bearer <token>
```

Заголовки `Lang-Context` и `Site-Context` необходимо передавать в каждом запросе. Для защищённых методов передавайте JWT в заголовке `Authorization` в формате `Bearer <token>`.

**Доступ:** GUEST. **Bearer Token:** не требуется.

* GUEST — без логина; доступен только whitelist.
* USER — требуется авторизация; доступны методы с проверкой USER.
* ADMIN — полный доступ к public-методам всех сервисов.
* Если метод проверяет роль внутри логики, GUEST может получить null.

## Методы

<ResponseField name="init" type="void">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### init

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "init",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getRepository" type="TranslationsRepository">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getRepository

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getRepository",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getLanguageRepository" type="LanguageRepository">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getLanguageRepository

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getLanguageRepository",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getPaginationFilter" type="Deque<Map<String, Object>>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### getPaginationFilter

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getPaginationFilter",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslations" type="LinkedHashSet<LocalizedText>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslations",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslationsPaged" type="Page<LocalizedText>">
  | Аргумент      | Тип      | Описание                      |
  | ------------- | -------- | ----------------------------- |
  | `requestJson` | `String` | Передаётся через `args[0].0`. |

  ### searchTranslationsPaged

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslationsPaged",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslations" type="List<LocalizedText>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `query`  | `String` | Передаётся через `args[0].0`. |
  | `offset` | `String` | Передаётся через `args[1].1`. |
  | `limit`  | `String` | Передаётся через `args[2].2`. |

  ### searchTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslations",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchTranslationsById" type="List<LocalizedText>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `regex`  | `String` | Передаётся через `args[0].0`. |

  ### searchTranslationsById

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchTranslationsById",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="findTranslations" type="List<LocalizedText>">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### findTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findTranslations",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="findTranslationsByLangCode" type="List<LocalizedText>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `lang`   | `String` | Передаётся через `args[0].0`. |

  ### findTranslationsByLangCode

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findTranslationsByLangCode",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationsByLangCode" type="Map<String, String>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `lang`   | `String` | Передаётся через `args[0].0`. |

  ### getTranslationsByLangCode

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationsByLangCode",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getLangFromContext" type="String">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getLangFromContext

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getLangFromContext",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="getTranslatedTimeDuration" type="Map<String, String>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `date`   | `String` | Передаётся через `args[0].0`. |

  ### getTranslatedTimeDuration

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslatedTimeDuration",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationById" type="LocalizedText">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `id`     | `String` | Передаётся через `args[0].0`. |

  ### getTranslationById

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationById",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslation" type="Map<String,String>">
  | Аргумент         | Тип      | Описание                      |
  | ---------------- | -------- | ----------------------------- |
  | `id`             | `String` | Передаётся через `args[0].0`. |
  | `repositoryName` | `String` | Передаётся через `args[1].1`. |

  ### getTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslation",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslation" type="Map<String, String>">
  | Аргумент         | Тип      | Описание                      |
  | ---------------- | -------- | ----------------------------- |
  | `id`             | `String` | Передаётся через `args[0].0`. |
  | `lang`           | `String` | Передаётся через `args[1].1`. |
  | `repositoryName` | `String` | Передаётся через `args[2].2`. |

  ### getTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslation",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationValue" type="String">
  | Аргумент         | Тип      | Описание                      |
  | ---------------- | -------- | ----------------------------- |
  | `id`             | `String` | Передаётся через `args[0].0`. |
  | `repositoryName` | `String` | Передаётся через `args[1].1`. |

  ### getTranslationValue

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationValue",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslationValue" type="String">
  | Аргумент         | Тип      | Описание                      |
  | ---------------- | -------- | ----------------------------- |
  | `id`             | `String` | Передаётся через `args[0].0`. |
  | `lang`           | `String` | Передаётся через `args[1].1`. |
  | `repositoryName` | `String` | Передаётся через `args[2].2`. |

  ### getTranslationValue

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslationValue",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="searchLanguages" type="List<Language>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `query`  | `String` | Передаётся через `args[0].0`. |
  | `offset` | `String` | Передаётся через `args[1].1`. |
  | `limit`  | `String` | Передаётся через `args[2].2`. |

  ### searchLanguages

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "searchLanguages",
    "args": [
      {
        "0": null,
        "1": null,
        "2": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="findLanguages" type="List<Language>">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### findLanguages

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "findLanguages",
    "args": []
  }
  ```
</ResponseField>

<ResponseField name="createTranslation" type="Optional<LocalizedText>">
  | Аргумент           | Тип                             | Описание                      |
  | ------------------ | ------------------------------- | ----------------------------- |
  | `translationAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### createTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createTranslation",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="createLanguage" type="Optional<Language>">
  | Аргумент    | Тип                             | Описание                      |
  | ----------- | ------------------------------- | ----------------------------- |
  | `langAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### createLanguage

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "isoCode":  null,
      "translations":  null,
      "fallIntoObjects":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "createLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveTranslation" type="Optional<LocalizedText>">
  | Аргумент           | Тип                             | Описание                      |
  | ------------------ | ------------------------------- | ----------------------------- |
  | `translationAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### saveTranslation

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveTranslation",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveArticle" type="Optional<LocalizedText>">
  | Аргумент    | Тип      | Описание                      |
  | ----------- | -------- | ----------------------------- |
  | `text`      | `String` | Передаётся через `args[0].0`. |
  | `articleId` | `String` | Передаётся через `args[1].1`. |

  ### saveArticle

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveArticle",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="saveLanguage" type="Optional<Language>">
  | Аргумент    | Тип                             | Описание                      |
  | ----------- | ------------------------------- | ----------------------------- |
  | `langAsMap` | `LinkedHashMap<String, Object>` | Передаётся через `args[0].0`. |

  ### saveLanguage

  Пример JSON объекта запроса:

  ```json theme={null}
  {
      "id":  null,
      "name":  null,
      "isoCode":  null,
      "translations":  null,
      "fallIntoObjects":  null
  }
  ```

  Request:

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "saveLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationAndClean" type="void">
  | Аргумент        | Тип      | Описание                      |
  | --------------- | -------- | ----------------------------- |
  | `translationId` | `String` | Передаётся через `args[0].0`. |

  ### removeTranslationAndClean

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationAndClean",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationsByIds" type="void">
  | Аргумент         | Тип                 | Описание                      |
  | ---------------- | ------------------- | ----------------------------- |
  | `translationIds` | `ArrayList<String>` | Передаётся через `args[0].0`. |

  ### removeTranslationsByIds

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationsByIds",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeTranslationsByLanguage" type="void">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `langId` | `String` | Передаётся через `args[0].0`. |

  ### removeTranslationsByLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeTranslationsByLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeLanguageAndClean" type="void">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `langId` | `String` | Передаётся через `args[0].0`. |

  ### removeLanguageAndClean

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeLanguageAndClean",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="removeLanguagesByIds" type="void">
  | Аргумент      | Тип                 | Описание                      |
  | ------------- | ------------------- | ----------------------------- |
  | `languageIds` | `ArrayList<String>` | Передаётся через `args[0].0`. |

  ### removeLanguagesByIds

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "removeLanguagesByIds",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getTranslations" type="HashSet<LocalizedText>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `langEn` | `String` | Передаётся через `args[0].0`. |
  | `langDe` | `String` | Передаётся через `args[1].1`. |

  ### getTranslations

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getTranslations",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getAlphabetForActiveLanguage" type="List<Map<String, Object>>">
  | Аргумент | Тип      | Описание                      |
  | -------- | -------- | ----------------------------- |
  | `isUpp`  | `String` | Передаётся через `args[0].0`. |

  ### getAlphabetForActiveLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getAlphabetForActiveLanguage",
    "args": [
      {
        "0": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getAlphabetForLanguage" type="List<Map<String, Object>>">
  | Аргумент   | Тип      | Описание                      |
  | ---------- | -------- | ----------------------------- |
  | `isUpp`    | `String` | Передаётся через `args[0].0`. |
  | `language` | `String` | Передаётся через `args[1].1`. |

  ### getAlphabetForLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getAlphabetForLanguage",
    "args": [
      {
        "0": null,
        "1": null
      }
    ]
  }
  ```
</ResponseField>

<ResponseField name="getDefaultLanguage" type="String">
  | Аргумент | Тип | Описание                      |
  | -------- | --- | ----------------------------- |
  | —        | —   | Метод не принимает аргументы. |

  ### getDefaultLanguage

  ```json theme={null}
  {
    "beanId": "translationServiceImpl",
    "scope": "PROTOTYPE",
    "functionName": "getDefaultLanguage",
    "args": []
  }
  ```
</ResponseField>
