|
@@ -271,12 +271,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate) {
|
|
|
- getAccountDailyReportByPage(token, startDate, endDate, 1);
|
|
|
+ public void getAdvertiserReportDaily(CtopOauthToken token, Date startDate, Date endDate, String reportDims) {
|
|
|
+ getAccountDailyReportByPage(token, startDate, endDate, 1, reportDims);
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void getAccountDailyReportByPage(CtopOauthToken token, Date startDate, Date endDate, int page) {
|
|
|
+ private void getAccountDailyReportByPage(CtopOauthToken token, Date startDate, Date endDate, int page, String reportDims) {
|
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.ACCOUNT_REPORT;
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("Content-Type", "application/json");
|
|
@@ -289,11 +289,13 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
if (!Check.isNull(endDate)) {
|
|
|
param.put("end_date", DateUtils.formatDate(endDate));
|
|
|
}
|
|
|
-
|
|
|
+ if (!Check.isNull(reportDims)) {
|
|
|
+ param.put("report_dims", reportDims);
|
|
|
+ }
|
|
|
|
|
|
param.put("advertiser_id", token.getAccountId());
|
|
|
param.put("temporal_granularity", "DAILY");
|
|
|
- param.put("page_size", 500);
|
|
|
+ param.put("page_size", 2000);
|
|
|
param.put("page", page);
|
|
|
String result = HttpUtils.httpPostRequest(url, param, headers);
|
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
@@ -309,6 +311,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ List<>
|
|
|
for (int i = 0; i < details.size(); i++) {
|
|
|
JSONObject detailJson = details.getJSONObject(i);
|
|
|
if (!Check.isNull(detailJson)) {
|
|
@@ -316,12 +319,12 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
detailJson.put("photo_comment", detailJson.getString("comment"));
|
|
|
detailJson.put("photo_like", detailJson.getString("like"));
|
|
|
detailJson.put("photo_show", detailJson.getString("show"));
|
|
|
- var KuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
|
|
|
+ KuaishouReportDailyAccount KuaishouReportDailyAccount = JSONObject.toJavaObject(detailJson, KuaishouReportDailyAccount.class);
|
|
|
KuaishouReportDailyAccount.setAccountId(token.getAccountId());
|
|
|
- dailyAccountMapper.insertSelective(KuaishouReportDailyAccount);
|
|
|
+ // dailyAccountMapper.insertSelective(KuaishouReportDailyAccount);
|
|
|
}
|
|
|
}
|
|
|
- getAccountDailyReportByPage(token, startDate, endDate, page + 1);
|
|
|
+ getAccountDailyReportByPage(token, startDate, endDate, page + 1, reportDims);
|
|
|
}
|
|
|
|
|
|
|