# 管理

# 单个查询

GET http://resource-service.qiqiuyun.net/resources/{no}

参数:

字段 类型 必需 描述
no string 云资源编号

响应:

资源实体如:
{
    "no": "d65e909288324eb09e1109e22784a38c",
    "extno": "test",
    "isShare": "0",
    "name": "hahaha.mp4",
    "type": "video",
    "size": "0",
    "length": "0",
    "thumbnail": [],
    "processStatus": "none",
    "processedTime": "0",
    "createdTime": "1575440797",
    "updatedTime": "1575797010"
}

# 列表查询

GET http://resource-service.qiqiuyun.net/resources

参数:

字段 类型 必需 描述
type string 'document','video','audio','image','ppt','flash','subtitle','other'
processStatus string 'none','processing','ok','error'
start int 查询起始的偏移量
limit int 返回数量

响应:

资源实体如:
[
    {
        "no": "fa1b570ad7e64509b49d8ee9e77ee0ec",
        "extno": "4",
        "isShare": "0",
        "name": "视频动态指纹工作原理及流程.docx",
        "type": "document",
        "size": "1211176",
        "length": "45",
        "thumbnail": "/coursematerial-15/20190716113537-706sf5sui70gwwsg/16579533a5ae6dd5_thumb?e=1575826675&token=6uEqT5vwuQIM4p1vkf7bk6GHshgNofDb_SYHvabL:KODEDlkyxHihyPwBB6nUm_dcCXU=",
        "processStatus": "ok",
        "processedTime": "0",
        "createdTime": "0",
        "updatedTime": "0"
    },
    {
        "no": "b333d0e72229453696a818eca075352e",
        "extno": "5",
        "isShare": "0",
        "name": "第08讲.ppt",
        "type": "ppt",
        "size": "609280",
        "length": "22",
        "thumbnail": "/coursematerial-9/20190904062557-5xvqov4o73ks4csc/d18b4d915a2168f8_thumb?e=1575826675&token=6uEqT5vwuQIM4p1vkf7bk6GHshgNofDb_SYHvabL:vmoIZFQr99pMBIoJ2DTLCgXTC1Y=",
        "processStatus": "ok",
        "processedTime": "0",
        "createdTime": "0",
        "updatedTime": "1574095269"
    }
]

# 修改

PUT http://resource-service.qiqiuyun.net/resources/{no}/name

参数:

字段 类型 必需 描述
no string 云资源编号
name string 文件名

响应:

资源实体如:
{
    "no": "d65e909288324eb09e1109e22784a38c",
    "extno": "test",
    "isShare": "0",
    "name": "hahaha.mp4",
    "type": "video",
    "size": "0",
    "length": "0",
    "thumbnail": [],
    "processStatus": "none",
    "processedTime": "0",
    "createdTime": "1575440797",
    "updatedTime": "1575797010"
}

# 下载

GET http://resource-service.qiqiuyun.net/resources/{no}/downloadUrl

参数:

字段 类型 必需 描述
no string 云资源编号no

响应:

{
    "downloadUrl": "http://esa2v8.pri.codeages.net/20191204/142637/5de7519d1d0d4654794932?attname=hahaha.mp4&e=1575800552&token=6uEqT5vwuQIM4p1vkf7bk6GHshgNofDb_SYHvabL:wfrQS-q3ocy9tAK6HkfTRnT6rT0="
}

# 删除

DELETE http://resource-service.qiqiuyun.net/resources/{no}

参数:

字段 类型 必需 描述
no string 云资源编号no

响应:

{
    "success": true
}

# 获取分享地址

GET http://resource-service.qiqiuyun.net/resources/{no}/shareUrl


**参数:**

| 字段 | 类型 | 必需|  描述 |
| ---- | --- | ------ | ------ |
| `no` | string | 是   | 云资源编号 |

响应:

{
    "shareUrl": "http://play.qiqiuyun.net/embed/5de7519d1d0d4654794932"
}

# 开启分享

POST http://resource-service.qiqiuyun.net/resources/{no}/share


**参数:**

| 字段 | 类型 | 必需|  描述 |
| ---- | --- | ------ | ------ |
| `no` | string | 是   | 云资源编号 |

响应:

{
    "shareUrl": "http://play.qiqiuyun.net/embed/5de7519d1d0d4654794932"
}

# 关闭分享

POST http://resource-service.qiqiuyun.net/resources/{no}/closeShare


**参数:**

| 字段 | 类型 | 必需|  描述 |
| ---- | --- | ------ | ------ |
| `no` | string | 是   | 云资源编号 |

响应:

{
    "shareUrl": "http://play.qiqiuyun.net/embed/5de7519d1d0d4654794932"
}

# 获取缩略图

GET http://resource-service.qiqiuyun.net/resources/{no}/thumbnails

**参数:**

| 字段 | 类型 | 必需|  描述 |
| ---- | --- | ------ | ------ |
| `no` | string | 是   | 云资源编号 |

** 响应:**

{
    "thumbnails": [
        "http://esa2v8-pub.pub.codeages.net/3172c802cdb43374f766e69439f18e03.jpg",
        "http://esa2v8-pub.pub.codeages.net/1ec92bc7b5b3bb508b6bb4e7837bebd1.jpg",
        "http://esa2v8-pub.pub.codeages.net/3ef1a6ee16dc5627b4a2bee60920c0b8.jpg",
        "http://esa2v8-pub.pub.codeages.net/39ace1cd50c3a8eede87097dbc45859b.jpg",
        "http://esa2v8-pub.pub.codeages.net/93ff6bd2a635cb81553b9dc62a424e4e.jpg",
        "http://esa2v8-pub.pub.codeages.net/55562e7f69ee1bac6a541ca5105a5839.jpg"
    ]
}

# 资源实体说明

字段 类型 描述
no string 云资源编号
extno string 云资源外部编号
isShare bool 是否开启分享
name string 名称
type string 类型
size int 大小
length int 长度
thumbnail string 缩略图
processStatus string 转码状态
processedTime int 转码时间
createdTime int 创建时间
updatedTime int 更新时间