[关闭]
@ExcitedSpider 2018-03-10T20:06:42.000000Z 字数 1916 阅读 1150

创建班级

  1. //请求
  2. {
  3. "class_name":"程序设计",
  4. "class_type":"0",
  5. /*
  6. 0->课程班级
  7. 1->社团班级
  8. 2->教务班级
  9. 3->自由班级
  10. */
  11. "creater":"xiaoming",
  12. "about":"这是课程设计的班级群",
  13. }
  1. //回复
  2. {
  3. "error":"0"
  4. /*
  5. 0->成功创建班级
  6. 1->班级名称不合法
  7. 2->班级描述不合法
  8. 3->服务器不可用
  9. */
  10. "classID":"123456",
  11. }

解散班级

  1. ?class=123456&user=xiaoming
  1. {
  2. "error":"0",
  3. /*
  4. 0->成功解散班级
  5. 1->用户无权限
  6. 2->服务器不可用
  7. */
  8. }

加入班级

  1. //请求
  2. ?class=123456&user=xiaohong
  1. //回复
  2. {
  3. "error":"0",
  4. /*
  5. 0->成功加入班级
  6. 1->班级号无效
  7. 2->用户无权限(用户是游客)
  8. 3->服务器不可用
  9. */
  10. }

查询用户加入的班级

  1. //请求
  2. ?user=xiaoming
  1. //回复
  2. {
  3. "error":"0",
  4. /*
  5. 0->成功查询
  6. 1->查询失败
  7. */
  8. "class":[
  9. {
  10. "class_name":"程序设计",
  11. "class_type":"0",
  12. "creater":"xiaoming",
  13. "about":"这是课程设计的班级群",
  14. },
  15. {
  16. "class_name":"大学英语",
  17. "class_type":"0",
  18. "creater":"xiaohong",
  19. "about":"这是大学英语的班级群",
  20. },
  21. ]
  22. }

退出班级

  1. //请求
  2. ?class=123456&user=xiaohong
  1. //回复
  2. {
  3. "error":"0",
  4. /*
  5. 0->成功退出班级
  6. 1->退出失败
  7. */
  8. }

创建通知

  1. //请求
  2. {
  3. "head":{
  4. "classID":"123456",
  5. "create_time":"1520678903",
  6. "fail_time":"1520698903",//通知截止时间
  7. "creater":"xiaoming",
  8. },
  9. "content": "明天我们要在班上开会,请互相转告不要缺席。"
  10. }
  1. //回复
  2. {
  3. "result":"0"
  4. /*
  5. 0 ->成功创建通知
  6. 1 ->通知字数太长
  7. 2 ->通知中含有违规字
  8. 3 ->服务器不可用
  9. */
  10. }

查询通知

  1. //请求
  2. ?classID=123456&userID=xiaoming
  1. //回复
  2. {
  3. "error":"0",
  4. /*
  5. 0 ->成功查询通知
  6. 1 ->class id无效
  7. 2 ->user id无效(用户不属于该班级)
  8. 3 ->服务器不可用
  9. */
  10. "content":[
  11. {
  12. "head":{
  13. "id":"0",
  14. "classID":"123456",
  15. "create_time":"1520678903",
  16. "fail_time":"1520698903",
  17. "creater":"xiaoming",
  18. },
  19. "content": "明天我们要在班上开会,请互相转告不要缺席。"
  20. },
  21. {
  22. "head":{
  23. "id":"1",
  24. "classID":"123456",
  25. "create_time":"1520678903",
  26. "fail_time":"1520698903",
  27. "creater":"xiaoming",
  28. },
  29. "content": "大家记得带本子和笔。"
  30. },
  31. "head":{
  32. "id":"2",
  33. "classID":"123456",
  34. "create_time":"1520671903",
  35. "fail_time":"1520798903",
  36. "creater":"wanglaoshi",
  37. },
  38. "content": "明天在机房上机。"
  39. },
  40. ]
  41. //列表中最大上限30个通知,如果该班级的通知超过30,则取最新
  42. }

删除通知

  1. //请求
  2. ?classID=123456&notificationID=0
  1. //回复
  2. {
  3. "result":"0"
  4. /*
  5. 0 ->成功删除通知
  6. 1 ->删除失败
  7. */
  8. }

标记通知

此功能暂时在本地完成,不上传到服务器。

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注