Merge branch 'develop' into standalone_develop

This commit is contained in:
2022-07-15 14:41:12 +08:00
5 changed files with 663 additions and 360 deletions

View File

@@ -409,21 +409,21 @@ await octokit.request('GET /api/yystopf/csfjkkj/tags.json')
```
## 仓库分支列表
仓库分支列表
## 仓库所有分支列表
仓库所有分支列表
> 示例:
```shell
curl -X GET http://localhost:3000/api/yystopf/csfjkkj/branches.json
curl -X GET http://localhost:3000/api/v1/yystopf/csfjkkj/branches/all.json
```
```javascript
await octokit.request('GET /api/yystopf/csfjkkj/branches.json')
await octokit.request('GET /api/v1/yystopf/csfjkkj/branches/all.json')
```
### HTTP 请求
`GET /api/:owner/:repo/branches.json`
`GET /api/v1/:owner/:repo/branches/all.json`
### 请求参数:
参数 | 必选 | 默认 | 类型 | 字段说明
@@ -466,6 +466,95 @@ await octokit.request('GET /api/yystopf/csfjkkj/branches.json')
]
```
## 仓库创建分支
为仓库创建一个新的分支
> 示例:
```shell
curl -X POST http://localhost:3000/api/v1/yystopf/csfjkkj/branches.json
```
```javascript
await octokit.request('POST /api/v1/yystopf/csfjkkj/branches.json')
```
### HTTP 请求
`POST /api/v1/:owner/:repo/branches.json`
### 请求参数:
参数 | 必选 | 默认 | 类型 | 字段说明
--------- | ------- | ------- | -------- | ----------
|owner |是| |string |用户登录名 |
|repo |是| |string |项目标识identifier |
|new_branch_name|是string| 新分支名称|
|old_branch_name|否||string| 来源分支名称|
### 返回字段说明:
参数 | 类型 | 字段说明
--------- | ----------- | -----------
|name |string|分支名称|
|commit.id |string|提交ID|
|commit.message |string|提交信息|
|commit.author.id |string|提交作者ID|
|commit.author.login |string|提交作者标识|
|commit.author.name |string|提交作者名称|
|commit.author.type |string|提交作者类型|
|commit.committer.id |string|提交者ID|
|commit.committer.login |string|提交者标识|
|commit.committer.name |string|提交者名称|
|commit.committer.type |string|提交者类型|
|commit.committer.image_url|string|提交者头像|
|commit.time_ago |string|分支最新提交时间距现在时间差|
|commit.timestamp |string|分支最新提交时间|
|protected |bool |是否为保护分支|
|user_can_push |bool |当前用户是否能提交|
|user_can_merge |bool |当前用户是否能合并|
|commit_id |string|提交ID|
|commit_time_from_now |string|分支最新提交时间距现在时间差|
|commit_time |string|分支最新提交时间|
|http_url |string|分支http地址|
|zip_url |string|分支zip包下载地址|
|tar_url |string|分支tar包下载地址|
> 返回的JSON示例:
```json
{
"name": "new_branch_8",
"commit": {
"id": "80dd40214a58622312393b2ae693756a4781fab2",
"message": "x拟增\n\nSigned-off-by: yystopf <yystopf@163.com>",
"author": {
"id": "2",
"login": "yystopf",
"name": "heh",
"type": "User",
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
},
"committer": {
"id": "2",
"login": "yystopf",
"name": "heh",
"type": "User",
"image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
},
"time_ago": "1天前",
"timestamp": "2022-07-13T09:54:15Z"
},
"protected": false,
"user_can_push": true,
"user_can_merge": true,
"commit_id": "80dd40214a58622312393b2ae693756a4781fab2",
"commit_time_from_now": "1天前",
"commit_time": "2022-07-13T09:54:15Z",
"default_branch": "master",
"http_url": "http://127.0.0.1:10081/yystopf/ceshi_hook.git",
"zip_url": "http://localhost:3000/api/yystopf/ceshi_hook/archive/new_branch_8.zip",
"tar_url": "http://localhost:3000/api/yystopf/ceshi_hook/archive/new_branch_8.tar.gz"
}
```
## 仓库贡献者列表
仓库贡献者列表