ADD some api

* api/v1/repos/{owner}/{repo}/pulls/{number}/commits
* api/v1/repos/{owner}/{repo}/pulls/{number}/files
* api/v1/repos/{owner}/{repo}/compare/{base}...{head}
This commit is contained in:
Jasder
2020-11-03 18:37:47 +08:00
parent 70f7b59349
commit 2347697e93
15 changed files with 559 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
class CompareController < ApplicationController
# skip_before_action :require_login
before_action :load_repository
def index
end
def show
base_ref = Addressable::URI.unescape(params[:base])
@ref = head_ref = Addressable::URI.unescape(params[:head])
@compare_result = Gitea::Repository::Commits::CompareService.call(@owner.login, @project.identifier, base_ref, head_ref)
# render json: @compare_result
end
end