[关闭]
@chengxuyuan 2019-04-10T06:29:49.000000Z 字数 3099 阅读 440

上传活动作品

橙旭园儿童编程


上传作品

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

  1. {
  2. "name":"test002",
  3. "activity_number":"039d93dck3d93ka",
  4. "images":"https://static1.bcjiaoyu.com/cover.png",
  5. "works":"https://static1.bcjiaoyu.com/0fa9079e7ab00119ea1575b_y.sb3",
  6. "work_type":"scratch3",
  7. "content":"介绍"
  8. }

cURL Example

  1. curl -X POST -H 'Authorization: Token db4b5deed80091404ec2a295076221cf1f814b3e' -H 'Content-Type: application/json' --data '{..}' http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks_create/'

Response

  1. {
  2. "pk":7,
  3. "student":{
  4. "pk":2,
  5. "owner":"18516271364",
  6. "name":"","nickname":"",
  7. "avatar":"",
  8. "birthday":"2013-09-21"
  9. },
  10. "name":"test002",
  11. "islike":false,
  12. "likes":0,
  13. "content":"作品介绍",
  14. "activity_number":"039d93dck3d93ka",
  15. "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3",
  16. "images":"https://static1.bcjiaoyu.com/cover.png",
  17. "work_type":"scratch3",
  18. "create_time":"2019-03-21T13:43:10.317553"
  19. }

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

  1. {
  2. "work_type": "applab"
  3. }

cURL Example

  1. curl http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks/?work_type=applab

Response

  1. {
  2. "count":1,
  3. "next":null,
  4. "previous":null,
  5. "results":[{
  6. "pk":7,
  7. "student":{
  8. "pk":2,
  9. "owner":"18516271364",
  10. "name":"",
  11. "nickname":"",
  12. "avatar":"",
  13. "birthday":"2013-09-21"
  14. },
  15. "name":"test002",
  16. "other":"",
  17. "islike":false,
  18. "likes":0,
  19. "content":"作品介绍",
  20. "activity_number":"039d93dck3d93ka",
  21. "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3",
  22. "images":"https://static1.bcjiaoyu.com/cover.png",
  23. "html":null,
  24. "js":null,
  25. "css":null,
  26. "work_type":"scratch3",
  27. "status":0,
  28. "status_display":"待核审",
  29. "create_time":"2019-03-21T13:43:10.3175533"
  30. }...]
  31. }

获取作品详情

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/show/activity/{pk}/ 获取作品详情 NO

cURL Example

  1. curl http://localhost:8000/server/show/activity/039d93dck3d93ka/showworks/3/'

Response

  1. {
  2. "pk":3,
  3. "student":{
  4. "pk":2,
  5. "owner":"18516271364",
  6. "name":"","nickname":"",
  7. "avatar":"",
  8. "birthday":"2013-09-21"
  9. },
  10. "name":"test002",
  11. "islike":false,
  12. "likes":0,
  13. "content":"作品介绍",
  14. "activity_number":"039d93dck3d93ka",
  15. "works":"https://static1.bcjiaoyu.com/5aad124510fa9079e7ab00119ea1575b_y.sb3",
  16. "images":"https://static1.bcjiaoyu.com/cover.png",
  17. "work_type":"scratch3",
  18. "create_time":"2019-03-21T13:43:10.317553"
  19. }

微信点赞

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

  1. {
  2. "openid":"039d93dck3d93ka"
  3. }

cURL Example

  1. curl -X POST --data '{..}' http://localhost:8000/server/show/wx-like/wx-like/134/'
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注