API 参考
应用附件
查询应用附件及数量,将上传分片合并为附件,并释放附件引用。
类型定义
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
}操作
mutation
mergeAppFileChunks
开始将已上传分块合并为应用管理的附件;通过 mergeStatus 检查完成状态。
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
释放指定的应用管理附件引用。
graphql
mutation releaseAppFile($fileId: String!) {
releaseAppFile(fileId: $fileId)
}query
appFileCount
统计符合查询条件的应用管理附件记录数。
graphql
query appFileCount($query: String!) {
appFileCount(query: $query)
}query
appFiles
分页读取符合查询条件的应用管理附件记录。
graphql
query appFiles($query: String!, $offset: Int!, $limit: Int!) {
appFiles(query: $query, offset: $offset, limit: $limit) { id size mimeType fileName realPath createdAt updatedAt }
}