杂务:新增声明级注释覆盖率
This commit is contained in:
@@ -6,6 +6,10 @@ import type { AxiosProgressEvent } from 'axios'
|
||||
import api from './index'
|
||||
import type { IdType } from '@/utils/id'
|
||||
|
||||
/**
|
||||
* Purpose: ChunkUploadInitRequest supports file.ts by holding or executing the chunk upload init request page or API role.
|
||||
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
export interface ChunkUploadInitRequest {
|
||||
fileName: string
|
||||
fileSize: number
|
||||
@@ -14,6 +18,10 @@ export interface ChunkUploadInitRequest {
|
||||
scene: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: ChunkUploadSessionVO supports file.ts by holding or executing the chunk upload session vo page or API role.
|
||||
* Usage: import, call, read, or update this interface from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
export interface ChunkUploadSessionVO {
|
||||
uploadId: string
|
||||
chunkSize: number
|
||||
@@ -49,6 +57,10 @@ export const fileApi = {
|
||||
return api.post<ChunkUploadSessionVO>('/user/upload-avatar/init', data) as unknown as Promise<ChunkUploadSessionVO>
|
||||
},
|
||||
uploadAvatarChunk: (
|
||||
/**
|
||||
* Purpose: data supports file.ts by holding or executing the data page or API role.
|
||||
* Usage: import, call, read, or update this page-data from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
data: { uploadId: string; chunkIndex: number; totalChunks: number; chunk: Blob },
|
||||
config?: { signal?: AbortSignal; onUploadProgress?: (event: AxiosProgressEvent) => void }
|
||||
) => {
|
||||
@@ -58,10 +70,22 @@ export const fileApi = {
|
||||
formData.append('totalChunks', String(data.totalChunks))
|
||||
formData.append('chunk', data.chunk)
|
||||
return api.post<boolean>('/user/upload-avatar/chunk', formData, {
|
||||
/**
|
||||
* Purpose: headers supports file.ts by holding or executing the headers page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
/**
|
||||
* Purpose: signal supports file.ts by holding or executing the signal page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
signal: config?.signal,
|
||||
/**
|
||||
* Purpose: onUploadProgress supports file.ts by holding or executing the on upload progress page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
onUploadProgress: config?.onUploadProgress
|
||||
})
|
||||
},
|
||||
@@ -90,6 +114,10 @@ export const fileApi = {
|
||||
*/
|
||||
getSignedUrl: (fileId: IdType, expiryTimeInMinutes?: number) => {
|
||||
return api.get<string>(`/file/get-signed-url/${fileId}`, {
|
||||
/**
|
||||
* Purpose: params supports file.ts by holding or executing the params page or API role.
|
||||
* Usage: import, call, read, or update this page-data-field from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
params: { expiryTimeInMinutes }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user