class Api::V1::Projects::OssHealthMeasuringController < Api::V1::BaseController
  
  def index 

    url = URI("#{EduSetting.get("ohm_server_url")}/api/OSS_Health_Measuring/#{params[:owner]}/#{params[:repo]}")

    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 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
    url = URI("#{EduSetting.get("ohm_server_url")}/api/OHM_can_get/#{params[:owner]}/#{params[:repo]}")

    http = Net::HTTP.new(url.host, url.port);
    request = Net::HTTP::Get.new(url)
    response = http.request(request)
    render :json=> response.read_body
  end

end