Files
pyGoEdge-UserPanel/reference/goedge 文档/FileChunkService.md
2025-11-18 03:36:49 +08:00

2.0 KiB
Raw Permalink Blame History

FileChunkService

文件片段相关服务


createFileChunk

创建文件片段

  • 角色:admin
  • HTTPPOST https://backend.dooki.cloud/FileChunkService/createFileChunk
  • RPCrpc createFileChunk (CreateFileChunkRequest) returns (CreateFileChunkResponse);

请求对象 (CreateFileChunkRequest)

{
  "fileId": "int64 // 文件ID",
  "data": "bytes"
}

响应对象 (CreateFileChunkResponse)

{
  "fileChunkId": "int64"
}

调用示例

curl -X POST "https://backend.dooki.cloud/FileChunkService/createFileChunk" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

downloadFileChunk

下载文件片段

  • 角色:dns, user, node, admin
  • HTTPPOST https://backend.dooki.cloud/FileChunkService/downloadFileChunk
  • RPCrpc downloadFileChunk (DownloadFileChunkRequest) returns (DownloadFileChunkResponse);

请求对象 (DownloadFileChunkRequest)

{
  "fileChunkId": "int64"
}

响应对象 (DownloadFileChunkResponse)

{
  "fileChunk": "FileChunk"
}

调用示例

curl -X POST "https://backend.dooki.cloud/FileChunkService/downloadFileChunk" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'

findAllFileChunkIds

获取的一个文件的所有片段IDs

  • 角色:dns, user, node, admin
  • HTTPPOST https://backend.dooki.cloud/FileChunkService/findAllFileChunkIds
  • RPCrpc findAllFileChunkIds (FindAllFileChunkIdsRequest) returns (FindAllFileChunkIdsResponse);

请求对象 (FindAllFileChunkIdsRequest)

{
  "fileId": "int64 // 文件ID"
}

响应对象 (FindAllFileChunkIdsResponse)

{
  "fileChunkIds": "[]int64"
}

调用示例

curl -X POST "https://backend.dooki.cloud/FileChunkService/findAllFileChunkIds" \
  -H "Content-Type: application/json" \
  -H "X-Edge-Access-Token: <YOUR_TOKEN>" \
  -d '{
    ...
  }'