根路径:http://112.74.214.252:8080/acloud/
[toc]
url : /login/web
字段 | 类型 | 必须 | 含义 |
---|---|---|---|
userId | true | 用户登录Id(还没有做邮箱验证啊) | |
password | string | true | 密码,长度大于6 |
url : /register
字段 | 类型 | 必须 | 含义 |
---|---|---|---|
userId | true | 用户登录Id | |
password | string | true | 密码,长度大于6 |
url: /user/info method : GET
返回格式:
{
"gender": 0,
"major": 1,
"nickName": "丿灬文丶少",
"phone": 123,
"realName": "赖远文",
"stuId": "140202021006",
"userId": "[email protected]"
}
url: /user/update method : POST
需要什么,更新什么
字段 | 类型 | 必须 | 含义 |
---|---|---|---|
realName | string | false | 真实姓名 |
nickName | string | 昵称 | |
stuId | string | false | 学号 |
major | string | false | 专业id |
classNum | string | false | 班级 |
phone | long | false | 电话号码 |
gender | int | false | 性别 |
前缀url:/admin
url:GET /schools
返回JSON格式
[
{
"id": 1,
"name": "北京理工大学珠海学院",
"colleges": [
{
"id": 1,
"name": "计算机学院",
"majors": [
{
"id": 6,
"name": "网络工程"
},
{
"id": 5,
"name": "软件工程"
}
]
},
{
"id": 2,
"name": "信息学院",
"majors": []
}
]
},
{
"id": 2,
"name": "北京师范大学珠海学院",
"colleges": []
}
]
url:POST /schools 上传JSON格式
{
"name": "暨南大学"
}
url: POST /schools/excel
excel格式
编号 | 学校名称 |
---|---|
1 | 北理珠 |
url:GET /schools/{school_id}/colleges
返回JSON格式
[
{
"id": 1,
"name": "计算机学院",
"majors": [
{
"id": 5,
"name": "软件工程"
},
{
"id": 6,
"name": "网络工程"
}
]
}
]
url:POST /schools/{school_id}/colleges
上传JSON格式
{
"name": "艺术学院"
}
url:GET /colleges/{college_id}/majors
返回JSON格式
[
{
"id": 5,
"name": "软件工程"
},
{
"id": 6,
"name": "网络工程"
}
]
url:POST /colleges/{college_id}/majors
上传JSON格式
{
"name": "树莓"
}
- url : /society
- method: PUT
- ContentType: application/json;
- Json:
{
"name":"社团名字",
"summary":"社团介绍",
"principal":"[email protected]",//社团负责人UserId
"createTime":2354353254352,// 创建时间,转换成long
"college":1, // 学院Id
"society_logo":"http://i.niupic.com/images/2017/05/10/qamWL3.jpg" // 社团logo,现在只能上传个URL
}
- url : /society
- method: POST
- ContentType: application/json;
- Json:
{
"name":"社团名字",
"summary":"社团介绍",
"principal":"[email protected]",//社团负责人UserId
"createTime":2354353254352,// 创建时间,转换成long
"college":1, // 学院Id
"society_logo":"http://i.niupic.com/images/2017/05/10/qamWL3.jpg" // 社团logo,现在只能上传个URL
}
- url : /society/school/{schoolId}
- method: GET
- 返回值:
[
{
"id": 2,
"name": "不甘社",
"society_logo": "http://i.niupic.com/images/2017/05/10/qamWL3.jpg",
"summary": "这个社团很懒,什么都没有说"
},
{
"id": 3,
"name": "更新名字",
"summary": "这个社团很懒,什么都没有说"
}
]
- url : /society/college/{collegeId}
- method: GET
- 返回值:
[
{
"id": 2,
"name": "不甘社",
"society_logo": "http://i.niupic.com/images/2017/05/10/qamWL3.jpg",
"summary": "这个社团很懒,什么都没有说"
},
{
"id": 3,
"name": "更新名字",
"summary": "这个社团很懒,什么都没有说"
}
]
- url : /society/{societyId}/users
- method: GET
- Json:
[
{
"gender": 1,
"phone": 123,
"societyPositions": [],
"userId": "abc"
}
]
- url : /society/user
- method: GET
- Json:
[
{
"id": 1,
"name": "科协",
"society_logo": "http://i.niupic.com/images/2017/05/10/qamWL3.jpg"
}
]
- url : /society/{societyId}
- method: GET
- 返回值:
{
"college": 1,
"createTime": 1494453191312,
"id": 2,
"name": "不甘社",
"society_logo": "http://i.niupic.com/images/2017/05/10/qamWL3.jpg"
}
- URL : /society/join
- Method:POST
- Content-Type : application/json
{
"societyId":1,
"reason": "申请理由"
}
添加成功返回HTTP Code 200,不返回任何信息
- URL : /society/join
- Method:GET
需要登录,请求参数:
字段 | 类型 | 备注 |
---|---|---|
societyId | String | 社团Id |
返回的Json数据:
[
{
"applyId":1,
"applierId": "[email protected]",
"reason": "申请理由"
}
]
- URL:/society/join/{id}
- Method: GET
返回的json格式
{
"id": 11,
"reason": "申请理由",
"user": "[email protected]",
"society": "4",
"society_name": "ACM"
}
URL : /society/handle Method:POST Content-Type : application/x-www-form-urlencoded
请求体:
字段 | 类型 | 备注 |
---|---|---|
appleId | String | 申请加入社团的申请Id |
isAllow | Boolean | 是否同意加入 |
URL : /society/position
Method:GET
[
{
"grade": 1,
"name": "副主席",
"id": 1
},
{
"grade": 0,
"name": "干事",
"id": 2
}
]
url: /task/add
上传一个Json:
{
"title":"任务名字",
"societyId":"1",
"executors":[
"userId","[email protected]"
],
"subTask":[
"子任务1","子任务2"
]
}
Method: PUT URL: /task/add Content-Type: application/json
上传一个Json:
{
"id":"40280e815c62e6c1015c62e718ae0000",
"taskType":"1",
"executors":[
"userId","[email protected]"
],
"subTask":[
{
"id":"15",
"process":"1",
"question":"又带上了id"
},
{
"process":"1",
"question":"添加"
}
]
}
URL:/task/task/{taskId}
字段 | 是否必须 | 含义 |
---|---|---|
taskId | true | 任务的Id |
URL:/task/user/{userId}
字段 | 是否必须 | 含义 |
---|---|---|
userId | true | 用户的Id |
URL:/task/publicsher/{id}
字段 | 是否必须 | 含义 |
---|---|---|
publisherId | true | 发布者的Id |
URL:/task/society/{societyId}
字段 | 是否必须 | 含义 |
---|---|---|
societyId | true | 社团的Id |
URL:POST /notices
POST JSON 格式
{
"title": "标题6",
"content": "内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容",
"society": 1, //社团ID
"publisher": "[email protected]",
"executors": [ //哪些用户可见
"[email protected]"
]
}
URL:GET /notices/publisher/?page=1&pageSize=10
返回 JSON 格式
{
"id": 1204,
"status": 0,
"visitor_status": 0,
"title": "测试",
"content": "内容内容",
"society": "ACM",
"society_id": 4,
"publisher": "[email protected]",
"time": 1496760791825,
"executors": [
"[email protected]",
"[email protected]"
]
}
URL: GET /notices/user/?page=1&pageSize=10
返回的JSON格式
同上
URL: GET /notices/user/society/{society_id}/?page=1&pageSize=10
返回的JSON格式
同上
URL: DELETE /notices/{notice_id}
URL: PUT /notices/{notice_id}
PUT JSON格式
[
{
"title": "标题666",
"content": "123内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容",
"society": 1,
"publisher": "[email protected]",
"executors": [
"[email protected]"
]
}
]
URL: GET /notices/visitor/{notice_id}
返回的JSON格式
[
"[email protected]",
"[email protected]"
]
URL: GET /message/{type}
例如: 获取所有未读的公告通知
GET /message/notice
JSON 格式
[
{
"id": 39, // 公告ID
"publisher": [email protected]
"logo": http://i.niupic.com/images/2017/06/06/9q1wfr.jpg,
"identifier": "b5de015f-98bd-4233-9c92-a983abfe34d0",// 标识符(用于删除已读消息)
"info": "测试", // 通知粗略内容
"time": 1496647542777,
"title": "你有一条新的公告通知" // 通知标题
}
]
URL: GET /message/count/{type}
例如: 获取所有未读的公告通知的数量
GET /message/count/notice
返回格式
2
通过返回未读通知的json中的id,访问相应的url,并带上identifier查询参数(作用:清除未读通知)
比如: 获取到上面的公告通知id为39,则当用户点击未读通知时,访问/notice/39?identifier=b5de015f-98bd-4233-9c92-a983abfe34d0
这样就返回了公告详细信息的json了
当建立websocket连接时,服务器会自动发送该用户的所有未读通知
- URL:/scoreboard/{type}/{societyId} (type:week或者month)
- Method: GET
返回的json格式 (从高到低)可能有同分数的情况,前端判断一下啊
[
{
"score": 6,
"userId": "[email protected]"
},
{
"score": 2,
"userId": "[email protected]"
}
]