-
Notifications
You must be signed in to change notification settings - Fork 78
project
Malcolm edited this page Aug 1, 2016
·
11 revisions
POST /user/projects
Parameters
名称 | 类型 | 描述 |
---|---|---|
projectName |
string |
项目名称 |
icons |
array |
图标数组 |
Input Example
{
"projectName": "奇怪的项目",
"icons": [{"id": 1, "name": "火车"}, {"id": 2, "name": "飞机"}]
}
Response
{
"ret": true,
"data": "成功添加项目图标"
}
本接口只能获取项目基本信息(只有名称),其中字段名称叫 organization
。
GET /user/projects
Response
{
"ret": true,
"data": {
"id": 2,
"name": "shaonan.zhang",
"actor": 1,
"organization": [
{
"id": 1,
"name": "奇怪的项目",
"owner": 1
},
{
"id": 4,
"name": "呵呵呵呵呵",
"owner": 2
}
]
}
}
获取单个项目的全部信息,包含其 owner
,members
,icons
。只有项目的成员才能获取自己的项目信息。
GET /user/projects/:projectId(/version/:version)
当不提供版本时默认查 0.0.0 版本
Response
{
"ret": true,
"data": {
"id": 1,
"name": "奇怪的项目",
"info": "项目描述",
"version": "0.0.1",
"icons": [],
"members": [
{
"id": 1,
"name": "minghao.yu",
"actor": 2
},
{
"id": 2,
"name": "shaonan.zhang",
"actor": 1
},
{
"id": 3,
"name": "missy.liu",
"actor": 2
}
],
"owner": {
"id": 1,
"name": "minghao.yu",
"actor": 2
}
}
}
获取单个项目的全部信息,包含其 owner
,members
,icons
。
GET /projects/:projectId(/version/:version)
当不提供版本时默认查项目最高版本
Response
{
"ret": true,
"data": {
"id": 1,
"name": "奇怪的项目",
"info": "项目描述",
"version": "0.0.1",
"icons": [],
"members": [
{
"id": 1,
"name": "minghao.yu",
"actor": 2
},
{
"id": 2,
"name": "shaonan.zhang",
"actor": 1
},
{
"id": 3,
"name": "missy.liu",
"actor": 2
}
],
"owner": {
"id": 1,
"name": "minghao.yu",
"actor": 2
}
}
}
POST /user/projects/:projectId/icons
Parameters
名称 | 类型 | 描述 |
---|---|---|
icons |
array |
图标数组 |
Input Example
{
"icons": [{"id": 1, "name": "火车"}, {"id": 2, "name": "飞机"}]
}
Response
{
"ret": true,
"data": "成功添加项目图标"
}
DELETE /user/projects/:projectId/icons
Parameters
名称 | 类型 | 描述 |
---|---|---|
icons |
array |
图标数组 |
Input Example
{
"icons": [{"id": 1, "name": "火车"}, {"id": 2, "name": "飞机"}]
}
Response
{
"ret": true,
"data": "成功删除项目图标"
}
POST /user/projects/:projectId/icons/update
Response
{
"ret": true,
"data": "成功更新项目图标"
}
POST /user/projects/:projectId/update
Parameters
名称 | 类型 | 描述 |
---|---|---|
versionType |
string |
'major/minor/revision',表示这次升级的类型 |
Input Example
{
"versionType": "revision"
}
Response
{
"ret": true,
"data": "成功生成项目版本"
}
PATCH /user/projects/:projectId
Input Example
{
"info": "项目描述",
"name": "项目名称",
"publicProject": true,
"owner": 2
}
Response
{
"ret": true,
"data": "成功更新项目"
}
这里要注意:owner 有权限删人。传过来的数组是最后项目成员数组,要判断是数组是否有效。要记录下被删除的同学,以便进行通知。
PATCH /user/projects/:projectId/members
Input Example
{
"members": [{"id": 1, "name": "minghao.yu"}, {"id": 2, "name": "xiaohua.zhang"}]
}
Response
{
"ret": true,
"data": "成功更新项目成员"
}