com.foxinmy.weixin4j.mp.api
Class DataApi

java.lang.Object
  extended by com.foxinmy.weixin4j.api.BaseApi
      extended by com.foxinmy.weixin4j.mp.api.MpApi
          extended by com.foxinmy.weixin4j.mp.api.DataApi

public class DataApi
extends MpApi

数据分析API

1、接口侧的公众号数据的数据库中仅存储了2014年12月1日之后的数据,将查询不到在此之前的日期,即使有查到,也是不可信的脏数据;
2、请开发者在调用接口获取数据后,将数据保存在自身数据库中,即加快下次用户的访问速度,也降低了微信侧接口调用的不必要损耗。

Since:
JDK 1.6
Author:
jinyu(foxinmy@gmail.com)
See Also:

Constructor Summary
DataApi(TokenManager tokenManager)
           
 
Method Summary
 List<?> datacube(DatacubeType datacubeType, Date date)
          查询日期跨度为0的统计数据(当天)
 List<?> datacube(DatacubeType datacubeType, Date beginDate, Date endDate)
          数据统计
 List<?> datacube(DatacubeType datacubeType, Date beginDate, int offset)
          数据统计
 List<?> datacube(DatacubeType datacubeType, int offset, Date endDate)
          数据统计
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataApi

public DataApi(TokenManager tokenManager)
Method Detail

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date beginDate,
                        int offset)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 统计类型
beginDate - 开始日期
offset - 增量 表示向前几天 比如 offset=1 则查询 beginDate的后一天之间的数据
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}

datacube

public List<?> datacube(DatacubeType datacubeType,
                        int offset,
                        Date endDate)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 统计类型
offset - 增量 表示向后几天 比如 offset=1 则查询 beginDate的前一天之间的数据
endDate - 截至日期
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date date)
                 throws WeixinException
查询日期跨度为0的统计数据(当天)

Parameters:
datacubeType - 统计类型
date - 统计日期
Throws:
WeixinException
See Also:
#datacube(DatacubeType, Date,Date)}

datacube

public List<?> datacube(DatacubeType datacubeType,
                        Date beginDate,
                        Date endDate)
                 throws WeixinException
数据统计

Parameters:
datacubeType - 数据统计类型
beginDate - 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时, begin_date和end_date的差值只能为0,才能小于1),否则会报错
endDate - 获取数据的结束日期,end_date允许设置的最大值为昨日
Returns:
统计结果
Throws:
WeixinException
See Also:
UserSummary, ArticleSummary, ArticleTotal, ArticleDatacubeShare, UpstreamMsg, UpstreamMsgDist, InterfaceSummary, 用户分析, 图文分析, 消息分析, 接口分析


Copyright © 2014–2017. All rights reserved.