Class: Wechat::ShakeAround::DeviceReport
- Inherits:
-
Object
- Object
- Wechat::ShakeAround::DeviceReport
- Extended by:
- Core::Common, Common
- Defined in:
- lib/wechat/shake_around/device_report.rb
Overview
Device Report 是 iBeacon 设备统计报表的封装类。
Constant Summary
Constants included from Common
Class Method Summary collapse
Methods included from Common
normalize_date, normalize_device_id, normalize_page_ids
Class Method Details
.index(access_token, date, page_index = 1) ⇒ Object
Return hash format if success: {
data:
{
devices:
[
{
device_id: <DEVICE_ID>,
major: <MAJOR>,
minor: <MINOR>,
uuid: <UUID>,
shake_pv: <SHAKE_PAGE_VIEW>,
shake_uv: <SHAKE_USER_VIEW>,
click_pv: <CLICK_PAGE_VIEW>,
click_uv: <CLICK_USER_VIEW>
},
...
]
},
date: <DATE>, // 所查询的日期时间戳
total_count: <TOTAL_COUNT>, // 设备总数
page_index: <PAGE_INDEX>, // 所查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页
errcode: 0,
errmsg: 'success.'
}
date: 指定查询日期时间戳,单位为秒。 page_index: 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页,从1开始。
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/wechat/shake_around/device_report.rb', line 41 def self.index(access_token, date, page_index = 1) assert_present! :access_token, access_token assert_present! :date, date assert_present! :page_index, page_index post_json "https://api.weixin.qq.com/shakearound/statistics/devicelist?access_token=#{access_token}", body: { date: normalize_date(date), page_index: page_index.to_i } end |