forked from Trustie/forgeplus
FIX 更新pulls的api文档
This commit is contained in:
parent
a1cbd8aa30
commit
1fa44535bb
31
CHANGELOG.md
31
CHANGELOG.md
|
@ -1,4 +1,35 @@
|
|||
# Changelog
|
||||
## [v3.2.0](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2021-06-09
|
||||
|
||||
### ENHANCEMENTS
|
||||
* ADD 集成邮件和平台站内信等通知系统
|
||||
* Fix 代码库二级页面-优化文件子目录浏览功能(#50388)
|
||||
* Fix 代码库二级页面-优化commit提交详情页页面排版及数据显示(#50372)
|
||||
* Fix 代码库二级页面-优化commit提交信息列表页加载方式和数据排序功能(#50348)
|
||||
* Fix 代码库二级页面-优化创建发行版功能(#50346)
|
||||
* Fix 代码库二级页面-优化标签列表页功能(#50344)
|
||||
* Fix 代码库二级页面-优化发行版本列表页功能(#50345)
|
||||
* Fix 代码库二级页面-优化分支列表页功能(#50343)
|
||||
* Fix 其他问题优化(#51581) (#51343) (#51108)
|
||||
|
||||
---
|
||||
|
||||
### BUGFIXES
|
||||
* Fix 发行版—标签跳转链接错误(#51666)
|
||||
* Fix 文件预览报错(#51660)
|
||||
* Fix 标签创建时间显示错误(#51658)
|
||||
* Fix 分支列表中头像显示问题(#51656)
|
||||
* Fix 文本信息过长(#51630) (#51626)
|
||||
* Fix 版本库中附件下载400(#51625)
|
||||
* Fix loading页面优化(#51588)
|
||||
* Fix 提交详情页面优化(#51577)
|
||||
* Fix 修复易修复制功能(#51569)
|
||||
* Fix 修复新建发行版用户信息显示错误的问题(#51665)
|
||||
* Fix 修复查看文件详细信息报错的问题(#51561)
|
||||
* Fix 修复提交记录中时间显示格式问题(#51526)
|
||||
* Fix 组织下项目更加更新时间倒序排序(#50833)
|
||||
|
||||
|
||||
## [v3.1.0](https://forgeplus.trustie.net/projects/jasder/forgeplus/releases) - 2021-06-09
|
||||
|
||||
* ENHANCEMENTS
|
||||
|
|
|
@ -1 +1,502 @@
|
|||
# Pulls
|
||||
|
||||
|
||||
## Get a pull request
|
||||
获取合并请求详情接口
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls/88.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/Jasder/gitlink/pulls/88.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/pulls/:id.json`
|
||||
|
||||
### 请求参数:
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|owner |是| |string |用户登录名 |
|
||||
|repo |是| |string |项目标识identifier |
|
||||
|id |是| | integer | pull id值 |
|
||||
|
||||
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": 0,
|
||||
"message": "响应成功",
|
||||
"project_name": "Gitlink",
|
||||
"identifier": "forgeplus",
|
||||
"project_identifier": "forgeplus",
|
||||
"pr_time": "52分钟前",
|
||||
"commits_count": 229,
|
||||
"files_count": 328,
|
||||
"comments_count": 0,
|
||||
"comments_total_count": 0,
|
||||
"pull_request": {
|
||||
"id": 1189,
|
||||
"base": "master",
|
||||
"head": "develop",
|
||||
"status": 0,
|
||||
"fork_project_id": null,
|
||||
"is_original": false,
|
||||
"pull_request_staus": "open",
|
||||
"fork_project_user": null,
|
||||
"create_user": "jasder",
|
||||
"mergeable": true,
|
||||
"state": "open"
|
||||
},
|
||||
"issue": {
|
||||
"id": 51888,
|
||||
"subject": "FIx release v3.2.0",
|
||||
"description": null,
|
||||
"is_private": false,
|
||||
"branch_name": null,
|
||||
"project_author_name": "Gitlink",
|
||||
"closed_on": "",
|
||||
"created_at": "2021-10-12 15:51",
|
||||
"assign_user_name": "victor",
|
||||
"assign_user_login": "moshenglv",
|
||||
"author_name": "段甲生",
|
||||
"author_login": "jasder",
|
||||
"author_picture": "images/avatars/User/36480?t=1615520120",
|
||||
"issue_status": "新增",
|
||||
"priority": "正常",
|
||||
"version": null,
|
||||
"issue_tags": null
|
||||
},
|
||||
"conflict_files": []
|
||||
}
|
||||
```
|
||||
|
||||
## 获取pull request文件列表
|
||||
获取pull request文件列表
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET \
|
||||
http://localhost:3000/api/Jason/gitlink/pulls/1/files.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/jasder/gitlink/pulls/1/files.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/pulls/:id/files.json`
|
||||
|
||||
### 请求参数:
|
||||
|参数名|必选|类型|说明|
|
||||
|-|-|-|-|
|
||||
|owner |是|string |用户登录名 |
|
||||
|repo |是|string |project's identifier |
|
||||
|id |是|int |pull request's id |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|-|-|-|
|
||||
|files_count |int|文件更改的总数量|
|
||||
|total_addition |int|添加代码总行数|
|
||||
|total_deletion |int|删除代码总行数|
|
||||
|files |array||
|
||||
|-- sha |string|commit's sha value|
|
||||
|-- name |string|当前文件名|
|
||||
|-- old_name |string| 修改之前的文件名称,与name相同的话,说明文件名未更改|
|
||||
|-- addition |int|文件添加的行数|
|
||||
|-- deletion |int|文件删除的行数|
|
||||
|-- type |int|文件类型, 1: 表示该文件只添加了内容,2: 表示该文件内容有修改, 3: 表示文件被删除或者改文件只删除了内容|
|
||||
|-- isCreated |boolean|当前文件是否为新增文件, true: 是, false: 否|
|
||||
|-- isDeleted |boolean|当前文件是否被删除, true: 是,false: 否|
|
||||
|-- isBin |boolean|当前文件是否为二进制文件,true: 是,false: 否|
|
||||
|-- isLFSFile |boolean|当前文件是否为LFS文件,true: 是,false: 否|
|
||||
|-- isRenamed |boolean|当前文件是否被重命名,true: 是,false: 否|
|
||||
|-- sections |array||
|
||||
|---- fileName |string|文件名称|
|
||||
|---- lines |array||
|
||||
|------ leftIdx |string|文件变动之前所在行数|
|
||||
|------ rightIdx |string|文件更改后所在行数|
|
||||
|------ type |string|文件变更类型,1: 新增,2: 修改, 3: 删除, 4: diff统计信息|
|
||||
|------ content |string|文件变更的内容|
|
||||
|------ sectionInfo |object||
|
||||
|-------- path |string|文件相对仓库的路径|
|
||||
|-------- lastLeftIdx |int||
|
||||
|-------- lastRightIdx |int||
|
||||
|-------- leftHunkSize |int|文件变更之前的行数|
|
||||
|-------- rightHunkSize |int|文件变更之后的行数(及当前页面编辑器显示的总行数)|
|
||||
|-------- leftIdx |int|文件变更之前所在行数|
|
||||
|-------- rightIdx |int|文件变更之后所在行数(即:页面编辑器开始显示的行数)|
|
||||
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"files_count": 6,
|
||||
"total_addition": 447,
|
||||
"total_deletion": 0,
|
||||
"files": [
|
||||
{
|
||||
"sha": "xefenisnii",
|
||||
"name": "文件.txt",
|
||||
"old_name": "文件.txt",
|
||||
"index": 6,
|
||||
"addition": 2,
|
||||
"deletion": 0,
|
||||
"type": 1,
|
||||
"isCreated": true,
|
||||
"isDeleted": false,
|
||||
"isBin": false,
|
||||
"isLFSFile": false,
|
||||
"isRenamed": false,
|
||||
"isSubmodule": false,
|
||||
"sections": [
|
||||
{
|
||||
"fileName": "文件.txt",
|
||||
"name": "",
|
||||
"lines": [
|
||||
{
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 0,
|
||||
"type": 4,
|
||||
"content": "@@ -0,0 +1,2 @@",
|
||||
"sectionInfo": {
|
||||
"path": null,
|
||||
"lastLeftIdx": null,
|
||||
"lastRightIdx": null,
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 0,
|
||||
"leftHunkSize": null,
|
||||
"rightHunkSize": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 1,
|
||||
"type": 2,
|
||||
"content": "+用例图一致性更新",
|
||||
"sectionInfo": null
|
||||
},
|
||||
{
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 2,
|
||||
"type": 2,
|
||||
"content": "+工程文件直接上传会有文件缺失,现在压缩后上传",
|
||||
"sectionInfo": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## 获取pull request的commits列表
|
||||
获取pull request的commits列表
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/jasder/jasder_test/pulls/1/commits.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/jasder/jasder_test/pulls/1/commits.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/pulls/:id/commits.json`
|
||||
|
||||
### 请求参数:
|
||||
|参数名|必选|类型|说明|
|
||||
|-|-|-|-|
|
||||
|owner |是|string |用户登录名 |
|
||||
|repo |是|string |project's identifier |
|
||||
|id |是|int |pull request's id |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|commits_count |int|commits总数量|
|
||||
|commits |array||
|
||||
|-- author |object|项目作者|
|
||||
|---- login |string|用户login|
|
||||
|---- name |string|用户姓名|
|
||||
|---- image_url |string|用户头像|
|
||||
|-- committer |object|commit提交用户|
|
||||
|---- login |string|用户login|
|
||||
|---- name |string|用户姓名|
|
||||
|---- image_url |string|用户头像|
|
||||
|-- timestamp |int|commit的unix时间戳|
|
||||
|-- time_from_now|string|commit’s 提交时间距当前时间的时间值|
|
||||
|-- message |string|commit说明信息|
|
||||
|-- sha |string|commit’s sha值|
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"commits_count": 1,
|
||||
"commits": [
|
||||
{
|
||||
"author": {
|
||||
"id": 36480,
|
||||
"login": "jasder",
|
||||
"name": "段甲生",
|
||||
"image_url": "avatars/User/b"
|
||||
},
|
||||
"committer": {
|
||||
"id": 36480,
|
||||
"login": "jasder",
|
||||
"name": "段甲生",
|
||||
"image_url": "avatars/User/b"
|
||||
},
|
||||
"timestamp": 1604382982,
|
||||
"time_from_now": "3小时前",
|
||||
"message": "add some file\n* Add the tag list page to the release page\n* Apply suggestions from code review\n* Add the tags list view\n* Add the delete tag way on ui\n* Not delete tag and clear message when delete a release\n",
|
||||
"sha": "8f5faee0d3b3be1b8063e84da0c79dd75327b968"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Compare two commits
|
||||
Compare two commits
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET \
|
||||
http://localhost:3000/api/Jason/test-txt/compare/master...develop
|
||||
|
||||
curl -X GET \
|
||||
http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:develop
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/Jason/test-txt/compare/master...Jason/test-txt:develop')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/compare/{base}...{head}.json`
|
||||
|
||||
### 请求参数:
|
||||
|参数名|必选|类型|说明|
|
||||
|-|-|-|-|
|
||||
|owner |是|string |用户登录名 |
|
||||
|repo |是|string |project's identifier |
|
||||
|base |是|string |pull request's id |
|
||||
|head |是|string |pull request's id |
|
||||
|
||||
|
||||
### 返回字段说明:
|
||||
参数 | 类型 | 字段说明
|
||||
--------- | ----------- | -----------
|
||||
|-|-|-|
|
||||
|commits_count |int|commits总数量|
|
||||
|commits |array||
|
||||
|-- author |object|项目作者|
|
||||
|---- login |string|用户login|
|
||||
|---- name |string|用户姓名|
|
||||
|---- image_url |string|用户头像|
|
||||
|-- committer |object|commit提交用户|
|
||||
|---- login |string|用户login|
|
||||
|---- name |string|用户姓名|
|
||||
|---- image_url |string|用户头像|
|
||||
|-- timestamp |int|commit的unix时间戳|
|
||||
|-- time_from_now|string|commit’s 提交时间距当前时间的时间值|
|
||||
|-- message |string|commit说明信息|
|
||||
|-- sha |string|commit’s sha值|
|
||||
|diff |object||
|
||||
|-- files_count |int|文件更改的总数量|
|
||||
|-- total_addition |int|添加代码总行数|
|
||||
|-- total_deletion |int|删除代码总行数|
|
||||
|-- files |Array||
|
||||
|-- sha |string|commit's sha |
|
||||
|-- name |string|当前文件名|
|
||||
|-- old_name |string| 修改之前的文件名称,与name相同的话,说明文件名未更改|
|
||||
|-- addition |int|文件添加的行数|
|
||||
|-- deletion |int|文件删除的行数|
|
||||
|-- type |int|文件类型, 1: 表示该文件只添加了内容,2: 表示该文件内容有修改, 3: 表示文件被删除或者改文件只删除了内容|
|
||||
|-- isCreated |boolean|当前文件是否为新增文件, true: 是, false: 否|
|
||||
|-- isDeleted |boolean|当前文件是否被删除, true: 是,false: 否|
|
||||
|-- isBin |boolean|当前文件是否为二进制文件,true: 是,false: 否|
|
||||
|-- isLFSFile |boolean|当前文件是否为LFS文件,true: 是,false: 否|
|
||||
|-- isRenamed |boolean|当前文件是否被重命名,true: 是,false: 否|
|
||||
|-- sections |array||
|
||||
|---- fileName |string|文件名称|
|
||||
|---- lines |array||
|
||||
|------ leftIdx |string|文件变动之前所在行数|
|
||||
|------ rightIdx |string|文件更改后所在行数|
|
||||
|------ type |string|文件变更类型,1: 内容未改动,2: 添加, 3: 删除, 4: diff统计信息|
|
||||
|------ content |string|文件变更的内容|
|
||||
|------ sectionInfo |object||
|
||||
|-------- path |string|文件相对仓库的路径|
|
||||
|-------- lastLeftIdx |int||
|
||||
|-------- lastRightIdx |int||
|
||||
|-------- leftHunkSize |int|文件变更之前的行数|
|
||||
|-------- rightHunkSize |int|文件变更之后的行数(及当前页面编辑器显示的总行数)|
|
||||
|-------- leftIdx |int|文件变更之前所在行数|
|
||||
|-------- rightIdx |int|文件变更之后所在行数|
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"commits_count": 1,
|
||||
"commits": [
|
||||
{
|
||||
"author": {
|
||||
"id": 36480,
|
||||
"login": "jasder",
|
||||
"name": "段甲生",
|
||||
"image_url": "avatars/User/b"
|
||||
},
|
||||
"committer": {
|
||||
"id": 36480,
|
||||
"login": "jasder",
|
||||
"name": "段甲生",
|
||||
"image_url": "avatars/User/b"
|
||||
},
|
||||
"timestamp": 1604382982,
|
||||
"time_from_now": "4小时前",
|
||||
"message": "add some file\n* Add the tag list page to the release page\n* Apply suggestions from code review\n* Add the tags list view\n* Add the delete tag way on ui\n* Not delete tag and clear message when delete a release\n",
|
||||
"sha": "8f5faee0d3b3be1b8063e84da0c79dd75327b968"
|
||||
}
|
||||
],
|
||||
"diff": {
|
||||
"files_count": 6,
|
||||
"total_addition": 447,
|
||||
"total_deletion": 0,
|
||||
"files": [
|
||||
{
|
||||
"name": "build.go",
|
||||
"old_name": "build.go",
|
||||
"index": 1,
|
||||
"addition": 33,
|
||||
"deletion": 0,
|
||||
"type": 1,
|
||||
"isCreated": true,
|
||||
"isDeleted": false,
|
||||
"isBin": false,
|
||||
"isLFSFile": false,
|
||||
"isRenamed": false,
|
||||
"isSubmodule": false,
|
||||
"sections": [
|
||||
{
|
||||
"fileName": "build.go",
|
||||
"name": "",
|
||||
"lines": [
|
||||
{
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 0,
|
||||
"type": 4,
|
||||
"content": "@@ -0,0 +1,33 @@",
|
||||
"sectionInfo": {
|
||||
"path": "build.go",
|
||||
"lastLeftIdx": 0,
|
||||
"lastRightIdx": 0,
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 1,
|
||||
"leftHunkSize": 0,
|
||||
"rightHunkSize": 33
|
||||
}
|
||||
},
|
||||
{
|
||||
"leftIdx": 0,
|
||||
"rightIdx": 1,
|
||||
"type": 2,
|
||||
"content": "+// Copyright 2020 The Gitea Authors. All rights reserved.",
|
||||
"sectionInfo": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## List pull requests
|
||||
获取合并请求列表
|
||||
|
||||
> 示例:
|
||||
|
||||
```shell
|
||||
curl -X GET http://localhost:3000/api/Jasder/gitlink/pulls.json
|
||||
```
|
||||
|
||||
```javascript
|
||||
await octokit.request('GET /api/Jasder/gitlink/pulls.json')
|
||||
```
|
||||
|
||||
### HTTP 请求
|
||||
`GET /api/:owner/:repo/pulls.json`
|
||||
|
||||
### 请求参数:
|
||||
参数 | 必选 | 默认 | 类型 | 字段说明
|
||||
--------- | ------- | ------- | -------- | ----------
|
||||
|owner |是| |string |用户登录名 |
|
||||
|repo |是| |string |项目标识identifier |
|
||||
|
||||
|
||||
|
||||
|
||||
> 返回的JSON示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"status": 0,
|
||||
"message": "响应成功",
|
||||
"open_count": 4,
|
||||
"close_count": 51,
|
||||
"merged_issues_size": 123,
|
||||
"search_count": 4,
|
||||
"limit": null,
|
||||
"user_admin_or_member": true,
|
||||
"user_admin_or_developer": true,
|
||||
"project_name": "Gitlink",
|
||||
"project_author_name": "Gitlink",
|
||||
"issues": [
|
||||
{
|
||||
"pull_request_id": 1189,
|
||||
"pull_request_status": 0,
|
||||
"pull_request_head": "develop",
|
||||
"pull_request_base": "master",
|
||||
"pull_request_staus": "open",
|
||||
"is_original": false,
|
||||
"fork_project_id": null,
|
||||
"fork_project_identifier": null,
|
||||
"fork_project_user": null,
|
||||
"id": 51888,
|
||||
"name": "FIx release v3.2.0",
|
||||
"pr_time": "59分钟前",
|
||||
"assign_user_name": "victor",
|
||||
"assign_user_login": "moshenglv",
|
||||
"author_name": "段甲生",
|
||||
"author_login": "jasder",
|
||||
"avatar_url": "images/avatars/User/36480?t=1615520120",
|
||||
"priority": "正常",
|
||||
"version": null,
|
||||
"journals_count": 0,
|
||||
"issue_tags": null
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
|
@ -533,6 +533,23 @@
|
|||
</li>
|
||||
<li>
|
||||
<a href="#pulls" class="toc-h1 toc-link" data-title="Pulls">Pulls</a>
|
||||
<ul class="toc-list-h2">
|
||||
<li>
|
||||
<a href="#get-a-pull-request" class="toc-h2 toc-link" data-title="Get a pull request">Get a pull request</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#pull-request" class="toc-h2 toc-link" data-title="获取pull request文件列表">获取pull request文件列表</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#pull-request-commits" class="toc-h2 toc-link" data-title="获取pull request的commits列表">获取pull request的commits列表</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#compare-two-commits" class="toc-h2 toc-link" data-title="Compare two commits">Compare two commits</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#list-pull-requests" class="toc-h2 toc-link" data-title="List pull requests">List pull requests</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#issues" class="toc-h1 toc-link" data-title="Issues">Issues</a>
|
||||
|
@ -8909,7 +8926,949 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/test.json
|
|||
<aside class="success">
|
||||
Success Data.
|
||||
</aside>
|
||||
<h1 id='pulls'>Pulls</h1><h1 id='issues'>Issues</h1><h1 id='organizations'>Organizations</h1><h1 id='teams'>Teams</h1><h1 id='errors'>Errors</h1>
|
||||
<h1 id='pulls'>Pulls</h1><h2 id='get-a-pull-request'>Get a pull request</h2>
|
||||
<p>获取合并请求详情接口</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/Jasder/gitlink/pulls/88.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/Jasder/gitlink/pulls/88.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http'>HTTP 请求</h3>
|
||||
<p><code>GET /api/:owner/:repo/pulls/:id.json</code></p>
|
||||
<h3 id='2eb6f47757'>请求参数:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>必选</th>
|
||||
<th>默认</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>用户登录名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>integer</td>
|
||||
<td>pull id值</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"响应成功"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"project_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Gitlink"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"forgeplus"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"project_identifier"</span><span class="p">:</span><span class="w"> </span><span class="s2">"forgeplus"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pr_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"52分钟前"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"commits_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">229</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"files_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">328</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"comments_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"comments_total_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1189</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"base"</span><span class="p">:</span><span class="w"> </span><span class="s2">"master"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"head"</span><span class="p">:</span><span class="w"> </span><span class="s2">"develop"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"fork_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_original"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request_staus"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"fork_project_user"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"create_user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"mergeable"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"issue"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">51888</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"subject"</span><span class="p">:</span><span class="w"> </span><span class="s2">"FIx release v3.2.0"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"description"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_private"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"branch_name"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"project_author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Gitlink"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"closed_on"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"created_at"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2021-10-12 15:51"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"assign_user_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"victor"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"assign_user_login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"moshenglv"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"author_login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"author_picture"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/36480?t=1615520120"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"issue_status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"新增"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"priority"</span><span class="p">:</span><span class="w"> </span><span class="s2">"正常"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"version"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"issue_tags"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"conflict_files"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='pull-request'>获取pull request文件列表</h2>
|
||||
<p>获取pull request文件列表</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/Jason/gitlink/pulls/1/files.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/jasder/gitlink/pulls/1/files.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-2'>HTTP 请求</h3>
|
||||
<p><code>GET /api/:owner/:repo/pulls/:id/files.json</code></p>
|
||||
<h3 id='2eb6f47757-2'>请求参数:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数名</th>
|
||||
<th>必选</th>
|
||||
<th>类型</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>用户登录名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>project's identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>是</td>
|
||||
<td>int</td>
|
||||
<td>pull request's id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>files_count</td>
|
||||
<td>int</td>
|
||||
<td>文件更改的总数量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>total_addition</td>
|
||||
<td>int</td>
|
||||
<td>添加代码总行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>total_deletion</td>
|
||||
<td>int</td>
|
||||
<td>删除代码总行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>files</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sha</td>
|
||||
<td>string</td>
|
||||
<td>commit's sha value</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- name</td>
|
||||
<td>string</td>
|
||||
<td>当前文件名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- old_name</td>
|
||||
<td>string</td>
|
||||
<td>修改之前的文件名称,与name相同的话,说明文件名未更改</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- addition</td>
|
||||
<td>int</td>
|
||||
<td>文件添加的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- deletion</td>
|
||||
<td>int</td>
|
||||
<td>文件删除的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- type</td>
|
||||
<td>int</td>
|
||||
<td>文件类型, 1: 表示该文件只添加了内容,2: 表示该文件内容有修改, 3: 表示文件被删除或者改文件只删除了内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isCreated</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为新增文件, true: 是, false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isDeleted</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否被删除, true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isBin</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为二进制文件,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isLFSFile</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为LFS文件,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isRenamed</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否被重命名,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sections</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- fileName</td>
|
||||
<td>string</td>
|
||||
<td>文件名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- lines</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ leftIdx</td>
|
||||
<td>string</td>
|
||||
<td>文件变动之前所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ rightIdx</td>
|
||||
<td>string</td>
|
||||
<td>文件更改后所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ type</td>
|
||||
<td>string</td>
|
||||
<td>文件变更类型,1: 新增,2: 修改, 3: 删除, 4: diff统计信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ content</td>
|
||||
<td>string</td>
|
||||
<td>文件变更的内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ sectionInfo</td>
|
||||
<td>object</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- path</td>
|
||||
<td>string</td>
|
||||
<td>文件相对仓库的路径</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- lastLeftIdx</td>
|
||||
<td>int</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- lastRightIdx</td>
|
||||
<td>int</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- leftHunkSize</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之前的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- rightHunkSize</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之后的行数(及当前页面编辑器显示的总行数)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- leftIdx</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之前所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- rightIdx</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之后所在行数(即:页面编辑器开始显示的行数)</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"files_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"total_addition"</span><span class="p">:</span><span class="w"> </span><span class="mi">447</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"total_deletion"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"files"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"sha"</span><span class="p">:</span><span class="w"> </span><span class="s2">"xefenisnii"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"文件.txt"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"old_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"文件.txt"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"index"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"addition"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"deletion"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isCreated"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isDeleted"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isBin"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isLFSFile"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isRenamed"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isSubmodule"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sections"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"fileName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"文件.txt"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lines"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"content"</span><span class="p">:</span><span class="w"> </span><span class="s2">"@@ -0,0 +1,2 @@"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sectionInfo"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"path"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lastLeftIdx"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lastRightIdx"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"leftHunkSize"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightHunkSize"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"content"</span><span class="p">:</span><span class="w"> </span><span class="s2">"+用例图一致性更新"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sectionInfo"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"content"</span><span class="p">:</span><span class="w"> </span><span class="s2">"+工程文件直接上传会有文件缺失,现在压缩后上传"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sectionInfo"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='pull-request-commits'>获取pull request的commits列表</h2>
|
||||
<p>获取pull request的commits列表</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/jasder/jasder_test/pulls/1/commits.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/jasder/jasder_test/pulls/1/commits.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-3'>HTTP 请求</h3>
|
||||
<p><code>GET /api/:owner/:repo/pulls/:id/commits.json</code></p>
|
||||
<h3 id='2eb6f47757-3'>请求参数:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数名</th>
|
||||
<th>必选</th>
|
||||
<th>类型</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>用户登录名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>project's identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>id</td>
|
||||
<td>是</td>
|
||||
<td>int</td>
|
||||
<td>pull request's id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e-2'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>commits_count</td>
|
||||
<td>int</td>
|
||||
<td>commits总数量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>commits</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- author</td>
|
||||
<td>object</td>
|
||||
<td>项目作者</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- login</td>
|
||||
<td>string</td>
|
||||
<td>用户login</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- name</td>
|
||||
<td>string</td>
|
||||
<td>用户姓名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- image_url</td>
|
||||
<td>string</td>
|
||||
<td>用户头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- committer</td>
|
||||
<td>object</td>
|
||||
<td>commit提交用户</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- login</td>
|
||||
<td>string</td>
|
||||
<td>用户login</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- name</td>
|
||||
<td>string</td>
|
||||
<td>用户姓名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- image_url</td>
|
||||
<td>string</td>
|
||||
<td>用户头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- timestamp</td>
|
||||
<td>int</td>
|
||||
<td>commit的unix时间戳</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- time_from_now</td>
|
||||
<td>string</td>
|
||||
<td>commit’s 提交时间距当前时间的时间值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- message</td>
|
||||
<td>string</td>
|
||||
<td>commit说明信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sha</td>
|
||||
<td>string</td>
|
||||
<td>commit’s sha值</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"commits_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"commits"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">36480</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"avatars/User/b"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"committer"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">36480</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"avatars/User/b"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="mi">1604382982</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_from_now"</span><span class="p">:</span><span class="w"> </span><span class="s2">"3小时前"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"add some file</span><span class="se">\n</span><span class="s2">* Add the tag list page to the release page</span><span class="se">\n</span><span class="s2">* Apply suggestions from code review</span><span class="se">\n</span><span class="s2">* Add the tags list view</span><span class="se">\n</span><span class="s2">* Add the delete tag way on ui</span><span class="se">\n</span><span class="s2">* Not delete tag and clear message when delete a release</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sha"</span><span class="p">:</span><span class="w"> </span><span class="s2">"8f5faee0d3b3be1b8063e84da0c79dd75327b968"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='compare-two-commits'>Compare two commits</h2>
|
||||
<p>Compare two commits</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/Jason/test-txt/compare/master...develop
|
||||
|
||||
curl <span class="nt">-X</span> GET <span class="se">\</span>
|
||||
http://localhost:3000/api/Jason/test-txt/compare/master...Jason/test-txt:develop
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/Jason/test-txt/compare/master...Jason/test-txt:develop</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-4'>HTTP 请求</h3>
|
||||
<p><code>GET /api/:owner/:repo/compare/{base}...{head}.json</code></p>
|
||||
<h3 id='2eb6f47757-4'>请求参数:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数名</th>
|
||||
<th>必选</th>
|
||||
<th>类型</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>用户登录名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>project's identifier</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>base</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>pull request's id</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>head</td>
|
||||
<td>是</td>
|
||||
<td>string</td>
|
||||
<td>pull request's id</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
<h3 id='7447e4874e-3'>返回字段说明:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>commits_count</td>
|
||||
<td>int</td>
|
||||
<td>commits总数量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>commits</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- author</td>
|
||||
<td>object</td>
|
||||
<td>项目作者</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- login</td>
|
||||
<td>string</td>
|
||||
<td>用户login</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- name</td>
|
||||
<td>string</td>
|
||||
<td>用户姓名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- image_url</td>
|
||||
<td>string</td>
|
||||
<td>用户头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- committer</td>
|
||||
<td>object</td>
|
||||
<td>commit提交用户</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- login</td>
|
||||
<td>string</td>
|
||||
<td>用户login</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- name</td>
|
||||
<td>string</td>
|
||||
<td>用户姓名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- image_url</td>
|
||||
<td>string</td>
|
||||
<td>用户头像</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- timestamp</td>
|
||||
<td>int</td>
|
||||
<td>commit的unix时间戳</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- time_from_now</td>
|
||||
<td>string</td>
|
||||
<td>commit’s 提交时间距当前时间的时间值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- message</td>
|
||||
<td>string</td>
|
||||
<td>commit说明信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sha</td>
|
||||
<td>string</td>
|
||||
<td>commit’s sha值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>diff</td>
|
||||
<td>object</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- files_count</td>
|
||||
<td>int</td>
|
||||
<td>文件更改的总数量</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- total_addition</td>
|
||||
<td>int</td>
|
||||
<td>添加代码总行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- total_deletion</td>
|
||||
<td>int</td>
|
||||
<td>删除代码总行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- files</td>
|
||||
<td>Array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sha</td>
|
||||
<td>string</td>
|
||||
<td>commit's sha</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- name</td>
|
||||
<td>string</td>
|
||||
<td>当前文件名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- old_name</td>
|
||||
<td>string</td>
|
||||
<td>修改之前的文件名称,与name相同的话,说明文件名未更改</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- addition</td>
|
||||
<td>int</td>
|
||||
<td>文件添加的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- deletion</td>
|
||||
<td>int</td>
|
||||
<td>文件删除的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- type</td>
|
||||
<td>int</td>
|
||||
<td>文件类型, 1: 表示该文件只添加了内容,2: 表示该文件内容有修改, 3: 表示文件被删除或者改文件只删除了内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isCreated</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为新增文件, true: 是, false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isDeleted</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否被删除, true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isBin</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为二进制文件,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isLFSFile</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否为LFS文件,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- isRenamed</td>
|
||||
<td>boolean</td>
|
||||
<td>当前文件是否被重命名,true: 是,false: 否</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-- sections</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- fileName</td>
|
||||
<td>string</td>
|
||||
<td>文件名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>---- lines</td>
|
||||
<td>array</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ leftIdx</td>
|
||||
<td>string</td>
|
||||
<td>文件变动之前所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ rightIdx</td>
|
||||
<td>string</td>
|
||||
<td>文件更改后所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ type</td>
|
||||
<td>string</td>
|
||||
<td>文件变更类型,1: 内容未改动,2: 添加, 3: 删除, 4: diff统计信息</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ content</td>
|
||||
<td>string</td>
|
||||
<td>文件变更的内容</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>------ sectionInfo</td>
|
||||
<td>object</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- path</td>
|
||||
<td>string</td>
|
||||
<td>文件相对仓库的路径</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- lastLeftIdx</td>
|
||||
<td>int</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- lastRightIdx</td>
|
||||
<td>int</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- leftHunkSize</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之前的行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- rightHunkSize</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之后的行数(及当前页面编辑器显示的总行数)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- leftIdx</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之前所在行数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-------- rightIdx</td>
|
||||
<td>int</td>
|
||||
<td>文件变更之后所在行数</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"commits_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"commits"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"author"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">36480</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"avatars/User/b"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"committer"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">36480</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"image_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"avatars/User/b"</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="nl">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="mi">1604382982</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"time_from_now"</span><span class="p">:</span><span class="w"> </span><span class="s2">"4小时前"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"add some file</span><span class="se">\n</span><span class="s2">* Add the tag list page to the release page</span><span class="se">\n</span><span class="s2">* Apply suggestions from code review</span><span class="se">\n</span><span class="s2">* Add the tags list view</span><span class="se">\n</span><span class="s2">* Add the delete tag way on ui</span><span class="se">\n</span><span class="s2">* Not delete tag and clear message when delete a release</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sha"</span><span class="p">:</span><span class="w"> </span><span class="s2">"8f5faee0d3b3be1b8063e84da0c79dd75327b968"</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">],</span><span class="w">
|
||||
</span><span class="nl">"diff"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"files_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"total_addition"</span><span class="p">:</span><span class="w"> </span><span class="mi">447</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"total_deletion"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"files"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"build.go"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"old_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"build.go"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"index"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"addition"</span><span class="p">:</span><span class="w"> </span><span class="mi">33</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"deletion"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isCreated"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isDeleted"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isBin"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isLFSFile"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isRenamed"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"isSubmodule"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sections"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"fileName"</span><span class="p">:</span><span class="w"> </span><span class="s2">"build.go"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lines"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"content"</span><span class="p">:</span><span class="w"> </span><span class="s2">"@@ -0,0 +1,33 @@"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sectionInfo"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"path"</span><span class="p">:</span><span class="w"> </span><span class="s2">"build.go"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lastLeftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"lastRightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"leftHunkSize"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightHunkSize"</span><span class="p">:</span><span class="w"> </span><span class="mi">33</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">},</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"leftIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"rightIdx"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"content"</span><span class="p">:</span><span class="w"> </span><span class="s2">"+// Copyright 2020 The Gitea Authors. All rights reserved."</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"sectionInfo"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h2 id='list-pull-requests'>List pull requests</h2>
|
||||
<p>获取合并请求列表</p>
|
||||
|
||||
<blockquote>
|
||||
<p>示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> GET http://localhost:3000/api/Jasder/gitlink/pulls.json
|
||||
</code></pre></div><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="k">await</span> <span class="nx">octokit</span><span class="p">.</span><span class="nx">request</span><span class="p">(</span><span class="dl">'</span><span class="s1">GET /api/Jasder/gitlink/pulls.json</span><span class="dl">'</span><span class="p">)</span>
|
||||
</code></pre></div><h3 id='http-5'>HTTP 请求</h3>
|
||||
<p><code>GET /api/:owner/:repo/pulls.json</code></p>
|
||||
<h3 id='2eb6f47757-5'>请求参数:</h3>
|
||||
<table><thead>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>必选</th>
|
||||
<th>默认</th>
|
||||
<th>类型</th>
|
||||
<th>字段说明</th>
|
||||
</tr>
|
||||
</thead><tbody>
|
||||
<tr>
|
||||
<td>owner</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>用户登录名</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>repo</td>
|
||||
<td>是</td>
|
||||
<td></td>
|
||||
<td>string</td>
|
||||
<td>项目标识identifier</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<blockquote>
|
||||
<p>返回的JSON示例:</p>
|
||||
</blockquote>
|
||||
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"status"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"响应成功"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"open_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"close_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">51</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"merged_issues_size"</span><span class="p">:</span><span class="w"> </span><span class="mi">123</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"search_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"limit"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"user_admin_or_member"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"user_admin_or_developer"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"project_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Gitlink"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"project_author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Gitlink"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"issues"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
|
||||
</span><span class="p">{</span><span class="w">
|
||||
</span><span class="nl">"pull_request_id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1189</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request_status"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request_head"</span><span class="p">:</span><span class="w"> </span><span class="s2">"develop"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request_base"</span><span class="p">:</span><span class="w"> </span><span class="s2">"master"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pull_request_staus"</span><span class="p">:</span><span class="w"> </span><span class="s2">"open"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"is_original"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"fork_project_id"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"fork_project_identifier"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"fork_project_user"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">51888</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"FIx release v3.2.0"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"pr_time"</span><span class="p">:</span><span class="w"> </span><span class="s2">"59分钟前"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"assign_user_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"victor"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"assign_user_login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"moshenglv"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"author_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"段甲生"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"author_login"</span><span class="p">:</span><span class="w"> </span><span class="s2">"jasder"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"avatar_url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"images/avatars/User/36480?t=1615520120"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"priority"</span><span class="p">:</span><span class="w"> </span><span class="s2">"正常"</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"version"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"journals_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w">
|
||||
</span><span class="nl">"issue_tags"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span><span class="p">]</span><span class="w">
|
||||
</span><span class="p">}</span><span class="w">
|
||||
</span></code></pre></div><h1 id='issues'>Issues</h1><h1 id='organizations'>Organizations</h1><h1 id='teams'>Teams</h1><h1 id='errors'>Errors</h1>
|
||||
<aside class="notice">
|
||||
This error section is stored in a separate file in <code>includes/_errors.md</code>. Slate allows you to optionally separate out your docs into many files...just save them to the <code>includes</code> folder and add them to the top of your <code>index.md</code>'s frontmatter. Files are included in the order listed.
|
||||
</aside>
|
||||
|
|
Loading…
Reference in New Issue