-
Notifications
You must be signed in to change notification settings - Fork 0
首页和公共APi
xuelang123 edited this page Apr 20, 2014
·
6 revisions
##返回状态## RESULT_CONSTANT
RESULT_SUCCESS : true; // 表示成功 一般只处理这种状态
RESULT_ERROR: false; // 表示请求错误 一般不作处理
##登录模块## ###用户登陆###
/api/login
Request:
method:POST
username:String
password:String
Response:
{
"status":RESULT_CONSTANT,
}
###查看用户登录状态###
/api/login/status
Request:
method:GET
Response:
{
"status":RESULT_CONSTANT,
"datas":[RoleCode:String,
RoleCode:String] // 角色编号
}
example:{"datas":["student"],"status":true}
###初始化推送服务###
/api/push/init
Request:
method:POST
userId : String // 百度提供的用户标识符
Response:
{
"status":RESULT_CONSTANT
}
###查看用户个人信息###
/api/users/info
Request:
method:GET
Response:
{
"realname": "李四",
"email": "[email protected]",
"mobilePhone": "13575457471",
"officePhone": "6978543",
"userName": "lisi"
}
##公共首页##
/api/home
Request:
method:GET Response:
{ // 学院新闻标题数组默认3条
"news": [
"第二届服务外包"
], // 班级新闻 默认最新一条
"classNews": {
"author": "admin",
"id": "ff8081814530db35014531bc850c002c",
"content": "sd",
"title": "sdf",
"time": "2014-04-05 19:53:29.0"
}, // 当天的课程
"courses": [
{
"section": "第6,7节",
"place": "104教室",
"week": "星期三",
"teacherName": "物理老师",
"name": "大物",
"id": "ff8081814530db35014531f54362002f"
}
]
}
##学院新闻列表## /api/news/
Request:
method:get
Response:
[ //新闻数组,默认5条
{
"author": "admin",
"id": "ff8081814530db35014530db35fb0000",
"content": "第二届服务外包开始了。",
"title": "第二届服务外包",
"time": "2014-04-05 15:47:23.0"
}
]
##班级新闻## /api/classnews
Request:
method:get
Response:
[
{
"author": "admin",
"id": "ff8081814530db35014531bc850c002c",
"content": "sd",
"title": "sdf",
"time": "2014-04-05 19:53:29.0"
}
]
##全部课表获取## /api/course
Request :
method : GET
Response :
{
"week1": [],
"week2": [],
"week3": [
{
"week": "星期三",
"section": "第1,2节",
"place": "104教室",
"teacherName": "物理老师",
"name": "java",
"id": "ff8081814530db35014531f54362002e"
}
],
"week4": [],
"week5": [],
"week0": [
{
"week": "星期日",
"section": "第6,7节",
"place": "104教室",
"teacherName": "物理老师",
"name": "大物",
"id": "ff8081814530db35014531f54362002f"
}
],
"week6": []
}