wechat-shake_around 0.7 → 0.8

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: 79a32f5b6f4d1adc529f4651bd0c953481b5cf0a
4
- data.tar.gz: 2f5e1a90930f4353c80c9425be650e42fcf37ee3
3
+ metadata.gz: 9dc3f613987fad317ff5364ab73cf17a30d38d81
4
+ data.tar.gz: 6dcb7d96aded2a179907d9321d389239b3b03231
5
5
  SHA512:
6
- metadata.gz: 0e00aaf7b06daf4637ecf47bd063932a161599cea3d4ffd6459cf2bbc9096dde7031c06c546d017850530432f67ab6063fde92c574d0e136e46e8d0acb5a43b8
7
- data.tar.gz: cc01e072e0c551618357d5d10efd327d23ea771d46c9a464ddd6179393bc7d581a3dc14e5de87ac3025eb640636351dd43cf94fb9b3ef0c35510e53bfa916bd1
6
+ metadata.gz: 6f577e33cd8c61dd5b65fa6ebe81d1c2b6b59895fda18e8f900cb7561c760ec1795b96bf0180a435cc824190f60285321eacdbcd5064cf89dc0804609c85eaa8
7
+ data.tar.gz: cfde83ebc7910a1cb5acfefa2c302d225dcf26c3ac7812718f3d35fb93faa74ad3b9e41f0f95aad9a207b4211318248a069a26cd98ce9173b65389c60fdae8c6
data/CHANGELOG.md CHANGED
@@ -28,3 +28,6 @@
28
28
 
29
29
  ## v0.7
30
30
  1. Apply wrapper class
31
+
32
+ ## v0.8
33
+ 2. Beacon PoI Relation wrapper class
@@ -20,6 +20,10 @@ require 'wechat/shake_around/device_group_relation'
20
20
  require 'wechat/shake_around/device_report'
21
21
  require 'wechat/shake_around/device_daily_report'
22
22
 
23
+ require 'wechat/shake_around/apply'
24
+
25
+ require 'wechat/shake_around/beacon_poi_relation'
26
+
23
27
  module Wechat
24
28
  module ShakeAround
25
29
  end
@@ -0,0 +1,28 @@
1
+ require 'jsonclient'
2
+
3
+ class Wechat::ShakeAround::BeaconPoiRelation
4
+
5
+ extend ::Wechat::ShakeAround::Common
6
+
7
+ # 配置设备与门店的关联关系
8
+ # http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html#.E9.85.8D.E7.BD.AE.E8.AE.BE.E5.A4.87.E4.B8.8E.E9.97.A8.E5.BA.97.E7.9A.84.E5.85.B3.E8.81.94.E5.85.B3.E7.B3.BB
9
+ #
10
+ # Return hash format if success:
11
+ # {
12
+ # data: {},
13
+ # errcode: 0,
14
+ # errmsg: 'success.'
15
+ # }
16
+ #
17
+ # device_id is an integer or a hash like { uuid: <UUID>, major: <MAJOR>, minor: <MINOR> }.
18
+ def self.create(access_token, device_id, poi_id)
19
+ device_identifier = self.normalize_device_id device_id
20
+ message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/device/bindlocation?access_token=#{access_token}",
21
+ {
22
+ device_identifier: device_identifier,
23
+ poi_id: poi_id.to_i
24
+ }
25
+ message.body
26
+ end
27
+
28
+ end
@@ -1,5 +1,5 @@
1
1
  module Wechat
2
2
  module ShakeAround
3
- VERSION = '0.7'.freeze
3
+ VERSION = '0.8'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat-shake_around
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '0.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-21 00:00:00.000000000 Z
11
+ date: 2016-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,6 +90,7 @@ files:
90
90
  - lib/wechat/shake_around/apply.rb
91
91
  - lib/wechat/shake_around/beacon.rb
92
92
  - lib/wechat/shake_around/beacon_page_relation.rb
93
+ - lib/wechat/shake_around/beacon_poi_relation.rb
93
94
  - lib/wechat/shake_around/common.rb
94
95
  - lib/wechat/shake_around/device_daily_report.rb
95
96
  - lib/wechat/shake_around/device_group_relation.rb