wechat-shake_around 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +3 -0
- data/lib/wechat/shake_around/apply.rb +53 -0
- data/lib/wechat/shake_around/version.rb +1 -1
- data/wechat-shake_around.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79a32f5b6f4d1adc529f4651bd0c953481b5cf0a
|
4
|
+
data.tar.gz: 2f5e1a90930f4353c80c9425be650e42fcf37ee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e00aaf7b06daf4637ecf47bd063932a161599cea3d4ffd6459cf2bbc9096dde7031c06c546d017850530432f67ab6063fde92c574d0e136e46e8d0acb5a43b8
|
7
|
+
data.tar.gz: cc01e072e0c551618357d5d10efd327d23ea771d46c9a464ddd6179393bc7d581a3dc14e5de87ac3025eb640636351dd43cf94fb9b3ef0c35510e53bfa916bd1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
+
[Get Beacon & PoI & Page & Shaker 获取摇周边的设备及用户信息](http://mp.weixin.qq.com/wiki/3/34904a5db3d0ec7bb5306335b8da1faf.html)
|
27
28
|
```ruby
|
28
29
|
response = ::Wechat::ShakeAround::Shaking.load access_token, params[:ticket]
|
29
30
|
if response.present? && 0==response['errcode']
|
@@ -36,6 +37,8 @@ if response.present? && 0==response['errcode']
|
|
36
37
|
beacon_major = beacon['major']
|
37
38
|
beacon_minor = beacon['minor']
|
38
39
|
end
|
40
|
+
|
41
|
+
|
39
42
|
```
|
40
43
|
|
41
44
|
## Development
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'jsonclient'
|
2
|
+
|
3
|
+
class Wechat::ShakeAround::Apply
|
4
|
+
|
5
|
+
extend ::Wechat::ShakeAround::Common
|
6
|
+
|
7
|
+
# 查询设备ID申请审核状态
|
8
|
+
# http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html#.E6.9F.A5.E8.AF.A2.E8.AE.BE.E5.A4.87ID.E7.94.B3.E8.AF.B7.E5.AE.A1.E6.A0.B8.E7.8A.B6.E6.80.81
|
9
|
+
#
|
10
|
+
# Return hash format if success:
|
11
|
+
# {
|
12
|
+
# data:
|
13
|
+
# {
|
14
|
+
# apply_time: <APPLY_TIME>, // 提交申请的时间戳
|
15
|
+
# audit_comment: <AUDIT_COMMENT>, // 审核备注,对审核状态的文字说明
|
16
|
+
# audit_status: <AUDIT_STATUS>, // 审核状态。0:审核未通过、1:审核中、2:审核已通过;若单次申请的设备ID数量小于等于500个,系统会进行快速审核;若单次申请的设备ID数量大于500个,会在三个工作日内完成审核。
|
17
|
+
# audit_time: <AUDIT_TIME>, // 确定审核结果的时间戳,若状态为审核中,则该时间值为0
|
18
|
+
# },
|
19
|
+
# errcode: 0,
|
20
|
+
# errmsg: 'success.'
|
21
|
+
# }
|
22
|
+
def self.load(access_token, apply_id)
|
23
|
+
message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/device/applystatus?access_token=#{access_token}", { apply_id: apply_id.to_i }
|
24
|
+
message.body
|
25
|
+
end
|
26
|
+
|
27
|
+
# 申请设备ID
|
28
|
+
# http://mp.weixin.qq.com/wiki/15/b9e012f917e3484b7ed02771156411f3.html#.E7.94.B3.E8.AF.B7.E8.AE.BE.E5.A4.87ID
|
29
|
+
#
|
30
|
+
# Return hash format if success:
|
31
|
+
# {
|
32
|
+
# data:
|
33
|
+
# {
|
34
|
+
# apply_id: <APPLY_ID>, // 申请的批次ID,可用在“查询设备列表”接口按批次查询本次申请成功的设备ID。
|
35
|
+
# audit_status: <AUDIT_STATUS>, // 审核状态。0:审核未通过、1:审核中、2:审核已通过;若单次申请的设备ID数量小于等于500个,系统会进行快速审核;若单次申请的设备ID数量大于500个,会在三个工作日内完成审核;此时返回值全部为1(审核中)
|
36
|
+
# audit_comment: <AUDIT_COMMENT> // 审核备注,对审核状态的文字说明
|
37
|
+
# },
|
38
|
+
# errcode: 0,
|
39
|
+
# errmsg: 'success.'
|
40
|
+
# }
|
41
|
+
#
|
42
|
+
# quantity: 申请的设备ID的数量,单次新增设备超过500个,需走人工审核流程。
|
43
|
+
# apply_reason: 申请理由,不超过100个汉字或200个英文字母。
|
44
|
+
# comment: 备注,不超过15个汉字或30个英文字母。
|
45
|
+
def self.create(access_token, quantity, apply_reason, comment = nil, poi_id = nil)
|
46
|
+
options = { quantity: quantity, apply_reason: apply_reason }
|
47
|
+
options[:comment] = comment if comment.present?
|
48
|
+
options[:poi_id] = poi_id if poi_id.present?
|
49
|
+
message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/device/applyid?access_token=#{access_token}", options
|
50
|
+
message.body
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
data/wechat-shake_around.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.email = [ 'topbit.du@gmail.com' ]
|
12
12
|
|
13
13
|
spec.summary = %q{Wechat Shake Around Library 微信摇周边库}
|
14
|
-
spec.description = %q{
|
14
|
+
spec.description = %q{Wechat Shake Around Library is a wrapper for calling the Shake Around APIs. 微信摇周边库封装了微信摇周边API的调用。}
|
15
15
|
spec.homepage = 'https://github.com/topbitdu/wechat-shake_around'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
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.
|
4
|
+
version: '0.7'
|
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-
|
11
|
+
date: 2016-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,8 +66,8 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.7'
|
69
|
-
description:
|
70
|
-
|
69
|
+
description: Wechat Shake Around Library is a wrapper for calling the Shake Around
|
70
|
+
APIs. 微信摇周边库封装了微信摇周边API的调用。
|
71
71
|
email:
|
72
72
|
- topbit.du@gmail.com
|
73
73
|
executables: []
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- bin/console
|
88
88
|
- bin/setup
|
89
89
|
- lib/wechat/shake_around.rb
|
90
|
+
- lib/wechat/shake_around/apply.rb
|
90
91
|
- lib/wechat/shake_around/beacon.rb
|
91
92
|
- lib/wechat/shake_around/beacon_page_relation.rb
|
92
93
|
- lib/wechat/shake_around/common.rb
|