2020-11-04 15:51:38 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
|
2021-01-25 16:41:30 +08:00
|
|
|
import "models/model_file_chunk.proto";
|
2020-11-04 15:51:38 +08:00
|
|
|
|
|
|
|
|
// 文件片段相关服务
|
|
|
|
|
service FileChunkService {
|
|
|
|
|
// 创建文件片段
|
|
|
|
|
rpc createFileChunk (CreateFileChunkRequest) returns (CreateFileChunkResponse);
|
|
|
|
|
|
|
|
|
|
// 获取的一个文件的所有片段IDs
|
|
|
|
|
rpc findAllFileChunkIds (FindAllFileChunkIdsRequest) returns (FindAllFileChunkIdsResponse);
|
|
|
|
|
|
|
|
|
|
// 下载文件片段
|
|
|
|
|
rpc downloadFileChunk (DownloadFileChunkRequest) returns (DownloadFileChunkResponse);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建文件片段
|
|
|
|
|
message CreateFileChunkRequest {
|
|
|
|
|
int64 fileId = 1;
|
|
|
|
|
bytes data = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateFileChunkResponse {
|
|
|
|
|
int64 fileChunkId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取的一个文件的所有片段IDs
|
|
|
|
|
message FindAllFileChunkIdsRequest {
|
|
|
|
|
int64 fileId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindAllFileChunkIdsResponse {
|
|
|
|
|
repeated int64 fileChunkIds = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 下载文件片段
|
|
|
|
|
message DownloadFileChunkRequest {
|
|
|
|
|
int64 fileChunkId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message DownloadFileChunkResponse {
|
|
|
|
|
FileChunk fileChunk = 1;
|
|
|
|
|
}
|