上传活动作品
橙旭园儿童编程
上传作品
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| POST |
/server/show/activity/${number}/showworks_create/ |
上传作品 |
YES |
Request Data
| Name |
Description |
Required |
Default |
| name |
作品名 |
YES |
|
| activity_number |
活动号 |
YES |
|
| images |
封面图 |
YES |
|
| works |
作品链接 |
YES |
|
| works_type |
作品类型: scratch3, applab |
YES |
|
| content |
作品介绍 |
YES |
|
Request
{ "name":"test002", "activity_number":"039d93dck3d93ka", "images":"https://static1.bcjiaoyu.com/cover.png", "works":"https://static1.bcjiaoyu.com/0fa9079e7ab00119ea1575b_y.sb3", "work_type":"scratch3", "content":"介绍"}
cURL Example
curl -X POST -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' -H 'Content-Type: application/json' --data '{..}' http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks_create/'
Response
{ "pk":7, "student":{ "pk":2, "owner":"18516271364", "name":"","nickname":"", "avatar":"", "birthday":"2013-09-21" }, "name":"test002", "islike":false, "likes":0, "content":"作品介绍", "activity_number":"039d93dck3d93ka", "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3", "images":"https://static1.bcjiaoyu.com/cover.png", "work_type":"scratch3", "create_time":"2019-03-21T13:43:10.317553"}
Response Data Description
| Name |
Description |
| student |
用户信息 |
| activity_number |
活动号 |
| images |
封面图 |
| works |
作品链接 |
| works_type |
作品类型 |
| name |
作品名 |
| create_time |
创建时间 |
| islike |
是否点赞 |
| likes |
点赞数量 |
获取作品列表
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/show/activity/${number}/showworks/ |
获取作品列表 |
NO |
Request Parameters
| Name |
Description |
Required |
Default |
| work_type |
作品类型: scratch3, applab |
NO |
scratch3 |
Request
{ "work_type": "applab"}
cURL Example
curl http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks/?work_type=applab
Response
{ "count":1, "next":null, "previous":null, "results":[{ "pk":7, "student":{ "pk":2, "owner":"18516271364", "name":"", "nickname":"", "avatar":"", "birthday":"2013-09-21" }, "name":"test002", "other":"", "islike":false, "likes":0, "content":"作品介绍", "activity_number":"039d93dck3d93ka", "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3", "images":"https://static1.bcjiaoyu.com/cover.png", "html":null, "js":null, "css":null, "work_type":"scratch3", "status":0, "status_display":"待核审", "create_time":"2019-03-21T13:43:10.3175533" }...]}
获取作品详情
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| GET |
/server/show/activity/{pk}/ |
获取作品详情 |
NO |
cURL Example
curl http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks/3/'
Response
{ "pk":3, "student":{ "pk":2, "owner":"18516271364", "name":"","nickname":"", "avatar":"", "birthday":"2013-09-21" }, "name":"test002", "islike":false, "likes":0, "content":"作品介绍", "activity_number":"039d93dck3d93ka", "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3", "images":"https://static1.bcjiaoyu.com/cover.png", "work_type":"scratch3", "create_time":"2019-03-21T13:43:10.317553"}
微信点赞
Method and URL Structure
| Method |
Method Resource URL |
Descriptions |
Authentications Required |
| POST |
/server/show/wx-like/${pk}/ |
微信点赞 |
NO |
Request Data
| Name |
Description |
Required |
Default |
| openid |
微信openid |
YES |
|
Request
{ "openid":"039d93dck3d93ka"}
cURL Example
curl -X POST --data '{..}' http://localhost:8000/server/show/wx-like/wx-like/134/'