新增:开源健康度量开发群
This commit is contained in:
		
							parent
							
								
									4f1a984a7f
								
							
						
					
					
						commit
						2140a163ea
					
				| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					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 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
 | 
				
			||||||
| 
						 | 
					@ -131,6 +131,11 @@ defaults format: :json do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          # projects文件夹下的
 | 
					          # projects文件夹下的
 | 
				
			||||||
          scope module: :projects do 
 | 
					          scope module: :projects do 
 | 
				
			||||||
 | 
					            resources :oss_health_measuring, only: [:index] do 
 | 
				
			||||||
 | 
					              collection do 
 | 
				
			||||||
 | 
					                get :can_get
 | 
				
			||||||
 | 
					              end
 | 
				
			||||||
 | 
					            end
 | 
				
			||||||
            resources :portrait, only: [:index]
 | 
					            resources :portrait, only: [:index]
 | 
				
			||||||
            resources :sync_repositories, only: [:create, :index] do 
 | 
					            resources :sync_repositories, only: [:create, :index] do 
 | 
				
			||||||
              collection do 
 | 
					              collection do 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue