新增: 获取比较blame、token以及异常捕获处理

This commit is contained in:
2022-07-18 11:37:41 +08:00
parent e8deb83004
commit 6273349334
23 changed files with 912 additions and 419 deletions

View File

@@ -3,6 +3,5 @@ class Api::V1::Projects::CommitsController < Api::V1::BaseController
def diff
@result_object = Api::V1::Projects::Commits::DiffService.call(@project, params[:sha], current_user&.gitea_token)
puts @result_object
end
end

View File

@@ -1,5 +1,5 @@
class Api::V1::ProjectsController < Api::V1::BaseController
before_action :load_project, only: [:show]
before_action :require_public_and_member_above, only: [:show, :compare]
def index
render_ok
@@ -8,4 +8,8 @@ class Api::V1::ProjectsController < Api::V1::BaseController
def show
@result_object = Api::V1::Projects::GetService.call(@project, current_user.gitea_token)
end
def compare
@result_object = Api::V1::Projects::CompareService.call(@project, params[:from], params[:to], current_user&.gitea_token)
end
end