|
- class Api::V1::ProjectsController < Api::V1::BaseController
- before_action :require_public_and_member_above, only: [:show, :compare, :blame, :sonar_search]
-
- def index
- render_ok
- end
-
- def show
- @result_object = Api::V1::Projects::GetService.call(@project, current_user.gitea_token)
- end
-
- def sonar_search
- data = Sonarqube.client.get("/api/issues/search", { components:"#{@project.owner.login}-#{@project.identifier}" })
- render_ok data
- end
-
- 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)
- end
- end
|