> ## 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.

# PageManagementServiceImpl

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

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

  pageManagementServiceImpl
</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>`.

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

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

## Методы

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

  ### createPage

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

  ```json theme={null}
  {
      "id":  null,
      "imageUrl":  null,
      "pageUrl":  null,
      "containerType":  null,
      "categoriesId":  null,
      "content":  null,
      "releaseDate":  null,
      "published":  false,
      "imageUrlRemove":  false,
      "metaInfo":  null
  }
  ```

  Request:

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

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

  ### deletePage

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

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

  ### deletePages

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

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

  ### updatePage

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

  ```json theme={null}
  {
      "id":  null,
      "imageUrl":  null,
      "pageUrl":  null,
      "containerType":  null,
      "categoriesId":  null,
      "content":  null,
      "releaseDate":  null,
      "published":  false,
      "imageUrlRemove":  false,
      "metaInfo":  null
  }
  ```

  Request:

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

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

  ### duplicatePage

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

  ```json theme={null}
  {
      "fromId":  null,
      "toId":  null,
      "translate":  false,
      "emailTemplate":  false,
      "pageUrl":  null,
      "request":  null
  }
  ```

  Request:

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

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

  ### copyPage

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

  ```json theme={null}
  {
      "fromId":  null,
      "toId":  null,
      "translate":  false,
      "emailTemplate":  false,
      "pageUrl":  null,
      "request":  null
  }
  ```

  Request:

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

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

  ### publishToUrl

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

  ```json theme={null}
  {
      "pageName":  null,
      "pageRoot":  null,
      "containerId":  null,
      "containerType":  null,
      "copyTo":  null
  }
  ```

  Request:

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