Authored by zhengwen.ge

增加监控

... ... @@ -78,6 +78,11 @@ public class ClickUnionRest {
String[] td1 = td.split("0_0_");
request.setTd(td1[1]);
}
//增加监控,把接口报上去,根据client_type来判断
request.setInterfaceType("addUnion_ios");
if(StringUtils.isNotEmpty(request.getClient_type())&&request.getClient_type().equals(ClientTypeEnum.ANDROID.getName())){
request.setInterfaceType("addUnion_android");
}
clickUnion.info("addUnion with param is {}", request);
UnionResponse response = unionService.clickUnion(request);
// log.info("addUnion with result is {}, and request is {}", response, request);
... ... @@ -466,6 +471,12 @@ public class ClickUnionRest {
log.error("addUnion4Stream error with request={}", bo, e);
}
try {
//增加监控,把接口报上去,根据client_type来判断
bo.setInterfaceType("addUnion4Jump_ios");
if(StringUtils.isNotEmpty(bo.getClient_type())&&bo.getClient_type().equals(ClientTypeEnum.ANDROID.getName())){
bo.setInterfaceType("addUnion4Jump_android");
}
StringBuffer stringBuffer = new StringBuffer();
String bean = stringBuffer.append("UnionServiceImpl").append("_").append(bo.getUnion_type()).toString();
boolean containsBean = SpringContextUtil.containsBean(bean);
... ... @@ -529,6 +540,11 @@ public class ClickUnionRest {
log.error("addMonitor error with request={}",e1.getMessage());
}
//增加监控,把接口报上去,根据client_type来判断
bo.setInterfaceType("addMonitor_ios");
if(StringUtils.isNotEmpty(bo.getClient_type())&&bo.getClient_type().equals(ClientTypeEnum.ANDROID.getName())){
bo.setInterfaceType("addMonitor_android");
}
clickUnion.info("addMonitor request={}", bo);
//根据union_type区分不同的厂商
String union_type = request.getParameter("union_type");
... ...
... ... @@ -53,8 +53,10 @@ public class GDT2ServiceImpl extends UnionServiceImpl implements IUnionService {
bo.setClient_type(app_type);
if(app_type.equals(ClientTypeEnum.ANDROID.getName())){
bo.setImei(muid);
bo.setInterfaceType("addMonitor_android");
}else {
bo.setIdfa(muid);
bo.setInterfaceType("addMonitor_ios");
}
bo.setAppid(request.getParameter("appid"));
bo.setClickId(request.getParameter("click_id"));
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.unions.server.service.impl;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
... ... @@ -23,6 +24,10 @@ public class TouTiaoServiceImpl extends UnionServiceImpl implements IUnionServic
bo = new ClickUnionRequestBO();
String idfa = request.getParameter("idfa");
String imei = request.getParameter("imei");
bo.setInterfaceType("addMonitor_ios");
if(StringUtils.isNotEmpty(imei)) {
bo.setInterfaceType("addMonitor_android");
}
bo.setIdfa(idfa);
bo.setImei(imei);
//将毫秒级的转换为秒级别---头条有时候不传
... ...
... ... @@ -467,7 +467,8 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
}else if(StringUtils.isNotEmpty(request.getImei())){
muid = request.getImei();
}
DeviceActiveEvent activeEvent = new DeviceActiveEvent("deviceActive",source,source_id,muid);
String interfaceType = click.getInterfaceType();
DeviceActiveEvent activeEvent = new DeviceActiveEvent("deviceActive",source,source_id,muid,interfaceType);
//上报激活事件
try{
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.unions.server.service.impl;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
... ... @@ -26,6 +27,10 @@ public class WeiBoServiceImpl extends UnionServiceImpl implements IUnionService
String clicktime = request.getParameter("clicktime");
Long click = Long.valueOf(clicktime);
clickUnionRequestBO.setIdfa(request.getParameter("idfa_md5"));
clickUnionRequestBO.setInterfaceType("addMonitor_ios");
if(StringUtils.isNotEmpty(request.getParameter("imei_md5"))){
clickUnionRequestBO.setInterfaceType("addMonitor_android");
}
clickUnionRequestBO.setImei(request.getParameter("imei_md5"));
clickUnionRequestBO.setClickTime(click/1000);
clickUnionRequestBO.setCallbackurl(request.getParameter("IMP"));
... ...