mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
sonar 转发接口
This commit is contained in:
@@ -9,10 +9,6 @@ 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)
|
||||
|
||||
40
app/controllers/api/v1/sonarqubes_controller.rb
Normal file
40
app/controllers/api/v1/sonarqubes_controller.rb
Normal file
@@ -0,0 +1,40 @@
|
||||
class Api::V1::SonarqubesController < Api::V1::BaseController
|
||||
def issues_search
|
||||
params_data = {
|
||||
components: 'kingchanx-fluid-cloudnative_fluid',
|
||||
s: 'FILE_LINE',
|
||||
impactSoftwareQualities: 'SECURITY',
|
||||
issueStatuses: 'CONFIRMED%2COPEN',
|
||||
ps: 100,
|
||||
facets: 'cleanCodeAttributeCategories%2CimpactSoftwareQualities%2CcodeVariants&',
|
||||
additionalFields: '_all',
|
||||
timeZone: 'Asia%2FShanghai'
|
||||
}
|
||||
data = Sonarqube.client.get('/api/issues/search', params_data)
|
||||
render_ok data
|
||||
end
|
||||
|
||||
def ce_component
|
||||
params_data = {
|
||||
components: 'kingchanx-fluid-cloudnative_fluid',
|
||||
}
|
||||
data = Sonarqube.client.get('/api/ce/component', params_data)
|
||||
render_ok data
|
||||
end
|
||||
|
||||
def sources_issue_snippet
|
||||
params_data = {
|
||||
issueKey: '93f87856-d71e-44f6-93b6-f9a6d54ff488'
|
||||
}
|
||||
data = Sonarqube.client.get('/api/sources/issue_snippets', params_data)
|
||||
render_ok data
|
||||
end
|
||||
|
||||
def rules_show
|
||||
params_data = {
|
||||
key: 'kubernetes%3AS6865'
|
||||
}
|
||||
data = Sonarqube.client.get('/api/rules/show', params_data)
|
||||
render_ok data
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user