add analyze_doxygen
This commit is contained in:
parent
a45953d350
commit
d80d151460
|
@ -168,6 +168,23 @@ class Api::V1::SonarqubesController < Api::V1::BaseController
|
|||
render_ok data
|
||||
end
|
||||
|
||||
def analyze_doxygen
|
||||
config = Rails.application.config_for(:configuration)
|
||||
sonarqube_config = config.dig('sonarqube')
|
||||
doxygen_url = sonarqube_config['doxygen']
|
||||
|
||||
url = "#{doxygen_url}/files/#{@project.owner.login}/#{@project.identifier}/html/analyze_doxygen.json"
|
||||
uri = URI.parse(url)
|
||||
response = Net::HTTP.get_response(uri)
|
||||
if response.code.to_i != 200
|
||||
puts "======= 接口请求失败!"
|
||||
data = { data: nil, msg: '文件不存在' }
|
||||
else
|
||||
data = { data: JSON.parse(response.body), msg: 'ok' }
|
||||
end
|
||||
render_ok data
|
||||
end
|
||||
|
||||
def measures_search_history
|
||||
params_data = {
|
||||
from: params[:form],
|
||||
|
|
|
@ -119,6 +119,7 @@ defaults format: :json do
|
|||
post :sonar_initialize
|
||||
post :insert_file
|
||||
get :doxygen_url
|
||||
get :analyze_doxygen
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue