Merge branch 'develop' into standalone_develop
This commit is contained in:
commit
e4ec8e8ed5
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
title: Trustie API Reference
|
||||
title: GitLink API Reference
|
||||
|
||||
language_tabs: # must be one of https://git.io/vQNgJ
|
||||
- shell: Shell
|
||||
- javascript: JavaScript
|
||||
|
||||
toc_footers:
|
||||
- <a href='https://www.trustie.net/login?login=false'>Sign Up for a User</a>
|
||||
- <a href='https://www.trustie.net'>Powered by Trustie</a>
|
||||
- <a href='https://www.gitlink.org.cn/login'>Sign In for a User</a>
|
||||
- <a href='https://www.gitlink.org.cn'>Powered by GitLink</a>
|
||||
|
||||
includes:
|
||||
- licenses
|
||||
|
@ -31,8 +31,8 @@ code_clipboard: true
|
|||
|
||||
# Introduction
|
||||
|
||||
Welcome to the Trustie API! You can use our API to access Trustie API endpoints, which can get information on projects, repository, and users in our platform.
|
||||
Welcome to the GitLink API! You can use our API to access GitLink API endpoints, which can get information on projects, repository, and users in our platform.
|
||||
|
||||
We have language bindings in Shell,avaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
|
||||
|
||||
This example API documentation page was created with [Trustie](https://www.trustie.net). Feel free to edit it and use it as a base for your own API's documentation.
|
||||
This example API documentation page was created with [GitLink](https://www.gitlink.org.cn). Feel free to edit it and use it as a base for your own API's documentation.
|
||||
|
|
|
@ -26,25 +26,84 @@ await octokit.request('GET /api/jasder/jasder_test.json')
|
|||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|id |int |id |
|
||||
|name |string|项目名称|
|
||||
|identifier |string|项目标识|
|
||||
|is_public |boolean|项目是否公开, true:公开,false:私有|
|
||||
|description |string|项目简介|
|
||||
|repo_id |int|仓库id|
|
||||
|repo_identifier|string|仓库标识|
|
||||
|identifier |string|项目标识|
|
||||
|name |string|项目名称|
|
||||
|project_id |int |项目ID |
|
||||
|repo_id |int |仓库ID|
|
||||
|issues_count |int |疑修数量|
|
||||
|pull_requests_count |int |合并请求数量|
|
||||
|project_identifier |string|项目标识|
|
||||
|praises_count |int |项目点赞数|
|
||||
|forked_count |int |项目复刻数|
|
||||
|watchers_count |int |项目关注数|
|
||||
|versions_count |int |项目里程碑数量|
|
||||
|version_releases_count |int |项目版本数|
|
||||
|version_releasesed_count |int |项目已发行项目版本数|
|
||||
|contributor_users_count |int |项目贡献者数|
|
||||
|permission |string|用户权限 Admin: 平台管理员, Manager: 项目管理员, Developer: 项目开发者, Reporter: 项目报告者|
|
||||
|mirror_url |string|项目镜像地址|
|
||||
|mirror |bool |是否为镜像项目|
|
||||
|type |int |项目类型 0: 托管项目,1: 镜像项目,2: 同步镜像项目|
|
||||
|forked_from_project_id |int |项目复刻来源项目ID|
|
||||
|fork_info.fork_form_name |string|项目复刻来源项目的名称|
|
||||
|fork_info.fork_project_user_login|string|项目复刻来源项目拥有者标识|
|
||||
|fork_info.fork_project_identifier|string|项目复刻来源项目标识|
|
||||
|fork_info.fork_project_user_name |string|项目复刻来源项目拥有者名称|
|
||||
|size |string|项目大小|
|
||||
|ssh_url |string|项目ssh clone地址|
|
||||
|clone_url |string|项目http clone地址|
|
||||
|default_branch |string|项目默认分支|
|
||||
|empty |bool |项目是否为空|
|
||||
|full_name |string|项目路径|
|
||||
|private |bool |项目是否为私有项目|
|
||||
|author.id |int |项目拥有者ID|
|
||||
|author.login |string|项目拥有者标识|
|
||||
|author.type |string|项目拥有者类型|
|
||||
|author.name |string|项目拥有者名称|
|
||||
|author.image_url |string|项目拥有者头像地址|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "ni项目",
|
||||
"identifier": "mirror_demo",
|
||||
"is_public": true,
|
||||
"description": "my first project mirror_demo",
|
||||
"repo_id": 75073,
|
||||
"repo_identifier": "mirror_demo"
|
||||
"identifier": "hahahah",
|
||||
"name": "hahahah",
|
||||
"project_id": 469,
|
||||
"repo_id": 469,
|
||||
"issues_count": 2,
|
||||
"pull_requests_count": 3,
|
||||
"project_identifier": "hahahah",
|
||||
"praises_count": 0,
|
||||
"forked_count": 1,
|
||||
"watchers_count": 0,
|
||||
"versions_count": 0,
|
||||
"version_releases_count": 0,
|
||||
"version_releasesed_count": 0,
|
||||
"contributor_users_count": 1,
|
||||
"permission": "Admin",
|
||||
"mirror_url": null,
|
||||
"mirror": false,
|
||||
"type": 0,
|
||||
"open_devops": false,
|
||||
"watched": false,
|
||||
"praised": false,
|
||||
"status": 1,
|
||||
"forked_from_project_id": null,
|
||||
"size": "2.1 MB",
|
||||
"ssh_url": "virus@127.0.0.1:10081:yystopf/hahahah.git",
|
||||
"clone_url": "http://127.0.0.1:10081/yystopf/hahahah.git",
|
||||
"default_branch": "master",
|
||||
"empty": false,
|
||||
"full_name": "yystopf/hahahah",
|
||||
"private": false,
|
||||
"author": {
|
||||
"id": 2,
|
||||
"login": "yystopf",
|
||||
"type": "User",
|
||||
"name": "heh",
|
||||
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -75,25 +134,36 @@ await octokit.request('GET /api/jasder/jasder_test/simple.json')
|
|||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|id |int |id |
|
||||
|name |string|项目名称|
|
||||
|identifier |string|项目标识|
|
||||
|is_public |boolean|项目是否公开, true:公开,false:私有|
|
||||
|description |string|项目简介|
|
||||
|repo_id |int|仓库id|
|
||||
|repo_identifier|string|仓库标识|
|
||||
|id |int |id |
|
||||
|name |string|项目名称|
|
||||
|platform |string|项目平台|
|
||||
|identifier |string|项目标识|
|
||||
|repo_id |int |仓库id|
|
||||
|open_devops |bool |是否开启工作流|
|
||||
|type |int |项目类型 0: 托管项目,1: 镜像项目,2: 同步镜像项目|
|
||||
|author.login |string|项目拥有者标识|
|
||||
|author.type |string|项目拥有者类型|
|
||||
|author.name |string|项目拥有者名称|
|
||||
|author.image_url|string|项目拥有者头像地址|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "ni项目",
|
||||
"identifier": "mirror_demo",
|
||||
"is_public": true,
|
||||
"description": "my first project mirror_demo",
|
||||
"repo_id": 75073,
|
||||
"repo_identifier": "mirror_demo"
|
||||
"identifier": "hahahah",
|
||||
"name": "hahahah",
|
||||
"platform": "forge",
|
||||
"id": 469,
|
||||
"repo_id": 469,
|
||||
"open_devops": false,
|
||||
"type": 0,
|
||||
"author": {
|
||||
"login": "yystopf",
|
||||
"name": "heh",
|
||||
"type": "User",
|
||||
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -125,9 +195,13 @@ await octokit.request('GET /api/yystopf/ceshi/detail.json')
|
|||
--------- | ----------- | -----------
|
||||
|content |string |仓库简介 |
|
||||
|website |string |仓库网址 |
|
||||
|readme |string |readme文件|
|
||||
|lesson_url |string |课程地址 |
|
||||
|identifier |string |项目标识 |
|
||||
|invite_code |string |项目邀请码 |
|
||||
|name |string |项目名称 |
|
||||
|description |string |项目描述 |
|
||||
|project_id |int |项目ID |
|
||||
|repo_id |int |仓库ID|
|
||||
|issues_count |int |项目issue数量|
|
||||
|pull_requests_count |int |项目合并请求数量|
|
||||
|project_identifier |int |项目标识|
|
||||
|
@ -137,7 +211,7 @@ await octokit.request('GET /api/yystopf/ceshi/detail.json')
|
|||
|versions_count |int |项目里程碑数量|
|
||||
|version_releases_count |int |项目发行版数量|
|
||||
|version_releasesed_count |int |项目发行版已发行数量|
|
||||
|permission |string |项目权限|
|
||||
|permission |string |项目权限, Admin: 平台管理员,Manager: 项目管理员, Developer: 项目开发者, Reporter: 项目报告者|
|
||||
|mirror_url |string |镜像地址|
|
||||
|mirror |bool |是否为镜像项目|
|
||||
|type |int |项目类型 0 普通项目 1 普通镜像项目 2 同步镜像项目|
|
||||
|
@ -145,59 +219,49 @@ await octokit.request('GET /api/yystopf/ceshi/detail.json')
|
|||
|watched |bool |是否关注|
|
||||
|praised |bool |是否点赞|
|
||||
|status |int |项目状态|
|
||||
|forked_from_project_id |int |fork项目id|
|
||||
|fork_info |object |fork项目信息|
|
||||
|forked_from_project_id |int |项目复刻来源项目id|
|
||||
|fork_info.fork_form_name |string |项目复刻来源项目的名称|
|
||||
|fork_info.fork_project_user_login|string |项目复刻来源项目拥有者标识|
|
||||
|fork_info.fork_project_identifier|string |项目复刻来源项目标识|
|
||||
|fork_info.fork_project_user_name |string |项目复刻来源项目拥有者名称|
|
||||
|size |string |仓库大小|
|
||||
|ssh_url |string |项目ssh地址|
|
||||
|clone_url |string |项目克隆地址|
|
||||
|ssh_url |string |项目ssh克隆地址|
|
||||
|clone_url |string |项目http克隆地址|
|
||||
|default_branch |string |仓库默认分支|
|
||||
|empty |bool |仓库是否为空|
|
||||
|full_name |string |仓库全称|
|
||||
|private |bool |仓库是否为私有项目|
|
||||
|license_name |string |许可证名称|
|
||||
|release_versions.list.name |string |项目issue数量|
|
||||
|release_versions.list.tag_name |string |发行版标签名称|
|
||||
|release_versions.list.created_at |string |发行版创建时间|
|
||||
|release_versions.total_count |int |发行版数量|
|
||||
|branches.list.name |string |分支名称|
|
||||
|branches.total_count |int |分支数量|
|
||||
|tags.list.name |string |标签名称|
|
||||
|tags.total_count |int |标签数量|
|
||||
|contributors.list.contributions|int |贡献数量|
|
||||
|contributors.list.login |string |贡献者登录名|
|
||||
|contributors.list.name |string |贡献者用户名称|
|
||||
|contributors.list.image_url |string |贡献者头像|
|
||||
|languages |object |项目语言占比|
|
||||
|author.id |int |项目拥有者ID|
|
||||
|author.login |string |项目拥有者标识|
|
||||
|author.type |string |项目拥有者类型|
|
||||
|author.name |string |项目拥有者名称|
|
||||
|author.image_url |string |项目拥有者头像地址|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "仓库简介",
|
||||
"website": "仓库网址",
|
||||
"readme": {
|
||||
"type": "file",
|
||||
"encoding": "base64",
|
||||
"size": 9,
|
||||
"name": "README.md",
|
||||
"path": "README.md",
|
||||
"content": "# ceshi\n\n",
|
||||
"sha": ""
|
||||
},
|
||||
"identifier": "ceshi",
|
||||
"name": "测试项目",
|
||||
"project_id": 2,
|
||||
"repo_id": 2,
|
||||
"issues_count": 0,
|
||||
"pull_requests_count": 0,
|
||||
"project_identifier": "ceshi",
|
||||
"content": null,
|
||||
"website": null,
|
||||
"lesson_url": null,
|
||||
"identifier": "hahahah",
|
||||
"invite_code": "8zfKtM",
|
||||
"name": "hahahah",
|
||||
"description": null,
|
||||
"project_id": 469,
|
||||
"repo_id": 469,
|
||||
"issues_count": 2,
|
||||
"pull_requests_count": 2,
|
||||
"project_identifier": "hahahah",
|
||||
"praises_count": 0,
|
||||
"forked_count": 0,
|
||||
"forked_count": 1,
|
||||
"watchers_count": 0,
|
||||
"versions_count": 0,
|
||||
"version_releases_count": 0,
|
||||
"version_releasesed_count": 0,
|
||||
"permission": "Reporter",
|
||||
"permission": "Admin",
|
||||
"mirror_url": null,
|
||||
"mirror": false,
|
||||
"type": 0,
|
||||
|
@ -205,71 +269,23 @@ await octokit.request('GET /api/yystopf/ceshi/detail.json')
|
|||
"watched": false,
|
||||
"praised": false,
|
||||
"status": 1,
|
||||
"forked_from_project_id": 1,
|
||||
"fork_info": {
|
||||
"fork_form_name": "测试项目",
|
||||
"fork_project_user_login": "ceshi_org",
|
||||
"fork_project_identifier": "ceshi",
|
||||
"fork_project_user_name": "ceshi_org"
|
||||
},
|
||||
"size": "25.0 KB",
|
||||
"ssh_url": "virus@localhost:yystopf/ceshi.git",
|
||||
"clone_url": "http://localhost:10080/yystopf/ceshi.git",
|
||||
"forked_from_project_id": null,
|
||||
"size": "2.1 MB",
|
||||
"ssh_url": "virus@127.0.0.1:10081:yystopf/hahahah.git",
|
||||
"clone_url": "http://127.0.0.1:10081/yystopf/hahahah.git",
|
||||
"default_branch": "master",
|
||||
"empty": false,
|
||||
"full_name": "yystopf/ceshi",
|
||||
"full_name": "yystopf/hahahah",
|
||||
"private": false,
|
||||
"license_name": "gnu-javamail-exception",
|
||||
"release_versions": {
|
||||
"list": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "vvvv",
|
||||
"tag_name": "v1.1",
|
||||
"created_at": "2019-07-18 10:16"
|
||||
}
|
||||
],
|
||||
"total_count": 1
|
||||
},
|
||||
"branches": {
|
||||
"list": [
|
||||
{
|
||||
"name": "master"
|
||||
}
|
||||
],
|
||||
"total_count": 1
|
||||
},
|
||||
"tags": {
|
||||
"list": [
|
||||
{
|
||||
"name": "v1.1"
|
||||
},
|
||||
{
|
||||
"name": "v1.0"
|
||||
}
|
||||
],
|
||||
"total_count": 2
|
||||
},
|
||||
"contributors": {
|
||||
"list": [
|
||||
{
|
||||
"contributions": 1,
|
||||
"gid": 2,
|
||||
"login": "yystopf",
|
||||
"type": "User",
|
||||
"name": "yystopf",
|
||||
"image_url": "avatars/User/b"
|
||||
}
|
||||
],
|
||||
"total_count": 1
|
||||
},
|
||||
"languages": {
|
||||
"HTML": "50.9%",
|
||||
"Ruby": "25.6%",
|
||||
"JavaScript": "21.4%",
|
||||
"CSS": "1.3%",
|
||||
"CoffeeScript": "0.7%",
|
||||
"Shell": "0.1%"
|
||||
"license_name": null,
|
||||
"branches_count": 1201,
|
||||
"tags_count": 0,
|
||||
"author": {
|
||||
"id": 2,
|
||||
"login": "yystopf",
|
||||
"type": "User",
|
||||
"name": "heh",
|
||||
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -392,6 +408,162 @@ await octokit.request('GET /api/yystopf/csfjkkj/tags.json')
|
|||
]
|
||||
```
|
||||
|
||||
|
||||
## 仓库分支列表
|
||||
仓库分支列表
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/yystopf/csfjkkj/branches.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/yystopf/csfjkkj/branches.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/branches.json`
|
||||
|
||||
### 请求参数:
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|owner |是| |string |用户登录名 |
|
||||
|repo |是| |string |项目标识identifier |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|name |string|分支名称|
|
||||
|http_url |string|分支http地址|
|
||||
|zip_url |string|分支zip包下载地址|
|
||||
|tar_url |string|分支tar包下载地址|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "master",
|
||||
"http_url": "http://127.0.0.1:10081/yystopf/hahahah.git",
|
||||
"zip_url": "http://localhost:3000/api/yystopf/hahahah/archive/master.zip",
|
||||
"tar_url": "http://localhost:3000/api/yystopf/hahahah/archive/master.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "touch-10",
|
||||
"http_url": "http://127.0.0.1:10081/yystopf/hahahah.git",
|
||||
"zip_url": "http://localhost:3000/api/yystopf/hahahah/archive/touch-10.zip",
|
||||
"tar_url": "http://localhost:3000/api/yystopf/hahahah/archive/touch-10.tar.gz"
|
||||
},
|
||||
{
|
||||
"name": "touch-100",
|
||||
"http_url": "http://127.0.0.1:10081/yystopf/hahahah.git",
|
||||
"zip_url": "http://localhost:3000/api/yystopf/hahahah/archive/touch-100.zip",
|
||||
"tar_url": "http://localhost:3000/api/yystopf/hahahah/archive/touch-100.tar.gz"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## 仓库贡献者列表
|
||||
仓库贡献者列表
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/yystopf/csfjkkj/contributors.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/yystopf/csfjkkj/contributors.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/contributors.json`
|
||||
|
||||
### 请求参数:
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|owner |是| |string |用户登录名 |
|
||||
|repo |是| |string |项目标识identifier |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|list.contributions |int |贡献者commit数量|
|
||||
|list.login |string|贡献者标识|
|
||||
|list.type |string|贡献者类型|
|
||||
|list.name |string|贡献者昵称|
|
||||
|list.image_url |string|贡献者头像地址|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"list": [
|
||||
{
|
||||
"contributions": 2411,
|
||||
"login": "yystopf",
|
||||
"type": "User",
|
||||
"name": "heh",
|
||||
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
|
||||
},
|
||||
{
|
||||
"contributions": 6,
|
||||
"login": "testforge3",
|
||||
"type": null,
|
||||
"name": "testforge3",
|
||||
"image_url": "system/lets/letter_avatars/2/T/132_143_60/120.png"
|
||||
}
|
||||
],
|
||||
"total_count": 2
|
||||
}
|
||||
```
|
||||
|
||||
## 仓库开发语言
|
||||
仓库开发语言组成
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/yystopf/csfjkkj/languages.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/yystopf/csfjkkj/languages.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/languages.json`
|
||||
|
||||
### 请求参数:
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|owner |是| |string |用户登录名 |
|
||||
|repo |是| |string |项目标识identifier |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|key |string |语言类型|
|
||||
|value |string |语言占比|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"Go": "99.0%",
|
||||
"Shell": "0.4%",
|
||||
"Smarty": "0.4%",
|
||||
"Makefile": "0.2%"
|
||||
}
|
||||
```
|
||||
|
||||
## 编辑仓库信息
|
||||
编辑仓库信息
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue