# TemplateController API Documentation

Base Path: `/generator/template`

## Endpoints

### 1. 查询代码模版列表 (Query code template list)

*   **Method:** `GET`
*   **Path:** `/list`
*   **Permissions:** `generator:template:list`
*   **Description:** Retrieves a paginated list of code templates.
*   **Request Parameters:**
    *   `Template` object (sent as query parameters). Refer to the `Template` domain class for available fields.
*   **Responses:**
    *   `200 OK`: `TableDataInfo` containing the list of templates and pagination information.

### 2. 导出代码模版列表 (Export code template list)

*   **Method:** `POST`
*   **Path:** `/export`
*   **Permissions:** `generator:template:export`
*   **Description:** Exports the list of code templates as an Excel file.
*   **Request Parameters:**
    *   `Template` object (sent as query parameters). Refer to the `Template` domain class for available fields.
*   **Responses:**
    *   `200 OK`: Excel file download.

### 3. 获取代码模版详细信息 (Get code template details)

*   **Method:** `GET`
*   **Path:** `/{templateId}`
*   **Permissions:** `generator:template:query`
*   **Description:** Retrieves detailed information about a specific code template.
*   **Path Variables:**
    *   `templateId` (Long): The ID of the template.
*   **Responses:**
    *   `200 OK`: `AjaxResult` containing the `Template` object.
    *   `404 Not Found`: If the template with the given ID does not exist.

### 4. 新增代码模版 (Add new code template)

*   **Method:** `POST`
*   **Path:** `/`
*   **Permissions:** `generator:template:add`
*   **Description:** Creates a new code template.
*   **Request Body:**
    *   `Template` object (JSON). Refer to the `Template` domain class for required and optional fields.
*   **Responses:**
    *   `200 OK`: `AjaxResult` indicating success or failure.

### 5. 修改代码模版 (Modify code template)

*   **Method:** `PUT`
*   **Path:** `/`
*   **Permissions:** `generator:template:edit`
*   **Description:** Updates an existing code template.
*   **Request Body:**
    *   `Template` object (JSON). `templateId` must be provided. Refer to the `Template` domain class for updatable fields.
*   **Responses:**
    *   `200 OK`: `AjaxResult` indicating success or failure.
    *   `404 Not Found`: If the template with the given ID does not exist.

### 6. 删除代码模版 (Delete code template)

*   **Method:** `DELETE`
*   **Path:** `/{templateIds}`
*   **Permissions:** `generator:template:remove`
*   **Description:** Deletes one or more code templates.
*   **Path Variables:**
    *   `templateIds` (Long[]): An array of template IDs to delete.
*   **Responses:**
    *   `200 OK`: `AjaxResult` indicating success or failure.

### 7. 修改模版状态 (Modify template status)

*   **Method:** `PUT`
*   **Path:** `/changeStatus`
*   **Permissions:** `generator:template:edit`
*   **Description:** Modifies the status of a code template (e.g., enable/disable).
*   **Request Body:**
    *   `Template` object (JSON). Should include `templateId` and the new `status`.
*   **Responses:**
    *   `200 OK`: `AjaxResult` indicating success or failure.
    *   `404 Not Found`: If the template with the given ID does not exist.

## `Template` Domain Object (for reference)

(Please refer to `com.ruoyi.generator.domain.Template` for the exact structure and fields. Key fields likely include `templateId`, `templateName`, `content`, `status`, etc.)

## `TableDataInfo` Object (for reference)

(Standard RuoYi object for paginated list responses. Typically includes `total`, `rows`, `code`, `msg`.)

## `AjaxResult` Object (for reference)

(Standard RuoYi object for API responses. Typically includes `code`, `msg`, `data`.) 