Merge branch 'develop' into standalone_develop

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

View File

@ -19,6 +19,13 @@ class Api::V1::BaseController < ApplicationController
# User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
# end
# end
def limit
params.fetch(:limit, 15)
end
def page
params.fetch(:page, 1)
end
# 具有对仓库的管理权限
def require_manager_above

View File

@ -0,0 +1,12 @@
class Api::V1::Projects::GitController < Api::V1::BaseController
before_action :require_public_and_member_above, only: [:trees, :blobs]
def trees
@result_object = Api::V1::Projects::Git::TreesService.call(@project, params[:sha], {recursive: params[:recursive], page: page, limit: limit}, current_user&.gitea_token)
end
def blobs
@result_object = Api::V1::Projects::Git::BlobsService.call(@project, params[:sha], current_user&.gitea_token)
end
end

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>
## 获取仓库贡献者
获取仓库贡献者

View File

@ -0,0 +1,30 @@
class Api::V1::Projects::Git::BlobsService < ApplicationService
include ActiveModel::Model
attr_accessor :project, :sha, :token, :owner, :repo
attr_accessor :gitea_data
validates :sha, presence: :true
def initialize(project, sha, token=nil)
@project = project
@owner = project&.owner.login
@repo = project&.identifier
@sha = sha
@token = token
end
def call
$gitea_client.token = token unless token.blank?
load_gitea_data
$gitea_client.token = nil unless token.blank?
gitea_data
end
private
def load_gitea_data
@gitea_data = $gitea_client.get_repos_git_blobs_by_owner_repo_sha(owner, repo, sha)
end
end

View File

@ -0,0 +1,50 @@
class Api::V1::Projects::Git::TreesService < ApplicationService
include ActiveModel::Model
attr_accessor :project, :token, :sha, :recursive, :page, :limit, :owner, :repo
attr_accessor :gitea_data
validates :sha, presence: :true
validates :recursive, inclusion: {in: [nil, '', true, false]}
def initialize(project, sha, params, token=nil)
@project = project
@owner = project&.owner.login
@repo = project&.identifier
@token = token
@sha = sha
@recursive = params[:recursive]
@page = params[:page] || 1
@limit = params[:limit] || 15
end
def call
raise Error, errors.full_messages.join(", ") unless valid?
$gitea_client.token = token unless token.blank?
load_gitea_data
$gitea_client.token = nil unless token.blank?
gitea_data
end
private
def request_query
if recursive.present?
{
recursive: recursive,
page: page,
per_page: limit
}
else
{
page: page,
per_page: limit
}
end
end
def load_gitea_data
@gitea_data = $gitea_client.get_repos_git_trees_by_owner_repo_sha(owner, repo, sha, {query: request_query})
raise Error, '获取文件树列表失败!' unless @gitea_data.is_a?(Hash)
end
end

View File

@ -0,0 +1,4 @@
json.sha @result_object['sha']
json.size @result_object['size']
json.encoding @result_object['encoding']
json.content @result_object['content']

View File

@ -0,0 +1,9 @@
json.total_count @result_object['total_count']
json.sha @result_object['sha']
json.entries @result_object['tree'].each do |entry|
json.name entry['path']
json.mode entry['mode']
json.type entry['type'] === 'blob' ? 'file' : 'dir'
json.size entry['size']
json.sha entry['sha']
end

View File

@ -28,6 +28,8 @@ defaults format: :json do
get :all
end
end
get '/git/blobs/:sha', to: 'git#blobs'
get '/git/trees/:sha', to: 'git#trees'
end
end

View File

