class PPC::API::Qihu::Bulk

Constants

Service

Public Class Methods

download( auth, ids = nil) click to toggle source
# File lib/ppc/api/qihu/bulk.rb, line 21
def self.download( auth, ids = nil)
  result = get_all_object(auth, ids)
  field_id = result[:result]
  loop do 
    status = get_file_state(auth, field_id)
    return status if status[:result]['isGenerated'] == 'success'
    sleep 15
  end
end
get_all_object( auth, ids ) click to toggle source
# File lib/ppc/api/qihu/bulk.rb, line 8
def self.get_all_object( auth, ids )
  #文档上面写的输入类型是String?
  body = { 'idList' =>  ids.map(&:to_s) }
  response = request( auth, Service, 'getAllObjects', body )
  process( response, 'fileId' ){ |x| x }
end
get_file_state( auth, id ) click to toggle source
# File lib/ppc/api/qihu/bulk.rb, line 15
def self.get_file_state( auth, id )
  body = { 'fileId' => id }
  response = request( auth, Service, 'getFileState' , body )
  process( response, '' ){ |x| x }
end