|
@@ -1912,6 +1912,42 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public JSONObject getDeepConversionInfosV2(Long advertiserId, String accessToken) {
|
|
|
|
+ String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.DEEP_CONVERSION_INFOS;
|
|
|
|
+ JSONObject param = new JSONObject();
|
|
|
|
+ param.put("advertiser_id", advertiserId);
|
|
|
|
+ Map<String, String> headers = new HashMap<String, String>();
|
|
|
|
+ headers.put("Access-Token", accessToken);
|
|
|
|
+ headers.put("Content-Type", " application/json");
|
|
|
|
+ try {
|
|
|
|
+ String result = HttpUtils.kuaiShouhttpPostRequest(url, param.toJSONString(), headers);
|
|
|
|
+ JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
|
+ log.info(resultJson.toJSONString());
|
|
|
|
+ if (!Check.isNullMap(resultJson)) {
|
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ JSONObject dataJson = resultJson.getJSONObject("data");
|
|
|
|
+ if (!Check.isNullMap(dataJson)) {
|
|
|
|
+ return dataJson;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("获取可选的深度转化类型返回异常,advertiserId:{},异常信息:{}", advertiserId, resultJson);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("快手,获取可选的深度转化类型返回为空,advertiserId:{}", advertiserId);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 创建广告创意
|
|
* 创建广告创意
|
|
*
|
|
*
|
|
@@ -3031,15 +3067,10 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
JSONArray data = resultJson.getJSONArray("data");
|
|
JSONArray data = resultJson.getJSONArray("data");
|
|
return data;
|
|
return data;
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
-
|
|
|
|
log.error("获取人群包管理返回数据为空,accountId:{}", accountId);
|
|
log.error("获取人群包管理返回数据为空,accountId:{}", accountId);
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
@@ -3066,21 +3097,16 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
headers.put("Content-Type", "application/json");
|
|
headers.put("Content-Type", "application/json");
|
|
JSONObject requestJson = new JSONObject();
|
|
JSONObject requestJson = new JSONObject();
|
|
requestJson.put("advertiser_id", accountId);
|
|
requestJson.put("advertiser_id", accountId);
|
|
-
|
|
|
|
-
|
|
|
|
JSONArray typeArr = new JSONArray();
|
|
JSONArray typeArr = new JSONArray();
|
|
typeArr.add("BUSINESS_INTEREST");
|
|
typeArr.add("BUSINESS_INTEREST");
|
|
typeArr.add("APP_INTEREST");
|
|
typeArr.add("APP_INTEREST");
|
|
typeArr.add("FANS_STAR");
|
|
typeArr.add("FANS_STAR");
|
|
typeArr.add("INTEREST_VIDEO");
|
|
typeArr.add("INTEREST_VIDEO");
|
|
-
|
|
|
|
-
|
|
|
|
for (int i = 0; i < typeArr.size(); i++) {
|
|
for (int i = 0; i < typeArr.size(); i++) {
|
|
String type = typeArr.get(i).toString();
|
|
String type = typeArr.get(i).toString();
|
|
requestJson.put("type", type);
|
|
requestJson.put("type", type);
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
- System.err.println(resultJson);
|
|
|
|
if (!Check.isNull(resultJson)) {
|
|
if (!Check.isNull(resultJson)) {
|
|
Integer code = resultJson.getInteger("code");
|
|
Integer code = resultJson.getInteger("code");
|
|
if (code == 0) {
|
|
if (code == 0) {
|
|
@@ -3100,20 +3126,51 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
log.error("获取定向标签返回数据为空,accountId:{}", accountId);
|
|
log.error("获取定向标签返回数据为空,accountId:{}", accountId);
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取可选的应用定向
|
|
|
|
+ *
|
|
|
|
+ * @param accountId
|
|
|
|
+ * @param accessToken
|
|
|
|
+ * @param appName
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public JSONArray getAppSearch(Long accountId, String accessToken, String appName) {
|
|
|
|
+ try {
|
|
|
|
+ String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.APP_SEARCH;
|
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
|
+ headers.put("Access-Token", accessToken);
|
|
|
|
+ headers.put("Content-Type", "application/json");
|
|
|
|
+ JSONObject requestJson = new JSONObject();
|
|
|
|
+ requestJson.put("advertiser_id", accountId);
|
|
|
|
+ requestJson.put("app_name", appName);
|
|
|
|
+
|
|
|
|
+ String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
|
|
+ JSONObject resultJson = JSONObject.parseObject(result);
|
|
|
|
+ if (!Check.isNull(resultJson)) {
|
|
|
|
+ Integer code = resultJson.getInteger("code");
|
|
|
|
+ if (code == 0) {
|
|
|
|
+ JSONArray data = resultJson.getJSONArray("data");
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|