yumeng 2 years ago
parent
commit
21201290be

+ 9 - 16
job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/data/service/impl/AdUnitReportServiceImpl.java

@@ -63,28 +63,21 @@ public class AdUnitReportServiceImpl implements IAdUnitReportService {
      */
     @Override
     public void getAdUnitReport(Long advertiserId, String accessToken, String startDate, String endDate, int page) {
-        log.info("accountId:=={}=====获取广告组数据信息====page--{}===》》》》", advertiserId, page);
-        Integer page_size = 200;
-
-        Map<String, String> headers = new HashMap<>();
-        headers.put("Access-Token", accessToken);
-        Map<String, Object> param = new HashMap<>();
+        JSONObject param = new JSONObject();
         param.put("advertiser_id", advertiserId);
-
-        if (!Check.isNull(startDate)) {
+        param.put("page_size", 500);
+        param.put("page", page);
+        if (startDate != null && endDate != null) {
             param.put("start_date", startDate);
-        }
-        if (!Check.isNull(endDate)) {
             param.put("end_date", endDate);
         }
-        param.put("page_size", page_size);
-        param.put("page", page);
-        System.err.println("入参:" + param);
-
-        String result = HttpUtils.httpPostRequest(postUrl + KuaishouConstant.AD_UNIT_LIST, param, headers);
-        // System.err.println(result);
+        Map<String, String> headers = new HashMap<>();
+        headers.put("Access-Token", accessToken);
+        headers.put("Content-Type", "application/json");
 
+        String result = HttpUtils.kuaiShouhttpPostRequest("https://ad.e.kuaishou.com/rest/openapi/v1/ad_unit/list", param.toJSONString(), headers);
         JSONObject resultJson = JSONObject.parseObject(result);
+
         if (Check.isNull(resultJson)) {
             log.info("accountId:=={}=====广告组数据信息====暂无====》》》》", advertiserId);
             return;