PlainApp
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 }
}