You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
Jasder 566db3b887
ADD create project and repository api
5 years ago
.ipynb_checkpoints 所属课程 5 years ago
app ADD create project and repository api 5 years ago
bin first commit 6 years ago
config ADD create project and repository api 5 years ago
db ADD index to repositories 5 years ago
lib fixbug 5 years ago
public ADD model License 5 years ago
spec 项目列表 5 years ago
test first commit 6 years ago
tmp first commit 6 years ago
vendor admins: help manage 6 years ago
warn 500页面 6 years ago
.gitignore FIX gitignore .bashrc file 5 years ago
.merge_file_a17580 教学案例详情和新建 6 years ago
Gemfile ADD gem 'acts_as_list' 5 years ago
README.md FIX update README.md 5 years ago
Rakefile first commit 6 years ago
bootstrap-datetimepicker.css 调整 5 years ago
config.ru first commit 6 years ago
dump.rdb 多选题的调分 6 years ago

README.md

API文档


基本介绍

开发API服务地址

https://testgitea.trustie.net/

响应状态说明:

字段 类型 说明
status int 响应状态码0:请求成功,-1: 请求失败
message string 响应说明

API接口


用户注册(通过其他平台)

POST accounts/remote_register

示例

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

请求参数说明:

参数名 必选 类型 说明
email string 邮箱
phone string 手机号
password string 秘密
platform string 用户来源的相关平台,取值范围['educoder', 'trustie', 'forge'], 默认值为forge

返回参数说明:

参数名 类型 说明
user json object 返回数据
-- id int 用户id
-- token string 用户token

返回值

{
  "status": 0,
  "message": "success",
  "user": {
    "id": 36400,
    "token": "8c87a80d9cfacc92fcb2451845104f35119eda96"
  }
}

获取项目类别列表(可根据名称搜素)

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": "大数据"
    }
  ]
}

获取项目语言列表(可根据名称搜素)

GET api/project_languages

示例

curl -X GET \
-d "name=Ruby" \
http://localhost:3000/api/project_languages/  | jq

请求参数说明:

参数名 必选 类型 说明
name string 类别名称

返回参数说明:

参数名 类型 说明
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

请求参数说明:

参数名 必选 类型 说明
name string gitignore名称

返回参数说明:

参数名 类型 说明
ignores array 返回数据
-- id int id
-- name string gitignore名称

返回值

{
  "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"
    }
  ]
}