获取文件信息

  • 请求地址 /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 :

  1. {
  2. "uuid":"478d34b61e821e858779ab30b9b35683"
  3. }

收到:

  1. {
  2. "status": 200,
  3. "result": {
  4. "uuid": "478d34b61e821e858779ab30b9b35683",
  5. "storeId": "FmvrHK0ARV0-peebgQ6rActWUDKy",
  6. "userId": 5,
  7. "path": "/:torrent/CentOS-7-x86_64-NetInstall-1804.torrent",
  8. "name": "CentOS-7-x86_64-NetInstall-1804.torrent",
  9. "ext": ".torrent",
  10. "size": 173066,
  11. "parent": "c8a9de93f7fd91ff7297d5ee0fcd79af",
  12. "type": 0,
  13. "atime": 1533981743978,
  14. "ctime": 1533981743978,
  15. "mtime": 0,
  16. "version": 0,
  17. "locking": false,
  18. "opt": 0,
  19. "mime": "application/x-bittorrent",
  20. "preview": 0,
  21. "flag": 0,
  22. "downloadAddress": "https://download-test.blog120.com/cloud_store/FmvrHK0ARV0-peebgQ6rActWUDKy.torrent?userId=5&wsSecret=a0433fbf96dbc2212f05da9f08a07164&wsTime=5b928d6a"
  23. },
  24. "code": "OK",
  25. "success": true,
  26. "token": "..."
  27. }
  • 使用path获取文件(推荐)

发送 /v1/files/get :

  1. {
  2. "path":"/d/e/f/5系标轴.pdf.asset.1518484456597.pdf"
  3. }

收到:

  1. {
  2. "status": 200,
  3. "result": {
  4. "uuid": "478d34b61e821e858779ab30b9b35683",
  5. "storeId": "FmvrHK0ARV0-peebgQ6rActWUDKy",
  6. "userId": 5,
  7. "path": "/:torrent/CentOS-7-x86_64-NetInstall-1804.torrent",
  8. "name": "CentOS-7-x86_64-NetInstall-1804.torrent",
  9. "ext": ".torrent",
  10. "size": 173066,
  11. "parent": "c8a9de93f7fd91ff7297d5ee0fcd79af",
  12. "type": 0,
  13. "atime": 1533981743978,
  14. "ctime": 1533981743978,
  15. "mtime": 0,
  16. "version": 0,
  17. "locking": false,
  18. "opt": 0,
  19. "mime": "application/x-bittorrent",
  20. "preview": 0,
  21. "flag": 0,
  22. "downloadAddress": "https://download-test.blog120.com/cloud_store/FmvrHK0ARV0-peebgQ6rActWUDKy.torrent?userId=5&wsSecret=a0433fbf96dbc2212f05da9f08a07164&wsTime=5b928d6a"
  23. },
  24. "code": "OK",
  25. "success": true,
  26. "token": "..."
  27. }