Merge branch 'develop' into standalone_develop

This commit is contained in:
2022-07-15 17:03:31 +08:00
9 changed files with 483 additions and 33 deletions

View File

@@ -472,7 +472,10 @@ await octokit.request('GET /api/v1/yystopf/csfjkkj/branches/all.json')
> 示例:
```shell
curl -X POST http://localhost:3000/api/v1/yystopf/csfjkkj/branches.json
curl -X POST \
-d "new_branch_name=ceshi_branch_1" \
-d "old_branch_name=master" \
http://localhost:3000/api/v1/yystopf/csfjkkj/branches.json
```
```javascript
@@ -487,8 +490,8 @@ await octokit.request('POST /api/v1/yystopf/csfjkkj/branches.json')
--------- | ------- | ------- | -------- | ----------
|owner |是| |string |用户登录名 |
|repo |是| |string |项目标识identifier |
|new_branch_name|是string| 新分支名称|
|old_branch_name|否|string| 来源分支名称|
|new_branch_name|是||string| 新分支名称|
|old_branch_name|否||string| 来源分支名称|
### 返回字段说明:
参数 | 类型 | 字段说明
@@ -1303,6 +1306,113 @@ await octokit.request('GET /api/yystopf/csfjkkj/readme.json')
Success Data.
</aside>
## 获取文件树列表
根据分支、标签、commit ID获取仓库文件树列表
> 示例:
```shell
curl -X GET \
-d "recursive=true" \
-d "page=1" \
-d "limit=1" \
http://localhost:3000/api/v1/yystopf/csfjkkj/git/trees/80dd40214a58622312393b2ae693756a4781fab2.json
```
```javascript
await octokit.request('GET /api/v1/yystopf/csfjkkj/git/trees/80dd40214a58622312393b2ae693756a4781fab2.json')
```
### HTTP 请求
`GET /api/v1/:owner/:repo/git/trees/:sha.json`
### 请求参数:
参数 | 必选 | 默认 | 类型 | 字段说明
--------- | ------- | ------- | -------- | ----------
|owner |是| | string |用户登录名 |
|repo |是| | string |项目标识identifier |
|sha |是| | string |分支名称、tag名称或是提交记录id |
|recursive|否| | bool |是否显示目录|
|page |否|1 | int |页码|
|limit |否|15| int |分页个数|
### 返回字段说明:
参数 | 类型 | 字段说明
--------- | ----------- | -----------
|total_count |int |文件树数量|
|sha |string |查询分支、标签、commit_id最后一次提交的ID |
|entries.name |string |文件树名称|
|entries.mode |string |文件树权限|
|entries.type |string |文件树类型, file文件dir: 文件夹|
|entries.size |int |文件树大小|
|entries.sha |string |文件树commit_ID|
> 返回的JSON示例:
```json
{
"total_count": 13,
"sha": "80dd40214a58622312393b2ae693756a4781fab2",
"entries": [
{
"name": "README.md",
"mode": "100644",
"type": "file",
"size": 14,
"sha": "b2f7b457fd8ca55f2274032cbb2abcb7dd8cd57e"
}
]
}
```
<aside class="success">
Success Data.
</aside>
## 获取仓库blobs内容
根据commit ID获取仓库blobs内容
> 示例:
```shell
curl -X GET http://localhost:3000/api/v1/yystopf/csfjkkj/git/blobs/80dd40214a58622312393b2ae693756a4781fab2.json
```
```javascript
await octokit.request('GET /api/v1/yystopf/csfjkkj/git/blobs/80dd40214a58622312393b2ae693756a4781fab2.json')
```
### HTTP 请求
`GET /api/v1/:owner/:repo/git/blobs/:sha.json`
### 请求参数:
参数 | 必选 | 默认 | 类型 | 字段说明
--------- | ------- | ------- | -------- | ----------
|owner|是| | string |用户登录名 |
|repo |是| | string |项目标识identifier |
|sha |是| | string |提交记录id |
### 返回字段说明:
参数 | 类型 | 字段说明
--------- | ----------- | -----------
|sha |string |提交ID |
|size |int |blobs大小|
|encoding |string |内容编码模式|
|content |string |blobs内容|
> 返回的JSON示例:
```json
{
"sha": "80dd40214a58622312393b2ae693756a4781fab2",
"size": 247,
"encoding": "base64",
"content": "dHJlZSAyN2JjYjI2ZDQ5YmU1M2RmOGZmYTk5NDc3MjRkYmI3YzIzZWI4MjY4CnBhcmVudCA3ZTRkOGJiM2MyOGUyNGQ0Y2Q2YjIwNWYyZWVkMzI1MTNlOTM3NTI0CmF1dGhvciB5eXN0b3BmIDx5eXN0b3BmQDE2My5jb20+IDE2NTc3MDYwNTUgKzAwMDAKY29tbWl0dGVyIHl5c3RvcGYgPHl5c3RvcGZAMTYzLmNvbT4gMTY1NzcwNjA1NSArMDAwMAoKeOaLn+WingoKU2lnbmVkLW9mZi1ieTogeXlzdG9wZiA8eXlzdG9wZkAxNjMuY29tPg=="
}
```
<aside class="success">
Success Data.
</aside>
## 获取仓库贡献者
获取仓库贡献者