78 lines
1.4 KiB
TypeScript
78 lines
1.4 KiB
TypeScript
// 分片上传相关的API接口定义
|
||
|
||
/**
|
||
* 文件分片请求接口
|
||
*/
|
||
export interface UploadChunkRequest {
|
||
/** 文件唯一标识 */
|
||
fileId: string;
|
||
/** 分片索引,从0开始 */
|
||
chunkIndex: number;
|
||
/** 总分片数量 */
|
||
totalChunks: number;
|
||
/** 分片大小 */
|
||
chunkSize: number;
|
||
/** 文件总大小 */
|
||
totalSize: number;
|
||
/** 文件名称 */
|
||
fileName: string;
|
||
/** 文件类型 */
|
||
fileType: string;
|
||
}
|
||
|
||
/**
|
||
* 文件分片响应接口
|
||
*/
|
||
export interface UploadChunkResponse {
|
||
success: boolean;
|
||
message: string;
|
||
chunkIndex: number;
|
||
uploadedSize: number;
|
||
isLastChunk?: boolean;
|
||
}
|
||
|
||
/**
|
||
* 合并分片请求接口
|
||
*/
|
||
export interface MergeChunksRequest {
|
||
/** 文件唯一标识 */
|
||
fileId: string;
|
||
/** 总分片数量 */
|
||
totalChunks: number;
|
||
/** 文件名称 */
|
||
fileName: string;
|
||
/** 文件类型 */
|
||
fileType: string;
|
||
/** 文件总大小 */
|
||
totalSize: number;
|
||
}
|
||
|
||
/**
|
||
* 合并分片响应接口
|
||
*/
|
||
export interface MergeChunksResponse {
|
||
success: boolean;
|
||
message: string;
|
||
fileUrl?: string;
|
||
fileId: string;
|
||
fileSize: number;
|
||
}
|
||
|
||
/**
|
||
* 检查文件上传状态请求接口
|
||
*/
|
||
export interface CheckUploadStatusRequest {
|
||
/** 文件唯一标识 */
|
||
fileId: string;
|
||
}
|
||
|
||
/**
|
||
* 检查文件上传状态响应接口
|
||
*/
|
||
export interface CheckUploadStatusResponse {
|
||
success: boolean;
|
||
isUploaded: boolean;
|
||
uploadedChunks: number[];
|
||
totalChunks?: number;
|
||
}
|