@ExcitedSpider
2018-03-10T12:06:42.000000Z
字数 1916
阅读 1200
//请求
{
"class_name":"程序设计",
"class_type":"0",
/*
0->课程班级
1->社团班级
2->教务班级
3->自由班级
*/
"creater":"xiaoming",
"about":"这是课程设计的班级群",
}
//回复
{
"error":"0"
/*
0->成功创建班级
1->班级名称不合法
2->班级描述不合法
3->服务器不可用
*/
"classID":"123456",
}
?class=123456&user=xiaoming
{
"error":"0",
/*
0->成功解散班级
1->用户无权限
2->服务器不可用
*/
}
//请求
?class=123456&user=xiaohong
//回复
{
"error":"0",
/*
0->成功加入班级
1->班级号无效
2->用户无权限(用户是游客)
3->服务器不可用
*/
}
//请求
?user=xiaoming
//回复
{
"error":"0",
/*
0->成功查询
1->查询失败
*/
"class":[
{
"class_name":"程序设计",
"class_type":"0",
"creater":"xiaoming",
"about":"这是课程设计的班级群",
},
{
"class_name":"大学英语",
"class_type":"0",
"creater":"xiaohong",
"about":"这是大学英语的班级群",
},
]
}
//请求
?class=123456&user=xiaohong
//回复
{
"error":"0",
/*
0->成功退出班级
1->退出失败
*/
}
//请求
{
"head":{
"classID":"123456",
"create_time":"1520678903",
"fail_time":"1520698903",//通知截止时间
"creater":"xiaoming",
},
"content": "明天我们要在班上开会,请互相转告不要缺席。"
}
//回复
{
"result":"0"
/*
0 ->成功创建通知
1 ->通知字数太长
2 ->通知中含有违规字
3 ->服务器不可用
*/
}
//请求
?classID=123456&userID=xiaoming
//回复
{
"error":"0",
/*
0 ->成功查询通知
1 ->class id无效
2 ->user id无效(用户不属于该班级)
3 ->服务器不可用
*/
"content":[
{
"head":{
"id":"0",
"classID":"123456",
"create_time":"1520678903",
"fail_time":"1520698903",
"creater":"xiaoming",
},
"content": "明天我们要在班上开会,请互相转告不要缺席。"
},
{
"head":{
"id":"1",
"classID":"123456",
"create_time":"1520678903",
"fail_time":"1520698903",
"creater":"xiaoming",
},
"content": "大家记得带本子和笔。"
},
"head":{
"id":"2",
"classID":"123456",
"create_time":"1520671903",
"fail_time":"1520798903",
"creater":"wanglaoshi",
},
"content": "明天在机房上机。"
},
]
//列表中最大上限30个通知,如果该班级的通知超过30,则取最新
}
//请求
?classID=123456¬ificationID=0
//回复
{
"result":"0"
/*
0 ->成功删除通知
1 ->删除失败
*/
}
此功能暂时在本地完成,不上传到服务器。