Commit 1aaa4078 authored by she's avatar she

ios 模糊匹配回传

parent d46cff55
......@@ -2,3 +2,4 @@
/.gradle
/.gradle/
/.idea/
/.gradle/
......@@ -82,7 +82,7 @@ public class AppsflyerAdmapping {
})
.uid("parse-event")
.name("parse-event");
// adEventDataStream.print();
//ios模糊匹配
adEventDataStream
.addSink(new TiktokSink())
......
......@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fshark.overseas.advert.modle.AppsFlyerEvent;
import com.fshark.overseas.advert.modle.AppsflyerPurchase;
import com.fshark.overseas.advert.modle.EventTypeEnum;
import com.fshark.overseas.advert.modle.TiktokModle;
import com.google.gson.Gson;
......@@ -43,12 +44,21 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
@Override
public void invoke(AppsFlyerEvent value, Context context) throws Exception {
if (!value.getGame_id().equals("com.chaosportal.shark") || !"pangle".equals(value.getMedia_source())) {
if (!value.getGame_id().equals("com.chaosportal.fshark") || !"Pangle".equals(value.getMedia_source())) {
return;
}
if ("ios".equalsIgnoreCase(value.getPlatform()) && EventTypeEnum.orderEvent(value)) {
AppsflyerPurchase appsflyerPurchase = new Gson().fromJson(value.getEvent_value(), AppsflyerPurchase.class);
String bundleId = appsflyerPurchase.getBundle_id();
value.setGame_id(bundleId == null ? value.getGame_id() : bundleId);
}
try {
if (EventTypeEnum.installEvent(value) || EventTypeEnum.orderEvent(value)) {
String event_name = "";
String event_name = "Purchase";
if (EventTypeEnum.installEvent(value)) {
event_name = "InstallApp";
}
......@@ -61,7 +71,7 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
contextDTO.setUserAgent(value.getUser_agent());
contextDTO.setOriginUrl(value.getOriginal_url());
TiktokModle.ContextDTO.AppDTO appDTO = new TiktokModle.ContextDTO.AppDTO();
appDTO.setId(value.getApp_id().replace("id",""));
appDTO.setId(value.getApp_id().replace("id", ""));
contextDTO.setApp(appDTO);
TiktokModle.ContextDTO.DeviceDTO deviceDTO = new TiktokModle.ContextDTO.DeviceDTO();
deviceDTO.setPlatform(value.getPlatform());
......@@ -102,6 +112,9 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
sendReport(tiktokModle);
}
} catch (Exception e) {
}
}
}
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