[关闭]
@fuyb1986 2018-03-29T09:19:23.000000Z 字数 1252 阅读 552

老师的教室

儿童编程


随机Lesson

Method and URL Structure

Method Resource URL Authorization
PUT /server/classroom/random_lesson/${pk}/ YES

cURL Example

  1. curl -X POST -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/server/classroom/random_lesson/5000/

Response

  1. {
  2. "status": 0,
  3. "message": "",
  4. "lesson": 3333
  5. }

获取老师的教室列表

Method and URL Structure

Method Resource URL Authorization
GET /server/classroom/teacher_schedule/ YES

Requeset Paramters

学生只能从明天以及明天之后开始的课程里选课

Name Description Required Default
week 从本周算起前/后 N 周的 NO
day 前/后 N 天开始的 NO
s_day 开始上课时间 Noe
teacher 老师名字 No
student 学生的名字 NO
status 状态 Noe


day: N 天之前或之后开始的;
等于 0: 今天;
大于 0: N 天之后;
小于 0: N 天之前;


week 前/后 N 周之七天的;
等于0: 本周;
大于0: N周之后;
小于0: N周之前;

cURL Example

  1. curl -X GET -H 'Authorization: token 95b7b4d8fff5d76c9d3d2954fe5c7d456c110a8c' -H 'Content-Type: application/json' http://localhost/classroom/teacher_schedule/?day=1

Response Data

Name Description
pk id
name 教室的名字
teacher_userinfo 老师的信息
student_userinfo 学生的信息
starttime 开始时间
endtime 结束时间
teacher 老师 id
status 状态

Response

  1. {
  2. "count": 2,
  3. "next": None,
  4. "previous": None,
  5. "results": [{
  6. "status": "unfinish",
  7. "name":"教室的名字",
  8. "classschedule":{
  9. "starttime":"2018-03-21 17:00:00",
  10. "endtime":"2018-03-21 17:30:00",
  11. },
  12. "teacher_userinfo": {
  13. "name": "小明",
  14. "avatar": u'http://www.example.com/xiaoming.jpg'
  15. },
  16. "student_userinfo": {
  17. "name": "小明",
  18. ....
  19. }
  20. }, ...]
  21. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注