@sewise-dev
2017-02-10T08:31:23.000000Z
字数 2867
阅读 739
微录播
编号 | 版本 | 说明 | 作者 | 日期 |
---|---|---|---|---|
1 | v1.0 | 创建文档 | seven | 2017-01-16 |
HTTP请求状态返回格式
返回字段 | 字段类型 | 说明 |
---|---|---|
success | Integer | 请求返回码(详细请见状态表) |
msg | String | 返回描述 |
data | json | 返回结果 |
错误样例
{
"success": false,
"mgs": "invalid appid"
}
成功样例
{
"success": true,
"data": {"access_token":"ACCESS_TOKEN","expires_in":7200}
}
/swl/share
application/json
POST
参数 必选 类型 说明 RequestBody users 是 string 分享用户id字符串(逗号隔开) nickname 是 String 分享用户名字符串(逗号隔开) swlid 是 String 课程swlid title 是 String 课程名称 image 是 String 截图 video_url 是 String 视频地址 summary 是 String 简介 duration 是 int 时长 userinfo 是 json 分享者用户信息 是 username 分享者用户名 是 nickname 分享者昵称
200
返回字段 | 字段类型 | 说明 |
---|---|---|
success | int | 返回状态码 |
msg | String | 返回错误信息 |
data | Array | 返回结果 |
Request
curl -X POST -H "Content-Type:application/json" -d {"users":1,2,3,"nickname":"name1,name2,name3"} http://localhost/swl/share
Response
{"success":true}
/swl/getShareList
application/json
get
参数 必选 类型 说明 RequestBody swlid 否 string 课程swlid page 否 int 页码 pageSize 否 int 页数 q 否 string 搜索关键词 userinfo 是 json 分享者用户信息 是 role 用户角色 是 username 分享者用户名
200
返回字段 | 字段类型 | 说明 |
---|---|---|
success | int | 返回状态码 |
msg | String | 返回错误信息 |
data | Array | 返回结果 |
Request
curl -X POST -H "Content-Type:application/json" -d {"role":1,"username":"name1","q":"123"} http://localhost/swl/getShareList
Response
{
"success": true,
"data": [
{
"_id": "587c6265df776626d319d386",
"share_id": "baf20e37-d50b-4006-b433-cebc17ae1ef0",
"to_uid": "3",
"to_nickname": "caifei",
"swlid": "222",
"title": "百度课堂",
"image": "http://www.sewise.com/image/1394324.jpg",
"from_uid": "蔡老师",
"from_nickname": "我是的淡蓝色的方式,seven,caifei",
"type": 1,
"video_url": "http://www.baidu.com/sfsfiem/3/sdfsds.mp4",
"summary": "简介12312",
"spend_time": 0,
"studyprocess": 0,
"duration": "500",
"spendtime_total": 0,
"finish_time": 0,
"answer_ids": 0,
"question_total": 0,
"wrong_total": 0,
"right_total": 0,
"klg_ids": null,
"klg_total": 0,
"know_well_total": 0,
"create_time": "2017-01-16 14:43:37"
},
],
"pages": 1
}
/swl/share/fromList
application/json
get
参数 必选 类型 说明 RequestBody userinfo 是 json 分享者用户信息 是 username 分享者用户名 是 nickname 分享者昵称
200
返回字段 | 字段类型 | 说明 |
---|---|---|
success | int | 返回状态码 |
msg | String | 返回错误信息 |
data | Array | 返回结果 |
Request
curl -X POST -H "Content-Type:application/json" -d {"role":1,"username":"name1","q":"123"} http://localhost/swl/share/fromList
Response
{
"success": true,
"data": [
{
"username": "蔡老师",
"nickname": "我是的淡蓝色的方式,seven,caifei"
}
],
}
/swl/share/{share_id}
application/json
get
参数 必选 类型 说明 RequestBody share_id 是 string 分享id userinfo 是 json 分享者用户信息 是 username 分享者用户名 是 nickname 分享者昵称
200
返回字段 | 字段类型 | 说明 |
---|---|---|
success | int | 返回状态码 |
msg | String | 返回错误信息 |
data | Array | 返回结果 |
Request
curl -X POST -H "Content-Type:application/json" -d {"role":1,"username":"name1"} http://localhost/swl/share/2348sdf-23423423
Response
{
"success": true,
"data": [
{
"share_id": "2348sdf-23423423",
...
}
],
}