11package me .chanjar .weixin .mp .api .impl ;
22
3- import java .text .Format ;
4- import java .util .Date ;
5- import java .util .List ;
6-
7- import org .apache .commons .lang3 .time .FastDateFormat ;
8- import org .slf4j .Logger ;
9- import org .slf4j .LoggerFactory ;
10-
113import com .google .gson .JsonObject ;
12-
134import me .chanjar .weixin .common .exception .WxErrorException ;
145import me .chanjar .weixin .mp .api .WxMpDataCubeService ;
156import me .chanjar .weixin .mp .api .WxMpService ;
16- import me .chanjar .weixin .mp .bean .datacube .WxDataCubeArticleResult ;
17- import me . chanjar . weixin . mp . bean . datacube . WxDataCubeArticleTotal ;
18- import me . chanjar . weixin . mp . bean . datacube . WxDataCubeInterfaceResult ;
19- import me . chanjar . weixin . mp . bean . datacube . WxDataCubeMsgResult ;
20- import me . chanjar . weixin . mp . bean . datacube . WxDataCubeUserCumulate ;
21- import me . chanjar . weixin . mp . bean . datacube . WxDataCubeUserSummary ;
7+ import me .chanjar .weixin .mp .bean .datacube .* ;
8+ import org . apache . commons . lang3 . time . FastDateFormat ;
9+
10+ import java . text . Format ;
11+ import java . util . Date ;
12+ import java . util . List ;
2213
2314/**
2415 * Created by Binary Wang on 2016/8/23.
2516 * @author binarywang (https://github.com/binarywang)
2617 */
2718public class WxMpDataCubeServiceImpl implements WxMpDataCubeService {
28- protected final Logger log = LoggerFactory .getLogger (WxMpDataCubeServiceImpl .class );
29-
3019 private static final String API_URL_PREFIX = "https://api.weixin.qq.com/datacube" ;
3120
3221 private final Format dateFormat = FastDateFormat .getInstance ("yyyy-MM-dd" );
@@ -44,7 +33,6 @@ public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate)
4433 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
4534 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
4635 String responseContent = this .wxMpService .post (url , param .toString ());
47- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
4836 return WxDataCubeUserSummary .fromJson (responseContent );
4937 }
5038
@@ -55,7 +43,6 @@ public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate
5543 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
5644 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
5745 String responseContent = this .wxMpService .post (url , param .toString ());
58- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
5946 return WxDataCubeUserCumulate .fromJson (responseContent );
6047 }
6148
@@ -66,7 +53,6 @@ public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endD
6653 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
6754 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
6855 String responseContent = this .wxMpService .post (url , param .toString ());
69- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
7056 return WxDataCubeArticleResult .fromJson (responseContent );
7157 }
7258
@@ -77,7 +63,6 @@ public List<WxDataCubeArticleTotal> getArticleTotal(Date beginDate, Date endDate
7763 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
7864 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
7965 String responseContent = this .wxMpService .post (url , param .toString ());
80- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
8166 return WxDataCubeArticleTotal .fromJson (responseContent );
8267 }
8368
@@ -88,7 +73,6 @@ public List<WxDataCubeArticleResult> getUserRead(Date beginDate, Date endDate) t
8873 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
8974 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
9075 String responseContent = this .wxMpService .post (url , param .toString ());
91- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
9276 return WxDataCubeArticleResult .fromJson (responseContent );
9377 }
9478
@@ -99,7 +83,6 @@ public List<WxDataCubeArticleResult> getUserReadHour(Date beginDate, Date endDat
9983 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
10084 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
10185 String responseContent = this .wxMpService .post (url , param .toString ());
102- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
10386 return WxDataCubeArticleResult .fromJson (responseContent );
10487 }
10588
@@ -110,7 +93,6 @@ public List<WxDataCubeArticleResult> getUserShare(Date beginDate, Date endDate)
11093 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
11194 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
11295 String responseContent = this .wxMpService .post (url , param .toString ());
113- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
11496 return WxDataCubeArticleResult .fromJson (responseContent );
11597 }
11698
@@ -121,7 +103,6 @@ public List<WxDataCubeArticleResult> getUserShareHour(Date beginDate, Date endDa
121103 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
122104 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
123105 String responseContent = this .wxMpService .post (url , param .toString ());
124- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
125106 return WxDataCubeArticleResult .fromJson (responseContent );
126107 }
127108
@@ -133,7 +114,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsg(Date beginDate, Date endDate)
133114 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
134115 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
135116 String responseContent = this .wxMpService .post (url , param .toString ());
136- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
137117 return WxDataCubeMsgResult .fromJson (responseContent );
138118 }
139119
@@ -145,7 +125,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgHour(Date beginDate,
145125 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
146126 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
147127 String responseContent = this .wxMpService .post (url , param .toString ());
148- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
149128 return WxDataCubeMsgResult .fromJson (responseContent );
150129 }
151130
@@ -157,7 +136,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgWeek(Date beginDate,
157136 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
158137 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
159138 String responseContent = this .wxMpService .post (url , param .toString ());
160- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
161139 return WxDataCubeMsgResult .fromJson (responseContent );
162140 }
163141
@@ -169,7 +147,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgMonth(Date beginDate,
169147 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
170148 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
171149 String responseContent = this .wxMpService .post (url , param .toString ());
172- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
173150 return WxDataCubeMsgResult .fromJson (responseContent );
174151 }
175152
@@ -181,7 +158,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDist(Date beginDate,
181158 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
182159 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
183160 String responseContent = this .wxMpService .post (url , param .toString ());
184- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
185161 return WxDataCubeMsgResult .fromJson (responseContent );
186162 }
187163
@@ -193,7 +169,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDistWeek(Date beginDate,
193169 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
194170 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
195171 String responseContent = this .wxMpService .post (url , param .toString ());
196- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
197172 return WxDataCubeMsgResult .fromJson (responseContent );
198173 }
199174
@@ -205,7 +180,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDistMonth(Date beginDate,
205180 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
206181 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
207182 String responseContent = this .wxMpService .post (url , param .toString ());
208- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
209183 return WxDataCubeMsgResult .fromJson (responseContent );
210184 }
211185
@@ -217,7 +191,6 @@ public List<WxDataCubeInterfaceResult> getInterfaceSummary(Date beginDate,
217191 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
218192 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
219193 String responseContent = this .wxMpService .post (url , param .toString ());
220- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
221194 return WxDataCubeInterfaceResult .fromJson (responseContent );
222195 }
223196
@@ -229,7 +202,6 @@ public List<WxDataCubeInterfaceResult> getInterfaceSummaryHour(Date beginDate,
229202 param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
230203 param .addProperty ("end_date" , this .dateFormat .format (endDate ));
231204 String responseContent = this .wxMpService .post (url , param .toString ());
232- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
233205 return WxDataCubeInterfaceResult .fromJson (responseContent );
234206 }
235207}
0 commit comments