Skip to content

Commit

Permalink
Fix/更新file rpc (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
Love-YeLin authored Apr 9, 2024
1 parent 29ec843 commit 5cc76a7
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 254 deletions.
19 changes: 6 additions & 13 deletions cloudmind/content/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ message Tag {
string fatherTagId = 2;
}

message FileInfo {
string fileId = 1;
message File {
string id = 1;
string userId = 2;
string name = 3;
string type = 4;
Expand All @@ -99,11 +99,10 @@ message FileInfo {
int64 createAt = 15;
int64 updateAt = 16;
int64 deleteAt = 17;

}

message File {
string fileId = 1;
//message File {
string id = 1;
string userId = 2;
string name = 3;
string type = 4;
Expand All @@ -118,20 +117,14 @@ message File {
repeated string labels = 13;
int64 category = 14;
int64 auditStatus = 15;
}
//}

message FileParameter {
string fileId = 1;
string id = 1;
string path = 2;
int64 spaceSize = 3;
}

message Zone {
string id = 1;
string fatherId = 2;
string value = 3;
}

message ShareFile {
string code = 1;
string userId = 2;
Expand Down
130 changes: 61 additions & 69 deletions cloudmind/content/content.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,36 @@ message GetFileIsExistResp {
}

message GetFileReq{
string fileId = 1;
string id = 1;
bool isGetSize = 2;
}

message GetFileResp{
FileInfo file = 1;
string id = 1;
string userId = 2;
string name = 3;
string type = 4;
string path = 5;
string fatherId = 6;
int64 spaceSize = 7;
string md5 = 8;
int64 isDel = 9;
string zone = 10;
string subZone = 11;
string description = 12;
repeated string labels = 13;
int64 auditStatus = 14;
int64 createAt = 15;
int64 updateAt = 16;
int64 deleteAt = 17;
}

message GetFilesByIdsReq{
repeated string fileIds = 1;
repeated string ids = 1;
}

message GetFilesByIdsResp{
repeated FileInfo files = 1;
repeated File files = 1;
}

message GetFileListReq{
Expand All @@ -37,7 +53,7 @@ message GetFileListReq{
}

message GetFileListResp{
repeated FileInfo files = 1;
repeated File files = 1;
int64 total = 2;
string token = 3;
string fatherNamePath = 4;
Expand All @@ -50,37 +66,46 @@ message GetRecycleBinFilesReq{
}

message GetRecycleBinFilesResp{
repeated FileInfo files = 1;
repeated File files = 1;
int64 total = 2;
string token = 3;
}

message GetFileBySharingCodeReq{
repeated string fileIds = 1;
repeated string ids = 1;
optional string onlyFatherId = 2;
optional basic.PaginationOptions paginationOptions = 3;
optional SortOptions sortOptions = 4;
}

message GetFileBySharingCodeResp{
repeated FileInfo files = 1;
repeated File files = 1;
int64 total = 2;
string token = 3;
string fatherNamePath = 4;
string fatherIdPath = 5;
}

message CreateFileReq{
File file = 1;
string userId = 1;
string name = 2;
string type = 3;
string fatherId = 4;
int64 spaceSize = 5;
string md5 = 6;
int64 category = 7;
}

message CreateFileResp{
string fileId = 1;
string id = 1;
string name = 2;
}

message UpdateFileReq{
File file = 1;
string id = 1;
string userId = 2;
string name = 3;
int64 auditStatus = 4;
}

message UpdateFileResp{
Expand All @@ -90,7 +115,7 @@ message UpdateFileResp{
message MoveFileReq{
string fatherId = 1;
string newPath = 2;
string fileId = 3;
string id = 3;
string oldPath = 4;
int64 spaceSize = 5;
string name = 6;
Expand All @@ -101,7 +126,7 @@ message MoveFileResp{
}

message SaveFileToPrivateSpaceReq{
string fileId = 1;
string id = 1;
string userId = 2;
string newPath = 3;
string fatherId = 4;
Expand All @@ -113,12 +138,12 @@ message SaveFileToPrivateSpaceReq{
}

message SaveFileToPrivateSpaceResp{
string fileId = 1;
string id = 1;
string name = 2;
}

message AddFileToPublicSpaceReq{
string fileId = 1;
string id = 1;
string path = 2;
int64 spaceSize = 3;
string zone = 4;
Expand All @@ -128,7 +153,7 @@ message AddFileToPublicSpaceReq{
}

message AddFileToPublicSpaceResp{
repeated string fileIds = 1;
repeated string ids = 1;
}

message CompletelyRemoveFileReq {
Expand All @@ -140,7 +165,7 @@ message CompletelyRemoveFileResp {
}

message MakeFilePrivateReq{
string fileId = 1;
string id = 1;
string userId = 2;
}

Expand Down Expand Up @@ -171,58 +196,21 @@ message RecoverRecycleBinFileReq{
message RecoverRecycleBinFileResp{
}

message CreateZoneReq {
Zone zone = 1;
}

message CreateZoneResp {
string id = 1;
}

message GetZoneReq {
string id = 1;
}

message GetZoneResp {
Zone zone = 1;
}

message GetZonesReq {
string fatherId= 1;
optional basic.PaginationOptions paginationOptions = 2;
}

message GetZonesResp {
repeated Zone zones = 1;
int64 total = 2;
string token = 3;
}

message UpdateZoneReq {
Zone zone = 1;
}

message UpdateZoneResp {
}

message DeleteZoneReq {
string id = 1;
}

message DeleteZoneResp {
}

message CheckShareFileReq{
repeated string fileIds = 1;
string fileId = 2;
repeated string fileIds = 1; // 分享链接中的文件id列表
string id = 2; // 要保存到的目标文件夹id

}

message CheckShareFileResp{
bool ok = 1;
}

message CreateShareCodeReq {
ShareFile shareFile = 1;
string userId = 1;
string name = 2;
int64 effectiveTime = 3;
repeated string fileList = 4;
}

message CreateShareCodeResp {
Expand All @@ -231,7 +219,7 @@ message CreateShareCodeResp {
}

message GetShareListReq {
optional ShareFileFilterOptions shareFileFilterOptions = 1;
optional ShareFileFilterOptions filterOptions = 1;
optional basic.PaginationOptions paginationOptions = 2;
}

Expand All @@ -242,7 +230,9 @@ message GetShareListResp {
}

message UpdateShareCodeReq {
ShareFile shareFile = 1;
string code = 1;
string name = 2;
int64 browseNumber = 3;
}

message UpdateShareCodeResp {
Expand All @@ -260,7 +250,14 @@ message ParsingShareCodeReq {
}

message ParsingShareCodeResp {
ShareFile shareFile = 1;
string userId = 1;
string name = 2;
int64 status = 3;
int64 effectiveTime = 4;
int64 browseNumber = 5;
int64 createAt = 6;
repeated string fileList = 7;
string key = 8;
}

message UpdateUserReq{
Expand Down Expand Up @@ -563,11 +560,6 @@ service ContentService {
rpc DeleteFile(DeleteFileReq) returns(DeleteFileResp);
rpc EmptyRecycleBin(EmptyRecycleBinReq) returns(EmptyRecycleBinResp);
rpc RecoverRecycleBinFile(RecoverRecycleBinFileReq) returns(RecoverRecycleBinFileResp);
rpc GetZone(GetZoneReq) returns(GetZoneResp);
rpc GetZones(GetZonesReq) returns(GetZonesResp);
rpc CreateZone(CreateZoneReq) returns(CreateZoneResp);
rpc UpdateZone(UpdateZoneReq) returns(UpdateZoneResp);
rpc DeleteZone(DeleteZoneReq) returns(DeleteZoneResp);
rpc GetShareList(GetShareListReq) returns(GetShareListResp);
rpc CheckShareFile(CheckShareFileReq) returns(CheckShareFileResp);
rpc CreateShareCode(CreateShareCodeReq) returns(CreateShareCodeResp);
Expand Down
Loading

0 comments on commit 5cc76a7

Please sign in to comment.