Commit c77b32ab authored by 宋新宇's avatar 宋新宇

Merge branch '3-抖音短剧及短剧app归因接入' into 'release_20240327_01'

短剧APP归因

See merge request !15
parents 559260f4 29475398
package com.lwby.marketing.att.dyvideo; package com.lwby.marketing.att.dyvideo;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alicp.jetcache.anno.CacheRefresh; import com.alicp.jetcache.anno.CacheRefresh;
...@@ -11,6 +10,7 @@ import com.lwby.marketing.att.UniversalProcess; ...@@ -11,6 +10,7 @@ import com.lwby.marketing.att.UniversalProcess;
import com.lwby.marketing.att.bystory.CallBackType; import com.lwby.marketing.att.bystory.CallBackType;
import com.lwby.marketing.att.novel.AttributionType; import com.lwby.marketing.att.novel.AttributionType;
import com.lwby.marketing.po.ThirdAccountDy; import com.lwby.marketing.po.ThirdAccountDy;
import com.lwby.marketing.util.HttpUtil;
import com.lwby.marketing.vo.AppChannelVO; import com.lwby.marketing.vo.AppChannelVO;
import com.lwby.marketing.vo.DeliveryDeviceInfo; import com.lwby.marketing.vo.DeliveryDeviceInfo;
import com.lwby.marketing.vo.StoryNovelAction; import com.lwby.marketing.vo.StoryNovelAction;
......
...@@ -15,6 +15,22 @@ import java.io.*; ...@@ -15,6 +15,22 @@ import java.io.*;
*/ */
public class HttpUtil { public class HttpUtil {
public static String post (String url, String toJson) throws IOException {
HttpClient httpClient = new HttpClient();
PostMethod postMethod = new PostMethod(url);
RequestEntity se = new StringRequestEntity(toJson ,"application/json" ,"UTF-8");
postMethod.setRequestEntity(se);
postMethod.setRequestHeader("Content-Type","application/json");
//默认的重试策略
postMethod.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler());
postMethod.getParams().setParameter(HttpMethodParams.SO_TIMEOUT, 5000);//设置超时时间
int httpStatus = httpClient.executeMethod(postMethod);
InputStream bodystreams = postMethod.getResponseBodyAsStream();
String body = convertStreamToString(bodystreams);
return body;
}
public static String postDy (String url, String toJson,String token) throws IOException { public static String postDy (String url, String toJson,String token) throws IOException {
HttpClient httpClient = new HttpClient(); HttpClient httpClient = new HttpClient();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment