新增:开源健康度接口keyid

This commit is contained in:
yystopf 2024-11-04 17:16:28 +08:00
parent 2140a163ea
commit c5505dc4a2
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,15 @@ class Api::V1::Projects::OssHealthMeasuringController < Api::V1::BaseController
render :json=> response.read_body render :json=> response.read_body
end end
def keyid
url = URI("#{EduSetting.get("ohm_server_url")}/api/OSS_Health_Measuring/#{params[:owner]}/#{params[:repo]}/#{params[:key_id]}")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
response = http.request(request)
render :json=> response.read_body
end
def can_get def can_get
url = URI("#{EduSetting.get("ohm_server_url")}/api/OHM_can_get/#{params[:owner]}/#{params[:repo]}") url = URI("#{EduSetting.get("ohm_server_url")}/api/OHM_can_get/#{params[:owner]}/#{params[:repo]}")

View File

@ -134,6 +134,7 @@ defaults format: :json do
resources :oss_health_measuring, only: [:index] do resources :oss_health_measuring, only: [:index] do
collection do collection do
get :can_get get :can_get
get :keyid
end end
end end
resources :portrait, only: [:index] resources :portrait, only: [:index]