新增: 获取单文件blame信息

This commit is contained in:
2022-07-19 11:14:50 +08:00
parent 274cd81655
commit 1882120df3
7 changed files with 759 additions and 236 deletions

View File

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