dada_express 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7f4fa9d1e47826c9ddd19d654bc15f928d00f1b
4
- data.tar.gz: 3257c150e6a2e324443af6cb57653a9918f1bfdc
3
+ metadata.gz: e6844a6210d09581d6b77a4ba169bbe678f8caf2
4
+ data.tar.gz: 7835990423a712b6153c091c9ea9b7c05b8b58fe
5
5
  SHA512:
6
- metadata.gz: abcb2e1ff4320f211bb8b6ce179507dd79f3e7dfb3fbc4460b5777c0e3bba6c2df4b11bc7f4501909290bbbe5f35d8a40dd03c1c028401790de00916db4cb21e
7
- data.tar.gz: fb941eae994cbb33a0daeda51454ea5568af6ca00a1aedc2f3fb958554f2d17b748c02c6c6e8032a8db696a021cf7f6d722686d4a4139a1c47ac15e0ae8c4e72
6
+ metadata.gz: 5ed0b3d99c7d1c74d9d4eb8efdd6321f454607304e1e411320a909acf81d1af5a0b1ecb8a6a449b1cefa39a3ac6981e596a3435f8a9eeb1bd8cb18e2bba68a45
7
+ data.tar.gz: c94cad53ae0810108f15a8aedfec0b974dd8f5d46b9c1886d9f0286ab4d06694a42b160c7c35b0e4f13a56dbdeed8209498e1884374dbdd4cca3f24c82ba1dc2
@@ -1,7 +1,7 @@
1
1
  module DadaExpress
2
2
  class ParamsService
3
3
  class << self
4
- def process(params = '')
4
+ def process(params)
5
5
  Sign.encode(base_params(params))
6
6
  end
7
7
 
@@ -1,18 +1,28 @@
1
1
  module DadaExpress
2
2
  ORDER_DETAIL_PATHNAME = '/api/order/status/query'
3
+ NEW_ORDER_PATHNAME = '/api/order/addOrder'
4
+ CITY_CODES_PATHNAME = '/api/cityCode/list'
3
5
 
4
6
  class Request
5
- def initialize(params)
7
+ def initialize(params = '')
6
8
  @params = params
7
9
  end
8
10
 
9
11
  def excute(url)
10
12
  @response ||= RestClient.post url, ParamsService.process(@params).to_json, {content_type: :json, accept: :json}
13
+ JSON.parse(@response.body)
11
14
  end
12
15
 
13
16
  def order_detail
14
17
  excute(DadaExpress.configuration.base_url + ORDER_DETAIL_PATHNAME)
15
- JSON.parse(@response.body)
18
+ end
19
+
20
+ def city_codes
21
+ excute(DadaExpress.configuration.base_url + CITY_CODES_PATHNAME)
22
+ end
23
+
24
+ def new_order
25
+ excute(DadaExpress.configuration.base_url + NEW_ORDER_PATHNAME)
16
26
  end
17
27
  end
18
28
  end
@@ -1,3 +1,3 @@
1
1
  module DadaExpress
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dada_express
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bran Liang