|
@@ -90,6 +90,7 @@ import org.apache.http.ParseException;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.core.io.FileSystemResource;
|
|
|
import org.springframework.http.HttpEntity;
|
|
|
import org.springframework.http.HttpHeaders;
|
|
@@ -194,6 +195,9 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
private RedisUtil redisUtil;
|
|
|
private static ExecutorService cutExecutorService = Executors.newFixedThreadPool(10);
|
|
|
|
|
|
+ @Value("${kuaishou.realuser-ip}")
|
|
|
+ private String realUserIP;
|
|
|
+
|
|
|
@Override
|
|
|
public void getAdvertiserReportHourly(CtopOauthToken token, Date startDate, Date endDate) {
|
|
|
try {
|
|
@@ -924,7 +928,9 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
try {
|
|
|
String url = PropertiesUtils.getConfig("kuaishou_api_url") + KuaishouInterfaceConstant.CAMPAIGN_CREATE;
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
+
|
|
|
headers.put("Access-Token", accessToken);
|
|
|
+ headers.put("K-RealUser-IP", realUserIP);
|
|
|
headers.put("Content-Type", " application/json");
|
|
|
requestJson.put("advertiser_id", advertiserId);
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
@@ -984,6 +990,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
requestJson.put("advertiser_id", advertiserId);
|
|
|
headers.put("Access-Token", accessToken);
|
|
|
+ headers.put("K-RealUser-IP", realUserIP);
|
|
|
headers.put("Content-Type", " application/json");
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), headers);
|
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|
|
@@ -2174,6 +2181,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
|
|
|
requestJson.put("advertiser_id", advertiserId);
|
|
|
Map<String, String> header = new HashMap<String, String>();
|
|
|
header.put("Content-Type", " application/json");
|
|
|
+ header.put("K-RealUser-IP", realUserIP);
|
|
|
header.put("Access-Token", accessToken);
|
|
|
String result = HttpUtils.kuaiShouhttpPostRequest(url, requestJson.toJSONString(), header);
|
|
|
JSONObject resultJson = JSONObject.parseObject(result);
|