docs: 同步文件上传管理模块文档

更新内容:

1. API接口文档.md
   - 新增「十六、文件管理接口」章节(194行)
   - 7个核心接口文档:
     * 16.1 上传文件(multipart/form-data)
     * 16.2 分页查询文件列表
     * 16.3 根据业务类型和ID查询文件列表
     * 16.4 获取文件详情
     * 16.5 删除文件
     * 16.6 获取文件访问URL
     * 16.7 文件类型说明(支持的MIME类型)
   - 完整的请求参数、响应示例、字段说明
   - 文件类型白名单、大小限制说明
   - 调整附录章节编号为「十七」

2. 资金服务平台 FundPlatform 功能清单.md
   - 新增「4.1.3 文件管理」章节
   - 标记文件管理功能为已完成 
   - 添加实现状态说明:
     * 后端:FileRecord + FileRecordMapper + FileService + FileController
     * 前端:file.js + file.vue
     * 功能清单:12大功能点
     * 支持文件类型、存储方式、业务关联

文档与代码同步完成!
This commit is contained in:
zhangjf 2026-02-16 09:59:21 +08:00
parent 7fe78d6c19
commit c7904a9f8b
2 changed files with 215 additions and 3 deletions

View File

@ -2291,9 +2291,200 @@ X-Tenant-Id: 1
--- ---
## 十六、附录 ## 十六、文件管理接口
### 14.1 枚举值定义 ### 16.1 上传文件
**接口地址:** `POST /api/v1/file/upload`
**接口说明:** 上传文件到服务器
**请求参数multipart/form-data**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| file | File | 是 | 文件支持图片、PDF、Office文档、文本等 |
| businessType | String | 否 | 业务类型contract-合同receipt-收款凭证expense-支出凭证other-其他 |
| businessId | Long | 否 | 关联业务ID |
| uploadBy | Long | 否 | 上传人ID |
| uploadName | String | 否 | 上传人名称 |
**响应示例:**
```json
{
"code": 200,
"message": "操作成功",
"data": {
"fileId": 1,
"tenantId": 1,
"fileName": "a1b2c3d4e5f6.pdf",
"originalName": "合同附件.pdf",
"fileType": "application/pdf",
"fileSize": 1024567,
"filePath": "2026/02/13/a1b2c3d4e5f6.pdf",
"fileUrl": "/uploads/2026/02/13/a1b2c3d4e5f6.pdf",
"storageType": "local",
"businessType": "contract",
"businessId": 1001,
"uploadBy": 1,
"uploadName": "管理员",
"status": 1,
"createdTime": "2026-02-13 10:00:00"
}
}
```
---
### 16.2 分页查询文件列表
**接口地址:** `GET /api/v1/file/list`
**接口说明:** 分页查询文件列表
**请求参数:**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| current | Long | 否 | 当前页码默认1 |
| size | Long | 否 | 每页条数默认10 |
| fileName | String | 否 | 文件名(模糊查询) |
| businessType | String | 否 | 业务类型 |
| businessId | Long | 否 | 关联业务ID |
**响应示例:**
```json
{
"code": 200,
"message": "操作成功",
"data": {
"records": [
{
"fileId": 1,
"fileName": "a1b2c3d4e5f6.pdf",
"originalName": "合同附件.pdf",
"fileType": "application/pdf",
"fileSize": 1024567,
"fileUrl": "/uploads/2026/02/13/a1b2c3d4e5f6.pdf",
"businessType": "contract",
"businessId": 1001,
"uploadName": "管理员",
"createdTime": "2026-02-13 10:00:00"
}
],
"total": 50,
"size": 10,
"current": 1
}
}
```
---
### 16.3 根据业务类型和ID查询文件列表
**接口地址:** `GET /api/v1/file/list/business`
**接口说明:** 查询指定业务关联的所有文件
**请求参数:**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| businessType | String | 是 | 业务类型 |
| businessId | Long | 是 | 关联业务ID |
**响应示例:** 同16.2
---
### 16.4 获取文件详情
**接口地址:** `GET /api/v1/file/{fileId}`
**接口说明:** 根据ID查询文件详情
**路径参数:**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| fileId | Long | 是 | 文件ID |
**响应示例:** 同16.1
---
### 16.5 删除文件
**接口地址:** `DELETE /api/v1/file/{fileId}`
**接口说明:** 删除指定文件(物理+逻辑删除)
**路径参数:**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| fileId | Long | 是 | 文件ID |
**响应示例:**
```json
{
"code": 200,
"message": "删除成功",
"data": null
}
```
---
### 16.6 获取文件访问URL
**接口地址:** `GET /api/v1/file/{fileId}/url`
**接口说明:** 获取文件的访问URL
**路径参数:**
| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| fileId | Long | 是 | 文件ID |
**响应示例:**
```json
{
"code": 200,
"message": "操作成功",
"data": "/uploads/2026/02/13/a1b2c3d4e5f6.pdf"
}
```
---
### 16.7 文件类型说明
**支持的文件类型:**
| 类型 | MIME类型 |
|------|----------|
| 图片 | image/jpeg, image/png, image/gif, image/bmp |
| PDF | application/pdf |
| Word | application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| Excel | application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
| PPT | application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation |
| 文本 | text/plain, text/csv |
**限制:**
- 最大文件大小50MB
---
## 十七、附录
### 17.1 枚举值定义
#### 性别gender #### 性别gender

View File

@ -61,7 +61,28 @@
* 部门树选择器、岗位下拉选择 * 部门树选择器、岗位下拉选择
* 职位管理 * 职位管理
#### 4.1.3 系统配置 #### 4.1.3 文件管理 ✅
- 文件上传(合同附件、收款凭证、支出凭证) ✅
- 文件列表管理 ✅
- 文件预览图片、PDF
- 文件下载 ✅
- 文件删除 ✅
- **实现状态**:✅ 已完成
- 后端FileRecord + FileRecordMapper + FileService + FileController
- 前端file.js + file.vue
- 功能:
* 文件上传支持多类型图片、PDF、Office、文本
* 文件验证类型白名单、大小限制50MB
* 本地存储支持扩展至COS/OSS
* 按日期分目录存储
* UUID重命名防冲突
* 业务关联(合同/收款/支出/其他)
* 分页查询、按业务查询
* 图片/PDF预览
* 文件下载
* 物理+逻辑双删除
#### 4.1.4 系统配置
- 基础参数设置(公司信息、币种、日期格式等) - 基础参数设置(公司信息、币种、日期格式等)
--- ---