@ -547,6 +547,12 @@
<li>
<a href="#readme" class="toc-h2 toc-link" data-title="获取仓库README文件">获取仓库README文件</a>
</li>
<li>
<a href="#5d5002b291" class="toc-h2 toc-link" data-title="获取文件树列表">获取文件树列表</a>
</li>
<li>
<a href="#blobs" class="toc-h2 toc-link" data-title="获取仓库blobs内容">获取仓库blobs内容</a>
</li>
<li>
<a href="#28d27a81d5" class="toc-h2 toc-link" data-title="获取仓库贡献者">获取仓库贡献者</a>
</li>
@ -7915,7 +7921,10 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
<blockquote>
<p>示例:</p>
</blockquote>
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST http://localhost:3000/api/v1/yystopf/csfjkkj/branches.json
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST <span class="se">\</span>
<span class="nt">-d</span> <span class="s2">"new_branch_name=ceshi_branch_1"</span> <span class="se">\</span>
<span class="nt">-d</span> <span class="s2">"old_branch_name=master"</span> <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/csfjkkj/branches.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">POST /api/v1/yystopf/csfjkkj/branches.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-6'>HTTP 请求</h3>
<p><code>POST /api/v1/:owner/:repo/branches.json</code></p>
@ -7945,17 +7954,17 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat
</tr>
<tr>
<td>new_branch_name</td>
<td>string</td>
<td></td>
<td></td>
<td>string</td>
<td>新分支名称</td>
<td></td>
<td></td>
</tr>
<tr>
<td>old_branch_name</td>
<td>否|</td>
<td></td>
<td></td>
<td>string</td>
<td>来源分支名称</td>
<td></td>
</tr>
</tbody></table>
<h3 id='7447e4874e-6'>返回字段说明:</h3>
@ -9456,6 +9465,223 @@ http://localhost:3000/api/yystopf/csfjkkj/readme.json
<aside class="success">
Success Data.
</aside>
<h2 id='5d5002b291'>获取文件树列表</h2>
<p>根据分支、标签、commit ID获取仓库文件树列表</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>
<span class="nt">-d</span> <span class="s2">"recursive=true"</span> <span class="se">\</span>
<span class="nt">-d</span> <span class="s2">"page=1"</span> <span class="se">\</span>
<span class="nt">-d</span> <span class="s2">"limit=1"</span> <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/csfjkkj/git/trees/80dd40214a58622312393b2ae693756a4781fab2.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/v1/yystopf/csfjkkj/git/trees/80dd40214a58622312393b2ae693756a4781fab2.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-20'>HTTP 请求</h3>
<p><code>GET /api/v1/:owner/:repo/git/trees/:sha.json</code></p>
<h3 id='2eb6f47757-20'>请求参数:</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>sha</td>
<td></td>
<td></td>
<td>string</td>
<td>分支名称、tag名称或是提交记录id</td>
</tr>
<tr>
<td>recursive</td>
<td></td>
<td></td>
<td>bool</td>
<td>是否显示目录</td>
</tr>
<tr>
<td>page</td>
<td></td>
<td>1</td>
<td>int</td>
<td>页码</td>
</tr>
<tr>
<td>limit</td>
<td></td>
<td>15</td>
<td>int</td>
<td>分页个数</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-20'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
<th>类型</th>
<th>字段说明</th>
</tr>
</thead><tbody>
<tr>
<td>total_count</td>
<td>int</td>
<td>文件树数量</td>
</tr>
<tr>
<td>sha</td>
<td>string</td>
<td>查询分支、标签、commit_id最后一次提交的ID</td>
</tr>
<tr>
<td>entries.name</td>
<td>string</td>
<td>文件树名称</td>
</tr>
<tr>
<td>entries.mode</td>
<td>string</td>
<td>文件树权限</td>
</tr>
<tr>
<td>entries.type</td>
<td>string</td>
<td>文件树类型, file文件dir: 文件夹</td>
</tr>
<tr>
<td>entries.size</td>
<td>int</td>
<td>文件树大小</td>
</tr>
<tr>
<td>entries.sha</td>
<td>string</td>
<td>文件树commit_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">"total_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">13</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">"80dd40214a58622312393b2ae693756a4781fab2"</span><span class="p">,</span><span class="w">
</span><span class="nl">"entries"</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">"README.md"</span><span class="p">,</span><span class="w">
</span><span class="nl">"mode"</span><span class="p">:</span><span class="w"> </span><span class="s2">"100644"</span><span class="p">,</span><span class="w">
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"file"</span><span class="p">,</span><span class="w">
</span><span class="nl">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">14</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">"b2f7b457fd8ca55f2274032cbb2abcb7dd8cd57e"</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>
<aside class="success">
Success Data.
</aside>
<h2 id='blobs'>获取仓库blobs内容</h2>
<p>根据commit ID获取仓库blobs内容</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/v1/yystopf/csfjkkj/git/blobs/80dd40214a58622312393b2ae693756a4781fab2.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/v1/yystopf/csfjkkj/git/blobs/80dd40214a58622312393b2ae693756a4781fab2.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-21'>HTTP 请求</h3>
<p><code>GET /api/v1/:owner/:repo/git/blobs/:sha.json</code></p>
<h3 id='2eb6f47757-21'>请求参数:</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>sha</td>
<td></td>
<td></td>
<td>string</td>
<td>提交记录id</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-21'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
<th>类型</th>
<th>字段说明</th>
</tr>
</thead><tbody>
<tr>
<td>sha</td>
<td>string</td>
<td>提交ID</td>
</tr>
<tr>
<td>size</td>
<td>int</td>
<td>blobs大小</td>
</tr>
<tr>
<td>encoding</td>
<td>string</td>
<td>内容编码模式</td>
</tr>
<tr>
<td>content</td>
<td>string</td>
<td>blobs内容</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">"sha"</span><span class="p">:</span><span class="w"> </span><span class="s2">"80dd40214a58622312393b2ae693756a4781fab2"</span><span class="p">,</span><span class="w">
</span><span class="nl">"size"</span><span class="p">:</span><span class="w"> </span><span class="mi">247</span><span class="p">,</span><span class="w">
</span><span class="nl">"encoding"</span><span class="p">:</span><span class="w"> </span><span class="s2">"base64"</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">"dHJlZSAyN2JjYjI2ZDQ5YmU1M2RmOGZmYTk5NDc3MjRkYmI3YzIzZWI4MjY4CnBhcmVudCA3ZTRkOGJiM2MyOGUyNGQ0Y2Q2YjIwNWYyZWVkMzI1MTNlOTM3NTI0CmF1dGhvciB5eXN0b3BmIDx5eXN0b3BmQDE2My5jb20+IDE2NTc3MDYwNTUgKzAwMDAKY29tbWl0dGVyIHl5c3RvcGYgPHl5c3RvcGZAMTYzLmNvbT4gMTY1NzcwNjA1NSArMDAwMAoKeOaLn+WingoKU2lnbmVkLW9mZi1ieTogeXlzdG9wZiA8eXlzdG9wZkAxNjMuY29tPg=="</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div>
<aside class="success">
Success Data.
</aside>
<h2 id='28d27a81d5'>获取仓库贡献者</h2>
<p>获取仓库贡献者</p>
@ -9467,9 +9693,9 @@ http://localhost:3000/api/yystopf/csfjkkj/readme.json
<span class="nt">-d</span> <span class="s2">"filepath=lib"</span> <span class="se">\</span>
http://localhost:3000/api/yystopf/csfjkkj/contributors.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/yystopf/csfjkkj/contributors.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-20'>HTTP 请求</h3>
</code></pre></div><h3 id='http-22'>HTTP 请求</h3>
<p><code>GET /api/:owner/:repo/contributors.json</code></p>
<h3 id='2eb6f47757-20'>请求参数:</h3>
<h3 id='2eb6f47757-22'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9508,7 +9734,7 @@ http://localhost:3000/api/yystopf/csfjkkj/contributors.json
<td>子目录名称,默认为空</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-20'>返回字段说明:</h3>
<h3 id='7447e4874e-22'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9583,9 +9809,9 @@ http://localhost:3000/api/yystopf/csfjkkj/contributors.json
<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/v1/yystopf/ceshi/webhooks.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/v1/yystopf/ceshi/webhooks.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-21'>HTTP 请求</h3>
</code></pre></div><h3 id='http-23'>HTTP 请求</h3>
<p><code>GET /api/v1/:owner/:repo/webhooks.json</code></p>
<h3 id='2eb6f47757-21'>请求参数:</h3>
<h3 id='2eb6f47757-23'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9610,7 +9836,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks.json
<td>项目标识identifier</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-21'>返回字段说明:</h3>
<h3 id='7447e4874e-23'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9703,9 +9929,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks.json
<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/v1/yystopf/ceshi/webhooks/3.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/v1/yystopf/ceshi/webhooks/3.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-22'>HTTP 请求</h3>
</code></pre></div><h3 id='http-24'>HTTP 请求</h3>
<p><code>GET /api/v1/:owner/:repo/webhooks/:id.json</code></p>
<h3 id='2eb6f47757-22'>请求参数:</h3>
<h3 id='2eb6f47757-24'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9737,7 +9963,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3.json
<td>webhook ID</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-22'>返回字段说明:</h3>
<h3 id='7447e4874e-24'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9860,9 +10086,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3.json
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/ceshi/webhooks.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">POST /api/v1/yystopf/ceshi/webhooks.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-23'>HTTP 请求</h3>
</code></pre></div><h3 id='http-25'>HTTP 请求</h3>
<p><code>POST /api/v1/:owner/:repo/webhooks.json</code></p>
<h3 id='2eb6f47757-23'>请求参数:</h3>
<h3 id='2eb6f47757-25'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -9987,7 +10213,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks.json
</span><span class="nl">"branch_filter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*"</span><span class="p">,</span><span class="w">
</span><span class="nl">"events"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"push"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div><h3 id='7447e4874e-23'>返回字段说明:</h3>
</span></code></pre></div><h3 id='7447e4874e-25'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10066,9 +10292,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks.json
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> PATCH <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.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">PATCH /api/v1/yystopf/ceshi/webhooks/7.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-24'>HTTP 请求</h3>
</code></pre></div><h3 id='http-26'>HTTP 请求</h3>
<p><code>PATCH /api/v1/:owner/:repo/webhooks/68.json</code></p>
<h3 id='2eb6f47757-24'>请求参数:</h3>
<h3 id='2eb6f47757-26'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10200,7 +10426,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.json
</span><span class="nl">"branch_filter"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*"</span><span class="p">,</span><span class="w">
</span><span class="nl">"events"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"push"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div><h3 id='7447e4874e-24'>返回字段说明:</h3>
</span></code></pre></div><h3 id='7447e4874e-26'>返回字段说明:</h3>
<blockquote>
<p>返回的JSON示例:</p>
</blockquote>
@ -10235,9 +10461,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.json
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> DELETE <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.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">DELETE /api/v1/yystopf/ceshi/webhooks/7.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-25'>HTTP 请求</h3>
</code></pre></div><h3 id='http-27'>HTTP 请求</h3>
<p><code>DELETE /api/v1/:owner/:repo/webhooks/:id.json</code></p>
<h3 id='2eb6f47757-25'>请求参数:</h3>
<h3 id='2eb6f47757-27'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10269,7 +10495,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.json
<td>webhook id</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-25'>返回字段说明:</h3>
<h3 id='7447e4874e-27'>返回字段说明:</h3>
<blockquote>
<p>返回的JSON示例:</p>
</blockquote>
@ -10290,9 +10516,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/7.json
<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/v1/yystopf/ceshi/webhooks/3/hooktasks.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/v1/yystopf/ceshi/webhooks/3/hooktasks.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-26'>HTTP 请求</h3>
</code></pre></div><h3 id='http-28'>HTTP 请求</h3>
<p><code>GET /api/v1/:owner/:repo/webhooks/:id/hooktasks.json</code></p>
<h3 id='2eb6f47757-26'>请求参数:</h3>
<h3 id='2eb6f47757-28'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10324,7 +10550,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3/hooktasks.json
<td>webhook ID</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-26'>返回字段说明:</h3>
<h3 id='7447e4874e-28'>返回字段说明:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10561,9 +10787,9 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3/hooktasks.json
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="nt">-X</span> POST <span class="se">\</span>
http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3/tests.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">POST /api/v1/yystopf/ceshi/webhooks/3/tests.json</span><span class="dl">'</span><span class="p">)</span>
</code></pre></div><h3 id='http-27'>HTTP 请求</h3>
</code></pre></div><h3 id='http-29'>HTTP 请求</h3>
<p><code>POST /api/v1/:owner/:repo/webhooks/:id/tests.json</code></p>
<h3 id='2eb6f47757-27'>请求参数:</h3>
<h3 id='2eb6f47757-29'>请求参数:</h3>
<table><thead>
<tr>
<th>参数</th>
@ -10595,7 +10821,7 @@ http://localhost:3000/api/v1/yystopf/ceshi/webhooks/3/tests.json
<td>webhook ID</td>
</tr>
</tbody></table>
<h3 id='7447e4874e-27'>返回字段说明:</h3>
<h3 id='7447e4874e-29'>返回字段说明:</h3>
<blockquote>
<p>返回的JSON示例:</p>
</blockquote>