Commit 1aaa4078 authored by she's avatar she

ios 模糊匹配回传

parent d46cff55
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
/.gradle /.gradle
/.gradle/ /.gradle/
/.idea/ /.idea/
/.gradle/
...@@ -82,7 +82,7 @@ public class AppsflyerAdmapping { ...@@ -82,7 +82,7 @@ public class AppsflyerAdmapping {
}) })
.uid("parse-event") .uid("parse-event")
.name("parse-event"); .name("parse-event");
// adEventDataStream.print();
//ios模糊匹配 //ios模糊匹配
adEventDataStream adEventDataStream
.addSink(new TiktokSink()) .addSink(new TiktokSink())
......
...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON; ...@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fshark.overseas.advert.modle.AppsFlyerEvent; 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.EventTypeEnum;
import com.fshark.overseas.advert.modle.TiktokModle; import com.fshark.overseas.advert.modle.TiktokModle;
import com.google.gson.Gson; import com.google.gson.Gson;
...@@ -43,12 +44,21 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> { ...@@ -43,12 +44,21 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
@Override @Override
public void invoke(AppsFlyerEvent value, Context context) throws Exception { 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; 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)) { if (EventTypeEnum.installEvent(value) || EventTypeEnum.orderEvent(value)) {
String event_name = ""; String event_name = "Purchase";
if (EventTypeEnum.installEvent(value)) { if (EventTypeEnum.installEvent(value)) {
event_name = "InstallApp"; event_name = "InstallApp";
} }
...@@ -61,7 +71,7 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> { ...@@ -61,7 +71,7 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
contextDTO.setUserAgent(value.getUser_agent()); contextDTO.setUserAgent(value.getUser_agent());
contextDTO.setOriginUrl(value.getOriginal_url()); contextDTO.setOriginUrl(value.getOriginal_url());
TiktokModle.ContextDTO.AppDTO appDTO = new TiktokModle.ContextDTO.AppDTO(); 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); contextDTO.setApp(appDTO);
TiktokModle.ContextDTO.DeviceDTO deviceDTO = new TiktokModle.ContextDTO.DeviceDTO(); TiktokModle.ContextDTO.DeviceDTO deviceDTO = new TiktokModle.ContextDTO.DeviceDTO();
deviceDTO.setPlatform(value.getPlatform()); deviceDTO.setPlatform(value.getPlatform());
...@@ -102,6 +112,9 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> { ...@@ -102,6 +112,9 @@ public class TiktokSink extends RichSinkFunction<AppsFlyerEvent> {
sendReport(tiktokModle); 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