
# 合并文件（API名称：file/mergeFile）
#### 功能介绍
该接口用于大文件的分片文件合并。
#### 相关接口
| **接口名称**                                                             | **调用说明**                                                     |
|:---|:---|
| [获取Token](https://support.huaweicloud.com/api-isdp/api_01_0019.html) | 调用该接口获取到Token，再调用其他接口时，需要在请求消息头中添加"Authorization"，其值即为Token。 |
   
#### URL
| **请求方式** | **HTTPS地址**                                     | **服务架构** | **消息体类型**        |
|:---|:---|:---|:---|
| POST     | https://***isdp+域名***/openapi/v1/file/mergeFile | OpenAPI  | application/json |
   
#### 请求头
| **KEY**       | **VALUE**              | **是否必填** | **描述**                                                                                           |
|:---|:---|:---|:---|
| Content-Type  | application/json       | 是        | 无                                                                                                |
| Authorization | bearer ${access_token} | 是        | bearer +" "+[5.2.1](https://support.huaweicloud.com/api-isdp/api_01_0019.html)中获取的access_token的值 |
   
#### 请求参数
| **参数**      | **类型** | **是否必填** | **描述**    |
|:---|:---|:---|:---|
| hwFileId    | long   | 是        | 文件的GUID   |
| fileName    | String | 是        | 文件名称      |
| totalChunks | int    | 是        | 总片数，数值类型  |
| fileSize    | long   | 是        | 文件大小      |
| uploadId    | long   | 是        | 初始化时返回的ID |
| funcPoint   | String | 是        | 功能点       |
   
#### 响应参数
| 参数     | 类型     | 描述                    |
|:---|:---|:---|
| status | String | 状态，failed \| success。 |
| msg    | String | 消息。                   |
| data   | Object | 响应结果内容data。           |
   
data出参
| **字段名**         | **数据类型** | **字段名称**       |
|:---|:---|:---|
| filepath        | string   | 文件路口           |
| fileSize        | Long     | 文件大小           |
| microCode       | string   | 微码             |
| fileName        | string   | 文件名称           |
| storageMode     | string   | 存储模式           |
| objectName      | string   | 对象名称           |
| fileExt         | string   | 文件扩展名          |
| hwFileId        | long     | 文件的GUID        |
| uploadTime      | long     | 上传时间           |
| creationDate    | datetime | 创建时间           |
| createdBy       | string   | 创建人            |
| tenantId        | long     | 租户ID           |
| uploadUserId    | long     | 上传用户ID         |
| deleteFlag      | Integer  | 删除标识：0未删除，1已删除 |
| cryptMode       | String   | 加密模式           |
| funcPoint       | String   | 功能点            |
| entityName      | string   | 实体名称           |
| fileId          | long     | 文件id           |
| lastUpdatedBy   | string   | 最后更新人          |
| appName         | string   | app名称          |
| affectedRows    | Int      | 受影响的行数         |
| childObjectName | string   | 子对象名称          |
   
#### 请求示例
```
{
    "hwFileId": "01e72fe0-43b0-4b84-a843-d5c0b75d1e7e",
    "uploadId": "08d4d65b-0d8b-406f-892f-1dcac0908047",
    "funcPoint": "trainingCourseVideo",
    "fileName": "video.mp4",
    "totalChunks": 1,
    "fileSize": 9602614
}
```
#### 响应示例
```
{
    "status": "success",
    "msg": null,
    "data": {
        "filePath": null,
        "fileSize": 9602614,
        "microCode": "training-server",
        "fileName": "video.mp4",
        "storageMode": "local",
        "objectName": null,
        "fileExt": "mp4",
        "hwFileId": null,
        "uploadTime": "2024-04-18T07:46:03.680+00:00",
        "creationDate": "2024-04-18T07:46:03.717+00:00",
        "createdBy": 930234,
        "tenantId": 53955,
        "uploadUserId": 930234,
        "deleteFlag": 0,
        "cryptMode": null,
        "funcPoint": "trainingCourseVideo",
        "sourceTenantId": 53955,
        "entityName": "File",
        "fileId": 7671701,
        "lastUpdatedBy": 930234,
        "lastUpdateDate": "2024-04-18T07:46:03.717+00:00",
        "appName": "file-server",
        "affectedRows": 1,
        "childObjectName": null
    },
    "success": true,
    "failed": false
}
```
