141 lines
4.7 KiB
Markdown
141 lines
4.7 KiB
Markdown
|
|
# SysModuleController API Documentation
|
||
|
|
|
||
|
|
This document outlines the API endpoints provided by the `SysModuleController`.
|
||
|
|
|
||
|
|
## Base Path
|
||
|
|
`/generator/module`
|
||
|
|
|
||
|
|
## Endpoints
|
||
|
|
|
||
|
|
### 1. 查询功能模块列表 (List Functional Modules)
|
||
|
|
- **Description**: Retrieves a paginated list of functional modules.
|
||
|
|
- **Permissions**: `generator:module:list`
|
||
|
|
- **HTTP Method**: `GET`
|
||
|
|
- **Endpoint**: `/list`
|
||
|
|
- **Request Parameters**:
|
||
|
|
- `sysModule` (Query Parameters): An object of `SysModule` containing filter criteria.
|
||
|
|
- `moduleId` (Long): Module ID
|
||
|
|
- `moduleName` (String): Module Name
|
||
|
|
- `moduleCode` (String): Module Code
|
||
|
|
- `moduleDesc` (String): Module Description
|
||
|
|
- `status` (String): Status (e.g., '0' for normal, '1' for disabled)
|
||
|
|
- `createBy` (String): Creator
|
||
|
|
- `createTime` (Date): Creation Time
|
||
|
|
- `updateBy` (String): Updater
|
||
|
|
- `updateTime` (Date): Update Time
|
||
|
|
- `remark` (String): Remarks
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: `TableDataInfo` containing a list of `SysModule` objects.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"total": 100,
|
||
|
|
"rows": [
|
||
|
|
{
|
||
|
|
"moduleId": 1,
|
||
|
|
"moduleName": "Sample Module",
|
||
|
|
"moduleCode": "sample",
|
||
|
|
// ... other SysModule fields
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"code": 200,
|
||
|
|
"msg": "查询成功"
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. 导出功能模块列表 (Export Functional Modules)
|
||
|
|
- **Description**: Exports the list of functional modules to an Excel file.
|
||
|
|
- **Permissions**: `generator:module:export`
|
||
|
|
- **HTTP Method**: `POST`
|
||
|
|
- **Endpoint**: `/export`
|
||
|
|
- **Request Parameters**:
|
||
|
|
- `sysModule` (Request Body): An object of `SysModule` containing filter criteria. (Same as list endpoint)
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: An Excel file download.
|
||
|
|
|
||
|
|
### 3. 获取功能模块详细信息 (Get Functional Module Details)
|
||
|
|
- **Description**: Retrieves detailed information about a specific functional module by its ID.
|
||
|
|
- **Permissions**: `generator:module:query`
|
||
|
|
- **HTTP Method**: `GET`
|
||
|
|
- **Endpoint**: `/{moduleId}`
|
||
|
|
- **Path Variables**:
|
||
|
|
- `moduleId` (Long): The ID of the functional module.
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: `AjaxResult` containing the `SysModule` object.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"msg": "操作成功",
|
||
|
|
"code": 200,
|
||
|
|
"data": {
|
||
|
|
"moduleId": 1,
|
||
|
|
"moduleName": "Sample Module",
|
||
|
|
"moduleCode": "sample",
|
||
|
|
// ... other SysModule fields
|
||
|
|
}
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 4. 新增功能模块 (Add Functional Module)
|
||
|
|
- **Description**: Creates a new functional module.
|
||
|
|
- **Permissions**: `generator:module:add`
|
||
|
|
- **HTTP Method**: `POST`
|
||
|
|
- **Endpoint**: `/`
|
||
|
|
- **Request Body**:
|
||
|
|
- `sysModule` (`SysModule`): The functional module object to create.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"moduleName": "New Module",
|
||
|
|
"moduleCode": "new_module",
|
||
|
|
"moduleDesc": "Description of new module",
|
||
|
|
"status": "0"
|
||
|
|
// ... other SysModule fields (moduleId is auto-generated)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: `AjaxResult` indicating success or failure.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"msg": "操作成功", // or error message
|
||
|
|
"code": 200, // or error code
|
||
|
|
"data": null // or generated ID (implementation dependent)
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 5. 修改功能模块 (Update Functional Module)
|
||
|
|
- **Description**: Updates an existing functional module.
|
||
|
|
- **Permissions**: `generator:module:edit`
|
||
|
|
- **HTTP Method**: `PUT`
|
||
|
|
- **Endpoint**: `/`
|
||
|
|
- **Request Body**:
|
||
|
|
- `sysModule` (`SysModule`): The functional module object to update. Must include `moduleId`.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"moduleId": 1,
|
||
|
|
"moduleName": "Updated Module Name",
|
||
|
|
"moduleCode": "updated_module_code",
|
||
|
|
// ... other SysModule fields to update
|
||
|
|
}
|
||
|
|
```
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: `AjaxResult` indicating success or failure.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"msg": "操作成功", // or error message
|
||
|
|
"code": 200 // or error code
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### 6. 删除功能模块 (Delete Functional Module)
|
||
|
|
- **Description**: Deletes one or more functional modules by their IDs.
|
||
|
|
- **Permissions**: `generator:module:remove`
|
||
|
|
- **HTTP Method**: `DELETE`
|
||
|
|
- **Endpoint**: `/{moduleIds}`
|
||
|
|
- **Path Variables**:
|
||
|
|
- `moduleIds` (Long[]): An array of functional module IDs to delete (e.g., `/1,2,3`).
|
||
|
|
- **Responses**:
|
||
|
|
- `200 OK`: `AjaxResult` indicating success or failure.
|
||
|
|
```json
|
||
|
|
{
|
||
|
|
"msg": "操作成功", // or error message
|
||
|
|
"code": 200 // or error code
|
||
|
|
}
|
||
|
|
```
|