Tham chiếu API
Tệp đính kèm ứng dụng
Liệt kê và đếm tệp đính kèm ứng dụng, hợp nhất các phần đã tải lên và giải phóng tham chiếu đến tệp đính kèm.
Định nghĩa kiểu
graphql
type Mutation {
mergeAppFileChunks(fileId: String!, totalChunks: Int!, fileName: String!, totalSize: Long!): MergeTask!
releaseAppFile(fileId: String!): Boolean!
}
type Query {
appFileCount(query: String!): Int!
appFiles(query: String!, offset: Int!, limit: Int!): [AppFile!]!
}
type AppFile {
id: String!
size: Long!
mimeType: String!
fileName: String!
realPath: String!
createdAt: Instant!
updatedAt: Instant!
}
scalar Instant
scalar Long
type MergeTask {
status: MergeTaskStatus!
value: String
mergedSize: Long
error: String
}
enum MergeTaskStatus {
NONE
STARTED
MERGING
DONE
FAILED
}Thao tác
mutation
mergeAppFileChunks
Bắt đầu ghép các khối đã tải lên thành tệp đính kèm do ứng dụng quản lý; kiểm tra mergeStatus để biết hoàn tất.
graphql
mutation mergeAppFileChunks($fileId: String!, $totalChunks: Int!, $fileName: String!, $totalSize: Long!) {
mergeAppFileChunks(fileId: $fileId, totalChunks: $totalChunks, fileName: $fileName, totalSize: $totalSize) { status value mergedSize error }
}mutation
releaseAppFile
Giải phóng tham chiếu tệp đính kèm do ứng dụng quản lý đã chỉ định.
graphql
mutation releaseAppFile($fileId: String!) {
releaseAppFile(fileId: $fileId)
}query
appFileCount
Đếm bản ghi tệp đính kèm do ứng dụng quản lý khớp truy vấn.
graphql
query appFileCount($query: String!) {
appFileCount(query: $query)
}query
appFiles
Đọc một trang bản ghi tệp đính kèm do ứng dụng quản lý khớp truy vấn.
graphql
query appFiles($query: String!, $offset: Int!, $limit: Int!) {
appFiles(query: $query, offset: $offset, limit: $limit) { id size mimeType fileName realPath createdAt updatedAt }
}