Class: Aliexpress::Common

Inherits:
Base
  • Object
show all
Defined in:
lib/aliexpress/common.rb

Overview

平台通用的信息

Constant Summary

Constants inherited from Base

Base::ACCESS_TOKEN_KEY, Base::REFRESH_TOKEN_KEY

Class Method Summary collapse

Methods inherited from Base

api_endpoint

Class Method Details

.adjust_timeObject

获取系统当前时间 NOTE:针对请求使用总是过期,校准时间。结果,校准时间是毫秒


32
33
34
35
36
37
38
39
40
# File 'lib/aliexpress/common.rb', line 32

def self.adjust_time
  current_time_url = "#{api_url}/param2/1/system/currentTime/#{app_key}"

  response = Nestful.get(current_time_url)

  puts "response = #{response}"

  JSON.parse(response.body)
end

.queryAeAnouncement(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

10
11
12
# File 'lib/aliexpress/common.rb', line 10

def self.queryAeAnouncement(params = {})
  api_endpoint 'api.queryAeAnouncement', params
end

.queryOpenAnouncement(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

26
27
28
# File 'lib/aliexpress/common.rb', line 26

def self.queryOpenAnouncement(params = {})
  api_endpoint 'api.queryOpenAnouncement', params
end

.queryServiceAnouncement(params = {}) ⇒ Object

Parameters:

  • params (Hash) (defaults to: {})

18
19
20
# File 'lib/aliexpress/common.rb', line 18

def self.queryServiceAnouncement(params = {})
  api_endpoint 'api.queryServiceAnouncement', params
end