feat: rbac完善,file接入完成
This commit is contained in:
@@ -42,6 +42,108 @@ message GetFilesByIdsResp {
|
||||
repeated FileInfo files = 1;
|
||||
}
|
||||
|
||||
// ---------- 存储配置 ----------
|
||||
|
||||
message StorageConfigInfo {
|
||||
string id = 1;
|
||||
string type = 2;
|
||||
string name = 3;
|
||||
string endpoint = 4;
|
||||
string accessKeyId = 5;
|
||||
string accessKeySecret = 6;
|
||||
string bucketName = 7;
|
||||
string bucketUrl = 8;
|
||||
string region = 9;
|
||||
int32 isDefault = 10;
|
||||
int32 status = 11;
|
||||
string remark = 12;
|
||||
}
|
||||
|
||||
message CreateStorageConfigReq {
|
||||
string type = 1;
|
||||
string name = 2;
|
||||
string endpoint = 3;
|
||||
string accessKeyId = 4;
|
||||
string accessKeySecret = 5;
|
||||
string bucketName = 6;
|
||||
string bucketUrl = 7;
|
||||
string region = 8;
|
||||
int32 status = 9;
|
||||
string remark = 10;
|
||||
}
|
||||
|
||||
message UpdateStorageConfigReq {
|
||||
string id = 1;
|
||||
string type = 2;
|
||||
string name = 3;
|
||||
string endpoint = 4;
|
||||
string accessKeyId = 5;
|
||||
string accessKeySecret = 6;
|
||||
string bucketName = 7;
|
||||
string bucketUrl = 8;
|
||||
string region = 9;
|
||||
int32 status = 10;
|
||||
string remark = 11;
|
||||
}
|
||||
|
||||
message SetDefaultStorageConfigReq {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message StorageConfigListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string type = 3;
|
||||
string name = 4;
|
||||
}
|
||||
|
||||
message StorageConfigListResp {
|
||||
repeated StorageConfigInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
message GetDefaultStorageConfigReq {}
|
||||
message GetDefaultStorageConfigResp {
|
||||
StorageConfigInfo config = 1;
|
||||
}
|
||||
|
||||
message CreateFileReq {
|
||||
string name = 1;
|
||||
string url = 2;
|
||||
string tag = 3;
|
||||
string key = 4;
|
||||
string suffix = 5;
|
||||
string md5 = 6;
|
||||
}
|
||||
|
||||
message CreateFileResp {
|
||||
FileInfo file = 1;
|
||||
}
|
||||
|
||||
message CheckFileByMd5Req {
|
||||
string md5 = 1;
|
||||
}
|
||||
|
||||
message CheckFileByMd5Resp {
|
||||
bool exists = 1;
|
||||
FileInfo file = 2;
|
||||
}
|
||||
|
||||
message DeleteFilesReq {
|
||||
repeated string ids = 1;
|
||||
}
|
||||
|
||||
message GetFileListReq {
|
||||
int32 current = 1;
|
||||
int32 pageSize = 2;
|
||||
string name = 3;
|
||||
}
|
||||
|
||||
message GetFileListResp {
|
||||
repeated FileInfo list = 1;
|
||||
int64 total = 2;
|
||||
}
|
||||
|
||||
// ---------- 服务定义 ----------
|
||||
|
||||
service FileService {
|
||||
@@ -49,4 +151,20 @@ service FileService {
|
||||
rpc GetFileById(GetFileByIdReq) returns (GetFileByIdResp);
|
||||
// 根据ID列表批量获取文件信息
|
||||
rpc GetFilesByIds(GetFilesByIdsReq) returns (GetFilesByIdsResp);
|
||||
// 创建文件记录
|
||||
rpc CreateFile(CreateFileReq) returns (CreateFileResp);
|
||||
// 通过MD5检查文件是否存在
|
||||
rpc CheckFileByMd5(CheckFileByMd5Req) returns (CheckFileByMd5Resp);
|
||||
// 删除文件记录
|
||||
rpc DeleteFiles(DeleteFilesReq) returns (CommonResp);
|
||||
// 获取文件列表
|
||||
rpc GetFileList(GetFileListReq) returns (GetFileListResp);
|
||||
|
||||
// ---------- 存储配置 ----------
|
||||
rpc CreateStorageConfig(CreateStorageConfigReq) returns (CommonResp);
|
||||
rpc UpdateStorageConfig(UpdateStorageConfigReq) returns (CommonResp);
|
||||
rpc DeleteStorageConfig(DeleteFilesReq) returns (CommonResp); // 复用idsReq
|
||||
rpc SetDefaultStorageConfig(SetDefaultStorageConfigReq) returns (CommonResp);
|
||||
rpc GetStorageConfigList(StorageConfigListReq) returns (StorageConfigListResp);
|
||||
rpc GetDefaultStorageConfig(GetDefaultStorageConfigReq) returns (GetDefaultStorageConfigResp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user