553 lines
15 KiB
Markdown
553 lines
15 KiB
Markdown
# Disk
|
|
|
|
云盘目录服务
|
|
|
|
- [/cloud.Disk/CreateDir](#clouddiskcreatedir)
|
|
- [/cloud.Disk/GetDir](#clouddiskgetdir)
|
|
- [/cloud.Disk/UpdateDir](#clouddiskupdatedir)
|
|
- [/cloud.Disk/DeleteDir](#clouddiskdeletedir)
|
|
- [/cloud.Disk/ListDirs](#clouddisklistdirs)
|
|
- [/cloud.Disk/GetDirTree](#clouddiskgetdirtree)
|
|
- [/cloud.Disk/MoveDir](#clouddiskmovedir)
|
|
- [/cloud.Disk/UploadFile](#clouddiskuploadfile)
|
|
- [/cloud.Disk/GetFile](#clouddiskgetfile)
|
|
- [/cloud.Disk/UpdateFile](#clouddiskupdatefile)
|
|
- [/cloud.Disk/DeleteFile](#clouddiskdeletefile)
|
|
- [/cloud.Disk/ListFiles](#clouddisklistfiles)
|
|
- [/cloud.Disk/MoveFile](#clouddiskmovefile)
|
|
- [/cloud.Disk/CopyFile](#clouddiskcopyfile)
|
|
- [/cloud.Disk/SearchFiles](#clouddisksearchfiles)
|
|
|
|
## /cloud.Disk/CreateDir
|
|
|
|
创建目录
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
cloud_id: "0", // type<uint64>
|
|
cloud_identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/GetDir
|
|
|
|
获取目录详情
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<int64>, 唯一ID
|
|
identity: "", // type<string>, 唯一码
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>, 文件
|
|
}
|
|
```
|
|
## /cloud.Disk/UpdateDir
|
|
|
|
更新目录
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>, 文件
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/DeleteDir
|
|
|
|
删除目录
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<int64>, 唯一ID
|
|
identity: "", // type<string>, 唯一码
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/ListDirs
|
|
|
|
获取目录列表
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
page_no: "0", // type<int64>, 页数
|
|
page_size: "0", // type<int64>, 每页记录数
|
|
params: {
|
|
"": ""
|
|
}, // map<string,string>, 条件参数,key=val,eg key:category_id=?,vlaue=11
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
dirs: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>, 文件
|
|
}], // list<CloudDiskDirItem>
|
|
total: "0", // type<int64>
|
|
}
|
|
```
|
|
## /cloud.Disk/GetDirTree
|
|
|
|
获取目录树
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<int64>, 唯一ID
|
|
identity: "", // type<string>, 唯一码
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>, 文件
|
|
}
|
|
```
|
|
## /cloud.Disk/MoveDir
|
|
|
|
移动目录
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
new_parent_id: "0", // type<uint64>
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/UploadFile
|
|
|
|
上传文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
cloud_id: "0", // type<uint64>
|
|
cloud_identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/GetFile
|
|
|
|
获取文件详情
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<int64>, 唯一ID
|
|
identity: "", // type<string>, 唯一码
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{}], // list<CloudDiskFileItem>, 文件
|
|
}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}
|
|
```
|
|
## /cloud.Disk/UpdateFile
|
|
|
|
更新文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{}], // list<CloudDiskFileItem>, 文件
|
|
}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/DeleteFile
|
|
|
|
删除文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<int64>, 唯一ID
|
|
identity: "", // type<string>, 唯一码
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/ListFiles
|
|
|
|
获取文件列表
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
page_no: "0", // type<int64>, 页数
|
|
page_size: "0", // type<int64>, 每页记录数
|
|
params: {
|
|
"": ""
|
|
}, // map<string,string>, 条件参数,key=val,eg key:category_id=?,vlaue=11
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{}], // list<CloudDiskFileItem>, 文件
|
|
}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>
|
|
total: "0", // type<int64>
|
|
}
|
|
```
|
|
## /cloud.Disk/MoveFile
|
|
|
|
移动文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
new_directory_id: "0", // type<uint64>
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/CopyFile
|
|
|
|
复制文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
id: "0", // type<uint64>
|
|
target_directory_id: "0", // type<uint64>
|
|
new_name: "", // type<string>
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
code: 0, // type<int32>, 状态码
|
|
message: "", // type<string>, 状态说明
|
|
details: "", // type<string>, 数据
|
|
timeseq: "0", // type<int64>, 响应时间序列
|
|
}
|
|
```
|
|
## /cloud.Disk/SearchFiles
|
|
|
|
搜索文件
|
|
|
|
|
|
### Request
|
|
```javascript
|
|
{
|
|
page_no: "0", // type<int64>, 页数
|
|
page_size: "0", // type<int64>, 每页记录数
|
|
params: {
|
|
"": ""
|
|
}, // map<string,string>, 条件参数,key=val,eg key:category_id=?,vlaue=11
|
|
}
|
|
```
|
|
|
|
### Reply
|
|
```javascript
|
|
{
|
|
files: [{
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
directory_id: "0", // type<uint64>, 文件所属目录
|
|
name: "", // type<string>, 文件名
|
|
original_name: "", // type<string>, 原始文件名
|
|
size: "0", // type<int64>, 文件大小 (bytes)
|
|
mime_type: "", // type<string>, 文件类型
|
|
storage_path: "", // type<string>, 实际存储路径
|
|
hash: "", // type<string>, 文件哈希,用于去重
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 关联关系
|
|
directory: {
|
|
id: "0", // type<uint64>
|
|
identity: "", // type<string>
|
|
parent_id: "0", // type<uint64>, 支持嵌套目录
|
|
name: "", // type<string>, 目录名称
|
|
path: "", // type<string>, 完整路径
|
|
created_at: "", // type<string>
|
|
updated_at: "", // type<string>
|
|
// 自关联
|
|
parent: {}, // type<CloudDiskDirItem>, 父级目录
|
|
subdirectories: [{}], // list<CloudDiskDirItem>, 子级目录
|
|
files: [{}], // list<CloudDiskFileItem>, 文件
|
|
}, // type<CloudDiskDirItem>, 文件所属目录
|
|
}], // list<CloudDiskFileItem>
|
|
total: "0", // type<int64>
|
|
}
|
|
```
|
|
|