获取文件信息
- 请求地址 /v1/files/get
POST
- 请求方式 JSON/Http POST
- 请求参数
Properties | Type | Description |
---|---|---|
uuid | string | UUID(该文件的唯一ID) |
path | string | 该文件的路径,与uuid二选一 |
文件Metadata
文件Meta信息如下:
Properties | Type | Description |
---|---|---|
uuid | string | 该文件/文件夹的唯一ID |
name | string | 文件名 |
mime | string | 文件mime,即文件的类型 |
type | int | 0:为文件,1:目录 |
parent | string | 父目录id |
ctime | long | 文件创建时间 |
mtime | long | 文件修改时间 |
atime | long | 文件访问时间 |
userId | long | 用户id |
path | string | 该文件或文件夹的访问路径 |
size | long | 文件大小(字节) |
flag | int | 总是 0 |
preview | int | 预览状态 |
version | int | 文件版本 |
locking | bool | 是否锁定 |
opt | int | 如果锁定 |
locking | bool | 文件锁定的情况下,当前后台正进行的操作 |
downloadAddress | string | 文件下载地址 |
示例
- 使用uuid获取文件(不推荐)
发送 /v1/files/get :
{
"uuid":"478d34b61e821e858779ab30b9b35683"
}
收到:
{
"status": 200,
"result": {
"uuid": "478d34b61e821e858779ab30b9b35683",
"storeId": "FmvrHK0ARV0-peebgQ6rActWUDKy",
"userId": 5,
"path": "/:torrent/CentOS-7-x86_64-NetInstall-1804.torrent",
"name": "CentOS-7-x86_64-NetInstall-1804.torrent",
"ext": ".torrent",
"size": 173066,
"parent": "c8a9de93f7fd91ff7297d5ee0fcd79af",
"type": 0,
"atime": 1533981743978,
"ctime": 1533981743978,
"mtime": 0,
"version": 0,
"locking": false,
"opt": 0,
"mime": "application/x-bittorrent",
"preview": 0,
"flag": 0,
"downloadAddress": "https://download-test.blog120.com/cloud_store/FmvrHK0ARV0-peebgQ6rActWUDKy.torrent?userId=5&wsSecret=a0433fbf96dbc2212f05da9f08a07164&wsTime=5b928d6a"
},
"code": "OK",
"success": true,
"token": "..."
}
- 使用path获取文件(推荐)
发送 /v1/files/get :
{
"path":"/d/e/f/5系标轴.pdf.asset.1518484456597.pdf"
}
收到:
{
"status": 200,
"result": {
"uuid": "478d34b61e821e858779ab30b9b35683",
"storeId": "FmvrHK0ARV0-peebgQ6rActWUDKy",
"userId": 5,
"path": "/:torrent/CentOS-7-x86_64-NetInstall-1804.torrent",
"name": "CentOS-7-x86_64-NetInstall-1804.torrent",
"ext": ".torrent",
"size": 173066,
"parent": "c8a9de93f7fd91ff7297d5ee0fcd79af",
"type": 0,
"atime": 1533981743978,
"ctime": 1533981743978,
"mtime": 0,
"version": 0,
"locking": false,
"opt": 0,
"mime": "application/x-bittorrent",
"preview": 0,
"flag": 0,
"downloadAddress": "https://download-test.blog120.com/cloud_store/FmvrHK0ARV0-peebgQ6rActWUDKy.torrent?userId=5&wsSecret=a0433fbf96dbc2212f05da9f08a07164&wsTime=5b928d6a"
},
"code": "OK",
"success": true,
"token": "..."
}