[关闭]
@JackieQu 2018-05-27T11:45:46.000000Z 字数 1066 阅读 268

签到

列表项

儿童编程


自动签到

每节课打卡时,若当天有3个打卡记录则自动签到
diamond_reward:钻石奖励信息,0 时不显示
share_data:要分享的数据,为 None 时不显示

  1. {
  2. "message": "保存学习进度成功",
  3. "diamond_reward": {
  4. "content": "已获得今日奖励",
  5. "diamond": 0
  6. },
  7. "share_data": {
  8. "records": 4,
  9. "titles": [
  10. "知识点1",
  11. "知识点3",
  12. "知识点5"
  13. ],
  14. "names": [
  15. "Python1"
  16. ]
  17. }
  18. }

签到

Method and Url Structure

Method Resource URL
POST /course/sign_in/

cURL Example

  1. curl -X POST -H 'Authorization: Token tester001' -d data{...}
  2. 127.0.0.1:8000/program_face2face/course/sign_in/

Request and Parameters

Name Description Required Default
course 课程pk YES

Request

  1. {
  2. "course": 4
  3. }

JSON Response

  1. {
  2. "status": 0,
  3. "message": "签到成功"
  4. }
  5. # 错误信息
  6. {
  7. "status": -4,
  8. "message": "您未完成今日学习任务"
  9. }
  10. # 或
  11. {
  12. "status": -4,
  13. "message": "今日已签到"
  14. }

签到记录

Method and Url Structure

Method Resource URL
GET /course/sign_in_list/

cURL Example

  1. curl -X GET -H 'Authorization: Token tester001' -d data{...}
  2. http://127.0.0.1:8000/program_face2face/course/sign_in_list/

JSON Response

  1. {
  2. "count": 4,
  3. "next": null,
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 28,
  8. "owner": "tester001",
  9. "day": 1,
  10. "diamond": 10
  11. },
  12. {
  13. "pk": 29,
  14. "owner": "tester001",
  15. "day": 2,
  16. "diamond": 0
  17. },
  18. {
  19. "pk": 30,
  20. "owner": "tester001",
  21. "day": 3,
  22. "diamond": 6
  23. },
  24. {
  25. "pk": 31,
  26. "owner": "tester001",
  27. "day": 4,
  28. "diamond": 0
  29. }
  30. ]
  31. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注