|
|
|
@ -4,78 +4,233 @@
|
|
|
|
|
|
|
|
|
|
开发API服务地址:
|
|
|
|
|
|
|
|
|
|
http://120.27.155.180:3000/
|
|
|
|
|
https://testgitea.trustie.net/
|
|
|
|
|
|
|
|
|
|
邮箱/密码:25012034@qq.com/11111111
|
|
|
|
|
|
|
|
|
|
**Applications**
|
|
|
|
|
- iOS
|
|
|
|
|
Application Id:
|
|
|
|
|
响应状态说明:
|
|
|
|
|
|
|
|
|
|
|字段|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|status |int |响应状态码,0:请求成功,-1: 请求失败|
|
|
|
|
|
|message |string |响应说明 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### API接口
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
#### 用户注册(通过其他平台)
|
|
|
|
|
```
|
|
|
|
|
f2ac514ff9c4630d9509a5f361362eb52b28e36396bd92cefcdafe8dee1055c5
|
|
|
|
|
POST accounts/remote_register
|
|
|
|
|
```
|
|
|
|
|
Secret:
|
|
|
|
|
*示例*
|
|
|
|
|
```
|
|
|
|
|
77c88ef325b2c557d8d7699694882ae73876bf1fe18554c119865bddb364c0d8
|
|
|
|
|
curl -X POST \
|
|
|
|
|
-d "email=2456233122@qq.com" \
|
|
|
|
|
-d "password=djs_D_00001" \
|
|
|
|
|
-d "phone=18816895620" \
|
|
|
|
|
-d "platform=forge" \
|
|
|
|
|
http://localhost:3000/api/accounts/remote_register | jq
|
|
|
|
|
```
|
|
|
|
|
- Android
|
|
|
|
|
*请求参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|必选|类型|说明|
|
|
|
|
|
-|-|-|-
|
|
|
|
|
|email |是|string |邮箱 |
|
|
|
|
|
|phone |是|string |手机号 |
|
|
|
|
|
|password |是|string |秘密 |
|
|
|
|
|
|platform |否|string |用户来源的相关平台,取值范围['educoder', 'trustie', 'forge'], 默认值为forge |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*返回参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|user|json object |返回数据|
|
|
|
|
|
|-- id |int |用户id |
|
|
|
|
|
|-- token |string|用户token|
|
|
|
|
|
|
|
|
|
|
Application Id:
|
|
|
|
|
|
|
|
|
|
返回值
|
|
|
|
|
```
|
|
|
|
|
1be5ac17e050d515a11b99bc16c445ab114c8f3513e59175b106bba1f746ea5e
|
|
|
|
|
{
|
|
|
|
|
"status": 0,
|
|
|
|
|
"message": "success",
|
|
|
|
|
"user": {
|
|
|
|
|
"id": 36400,
|
|
|
|
|
"token": "8c87a80d9cfacc92fcb2451845104f35119eda96"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Secret:
|
|
|
|
|
#### 获取项目类别列表(可根据名称搜素)
|
|
|
|
|
```
|
|
|
|
|
ec0bb068cf24a15389a6753da6d52c36c764a13d9913a97d14be6c9c6925255e
|
|
|
|
|
GET api/project_categories
|
|
|
|
|
```
|
|
|
|
|
*示例*
|
|
|
|
|
```
|
|
|
|
|
curl -X GET \
|
|
|
|
|
-d "name=大数据" \
|
|
|
|
|
http://localhost:3000/api/project_categories/ | jq
|
|
|
|
|
```
|
|
|
|
|
*请求参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|必选|类型|说明|
|
|
|
|
|
-|-|-|-
|
|
|
|
|
|name |否|string |类别名称 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*返回参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|project_categories|array |返回数据|
|
|
|
|
|
|-- id |int |类别id |
|
|
|
|
|
|-- name |string|类别名称|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回值
|
|
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"project_categories": [
|
|
|
|
|
{
|
|
|
|
|
"id": 1,
|
|
|
|
|
"name": "大数据"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
### API接口
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
#### 用户注册(通过其他平台)
|
|
|
|
|
#### 获取项目语言列表(可根据名称搜素)
|
|
|
|
|
```
|
|
|
|
|
POST accounts/remote_register
|
|
|
|
|
GET api/project_languages
|
|
|
|
|
```
|
|
|
|
|
*示例*
|
|
|
|
|
```
|
|
|
|
|
curl -X POST \
|
|
|
|
|
-d "email=2123233122@qq.com" \
|
|
|
|
|
-d "password=djs_D_00001" \
|
|
|
|
|
-d "phone=18816365620" \
|
|
|
|
|
-d "platform=forge" \
|
|
|
|
|
http://localhost:3000/api/accounts/remote_register | jq
|
|
|
|
|
curl -X GET \
|
|
|
|
|
-d "name=Ruby" \
|
|
|
|
|
http://localhost:3000/api/project_languages/ | jq
|
|
|
|
|
```
|
|
|
|
|
请求参数说明:
|
|
|
|
|
*请求参数说明:*
|
|
|
|
|
|
|
|
|
|
email(requires): 用户邮箱
|
|
|
|
|
|参数名|必选|类型|说明|
|
|
|
|
|
-|-|-|-
|
|
|
|
|
|name |否|string |类别名称 |
|
|
|
|
|
|
|
|
|
|
phone(requires): 手机号
|
|
|
|
|
|
|
|
|
|
password(requires): 密码
|
|
|
|
|
*返回参数说明:*
|
|
|
|
|
|
|
|
|
|
platform(optional):用户来源的相关平台,取值范围['educoder', 'trustie', 'forge'],
|
|
|
|
|
|参数名|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|project_languages|array |返回数据|
|
|
|
|
|
|-- id |int |语言id |
|
|
|
|
|
|-- name |string|语言名称|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回参数说明:
|
|
|
|
|
返回值
|
|
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"project_languages": [
|
|
|
|
|
{
|
|
|
|
|
"id": 1,
|
|
|
|
|
"name": "Ruby"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
#### 获取.gitignore模板列表(可根据名称搜素)
|
|
|
|
|
```
|
|
|
|
|
GET api/ignores
|
|
|
|
|
```
|
|
|
|
|
*示例*
|
|
|
|
|
```
|
|
|
|
|
curl -X GET \
|
|
|
|
|
-d "name=Ada" \
|
|
|
|
|
http://localhost:3000/api/ignores/ | jq
|
|
|
|
|
```
|
|
|
|
|
*请求参数说明:*
|
|
|
|
|
|
|
|
|
|
status: 响应状态码,0:请求成功,-1: 请求失败
|
|
|
|
|
|参数名|必选|类型|说明|
|
|
|
|
|
-|-|-|-
|
|
|
|
|
|name |否|string |gitignore名称 |
|
|
|
|
|
|
|
|
|
|
message: 响应说明
|
|
|
|
|
|
|
|
|
|
id: 用户id
|
|
|
|
|
*返回参数说明:*
|
|
|
|
|
|
|
|
|
|
token: 用户对应token,唯一
|
|
|
|
|
|参数名|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|ignores|array |返回数据|
|
|
|
|
|
|-- id |int |id |
|
|
|
|
|
|-- name |string|gitignore名称|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回值
|
|
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"status": 0,
|
|
|
|
|
"message": "success",
|
|
|
|
|
"user": {
|
|
|
|
|
"id": 36400,
|
|
|
|
|
"token": "8c87a80d9cfacc92fcb2451845104f35119eda96"
|
|
|
|
|
}
|
|
|
|
|
"ignores": [
|
|
|
|
|
{
|
|
|
|
|
"id": 1,
|
|
|
|
|
"name": "Ada"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
#### 获取开源许可证列表(可根据名称搜素)
|
|
|
|
|
```
|
|
|
|
|
GET api/licenses
|
|
|
|
|
```
|
|
|
|
|
*示例*
|
|
|
|
|
```
|
|
|
|
|
curl -X GET \
|
|
|
|
|
-d "name=AFL" \
|
|
|
|
|
http://localhost:3000/api/licenses/ | jq
|
|
|
|
|
```
|
|
|
|
|
*请求参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|必选|类型|说明|
|
|
|
|
|
-|-|-|-
|
|
|
|
|
|name |否|string |开源许可证名称 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*返回参数说明:*
|
|
|
|
|
|
|
|
|
|
|参数名|类型|说明|
|
|
|
|
|
-|-|-
|
|
|
|
|
|licenses|array |返回数据|
|
|
|
|
|
|-- id |int |id |
|
|
|
|
|
|-- name |string|开源许可证名称|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
返回值
|
|
|
|
|
```
|
|
|
|
|
{
|
|
|
|
|
"licenses": [
|
|
|
|
|
{
|
|
|
|
|
"id": 57,
|
|
|
|
|
"name": "AFL-1.2"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": 76,
|
|
|
|
|
"name": "AFL-3.0"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": 214,
|
|
|
|
|
"name": "AFL-1.1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": 326,
|
|
|
|
|
"name": "AFL-2.1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"id": 350,
|
|
|
|
|
"name": "AFL-2.0"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
---
|
|
|
|
|