1
1
package me .chanjar .weixin .mp .api .impl ;
2
2
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
-
11
3
import com .google .gson .JsonObject ;
12
-
13
4
import me .chanjar .weixin .common .exception .WxErrorException ;
14
5
import me .chanjar .weixin .mp .api .WxMpDataCubeService ;
15
6
import 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 ;
22
13
23
14
/**
24
15
* Created by Binary Wang on 2016/8/23.
25
16
* @author binarywang (https://github.com/binarywang)
26
17
*/
27
18
public class WxMpDataCubeServiceImpl implements WxMpDataCubeService {
28
- protected final Logger log = LoggerFactory .getLogger (WxMpDataCubeServiceImpl .class );
29
-
30
19
private static final String API_URL_PREFIX = "https://api.weixin.qq.com/datacube" ;
31
20
32
21
private final Format dateFormat = FastDateFormat .getInstance ("yyyy-MM-dd" );
@@ -44,7 +33,6 @@ public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate)
44
33
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
45
34
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
46
35
String responseContent = this .wxMpService .post (url , param .toString ());
47
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
48
36
return WxDataCubeUserSummary .fromJson (responseContent );
49
37
}
50
38
@@ -55,7 +43,6 @@ public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate
55
43
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
56
44
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
57
45
String responseContent = this .wxMpService .post (url , param .toString ());
58
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
59
46
return WxDataCubeUserCumulate .fromJson (responseContent );
60
47
}
61
48
@@ -66,7 +53,6 @@ public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endD
66
53
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
67
54
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
68
55
String responseContent = this .wxMpService .post (url , param .toString ());
69
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
70
56
return WxDataCubeArticleResult .fromJson (responseContent );
71
57
}
72
58
@@ -77,7 +63,6 @@ public List<WxDataCubeArticleTotal> getArticleTotal(Date beginDate, Date endDate
77
63
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
78
64
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
79
65
String responseContent = this .wxMpService .post (url , param .toString ());
80
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
81
66
return WxDataCubeArticleTotal .fromJson (responseContent );
82
67
}
83
68
@@ -88,7 +73,6 @@ public List<WxDataCubeArticleResult> getUserRead(Date beginDate, Date endDate) t
88
73
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
89
74
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
90
75
String responseContent = this .wxMpService .post (url , param .toString ());
91
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
92
76
return WxDataCubeArticleResult .fromJson (responseContent );
93
77
}
94
78
@@ -99,7 +83,6 @@ public List<WxDataCubeArticleResult> getUserReadHour(Date beginDate, Date endDat
99
83
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
100
84
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
101
85
String responseContent = this .wxMpService .post (url , param .toString ());
102
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
103
86
return WxDataCubeArticleResult .fromJson (responseContent );
104
87
}
105
88
@@ -110,7 +93,6 @@ public List<WxDataCubeArticleResult> getUserShare(Date beginDate, Date endDate)
110
93
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
111
94
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
112
95
String responseContent = this .wxMpService .post (url , param .toString ());
113
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
114
96
return WxDataCubeArticleResult .fromJson (responseContent );
115
97
}
116
98
@@ -121,7 +103,6 @@ public List<WxDataCubeArticleResult> getUserShareHour(Date beginDate, Date endDa
121
103
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
122
104
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
123
105
String responseContent = this .wxMpService .post (url , param .toString ());
124
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
125
106
return WxDataCubeArticleResult .fromJson (responseContent );
126
107
}
127
108
@@ -133,7 +114,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsg(Date beginDate, Date endDate)
133
114
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
134
115
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
135
116
String responseContent = this .wxMpService .post (url , param .toString ());
136
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
137
117
return WxDataCubeMsgResult .fromJson (responseContent );
138
118
}
139
119
@@ -145,7 +125,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgHour(Date beginDate,
145
125
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
146
126
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
147
127
String responseContent = this .wxMpService .post (url , param .toString ());
148
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
149
128
return WxDataCubeMsgResult .fromJson (responseContent );
150
129
}
151
130
@@ -157,7 +136,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgWeek(Date beginDate,
157
136
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
158
137
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
159
138
String responseContent = this .wxMpService .post (url , param .toString ());
160
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
161
139
return WxDataCubeMsgResult .fromJson (responseContent );
162
140
}
163
141
@@ -169,7 +147,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgMonth(Date beginDate,
169
147
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
170
148
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
171
149
String responseContent = this .wxMpService .post (url , param .toString ());
172
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
173
150
return WxDataCubeMsgResult .fromJson (responseContent );
174
151
}
175
152
@@ -181,7 +158,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDist(Date beginDate,
181
158
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
182
159
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
183
160
String responseContent = this .wxMpService .post (url , param .toString ());
184
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
185
161
return WxDataCubeMsgResult .fromJson (responseContent );
186
162
}
187
163
@@ -193,7 +169,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDistWeek(Date beginDate,
193
169
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
194
170
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
195
171
String responseContent = this .wxMpService .post (url , param .toString ());
196
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
197
172
return WxDataCubeMsgResult .fromJson (responseContent );
198
173
}
199
174
@@ -205,7 +180,6 @@ public List<WxDataCubeMsgResult> getUpstreamMsgDistMonth(Date beginDate,
205
180
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
206
181
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
207
182
String responseContent = this .wxMpService .post (url , param .toString ());
208
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
209
183
return WxDataCubeMsgResult .fromJson (responseContent );
210
184
}
211
185
@@ -217,7 +191,6 @@ public List<WxDataCubeInterfaceResult> getInterfaceSummary(Date beginDate,
217
191
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
218
192
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
219
193
String responseContent = this .wxMpService .post (url , param .toString ());
220
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
221
194
return WxDataCubeInterfaceResult .fromJson (responseContent );
222
195
}
223
196
@@ -229,7 +202,6 @@ public List<WxDataCubeInterfaceResult> getInterfaceSummaryHour(Date beginDate,
229
202
param .addProperty ("begin_date" , this .dateFormat .format (beginDate ));
230
203
param .addProperty ("end_date" , this .dateFormat .format (endDate ));
231
204
String responseContent = this .wxMpService .post (url , param .toString ());
232
- this .log .debug ("\n url:{}\n params:{}\n response:{}" ,url , param , responseContent );
233
205
return WxDataCubeInterfaceResult .fromJson (responseContent );
234
206
}
235
207
}
0 commit comments