mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
add sonarqube for projects
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Api::V1::ProjectsController < Api::V1::BaseController
|
||||
before_action :require_public_and_member_above, only: [:show, :compare, :blame]
|
||||
before_action :require_public_and_member_above, only: [:show, :compare, :blame, :sonar_search]
|
||||
|
||||
def index
|
||||
render_ok
|
||||
@@ -9,6 +9,11 @@ class Api::V1::ProjectsController < Api::V1::BaseController
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user