Authored by zhengwen.ge

大数据日志里面增加一个上报类型,方便定位

... ... @@ -76,10 +76,6 @@ public class RedirectServiceImpl implements IRedirectService {
logger.warn("jump: channelId is null, requst param is {}", commonJumpReqVO);
return;
}
// if (StringUtils.isEmpty(commonJumpReqVO.getChannel_code())) {
// logger.warn("jump: trackCode is null, requst param is {}", commonJumpReqVO);
// return;
// }
String redirectUrl = builderCommonUrl(commonJumpReqVO);
response.setStatus(301);
response.sendRedirect(redirectUrl);
... ... @@ -147,9 +143,13 @@ public class RedirectServiceImpl implements IRedirectService {
private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){
logger.info("builderCommonUrl request is {}", commonJumpReqVO);
// String param = this.generateReqParam(commonJumpReqVO);
String go_url = commonJumpReqVO.getGo_url();
StringBuffer targetUrl = new StringBuffer(commonJumpReqVO.getGo_url());
//如果go_url没有http:需要代码加上,不然301跳转不过去
StringBuffer bf = new StringBuffer();
if(!go_url.startsWith("http")){
go_url = bf.append("http://").append(go_url).toString();
}
StringBuffer targetUrl = new StringBuffer(go_url);
targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl;
// String redirectUrl = null;
if(targetUrl.toString().contains("?")){
... ...
... ... @@ -111,14 +111,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
try {
clickUnion.info("enter clickUnion with param is {}", request);
//检查输入参数
// if (StringUtils.isEmpty(request.getAppid())) {
// log.warn("clickUnion error because appid is empty with param is {}", request);
// return new UnionResponse(201, "appid is empty");
// }
// if (StringUtils.isEmpty(request.getTd())) {
// log.warn("clickUnion error because td is empty with param is {}", request);
// return new UnionResponse(201, "td is empty");
// }
if (StringUtils.isEmpty(request.getUnion_type())) {
log.warn("clickUnion error because union_type is empty with param is {}", request);
return new UnionResponse(201, "union_type is empty");
... ... @@ -127,7 +119,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
log.warn("clickUnion error because union_type is error with param is {}", request);
return new UnionResponse(201, "union_type is error");
}
// UnionTypeModel m = UnionConstant.unionTypeMap.get(Integer.parseInt(request.getUnion_type()));
MktMarketingUrl type = redisValueCache.get("yh:union:uniontype:"+request.getUnion_type(),MktMarketingUrl.class);
if(type==null){
type = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(request.getUnion_type()));
... ... @@ -452,6 +443,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
j.put("app_key", request.getAppkey());
j.put("active_type", "90");
j.put("tdid", request.getTdid());
j.put("interfaceType",click.getInterfaceType());
//打印90天的大数据日志
activeDingdang.info(j.toString());
... ... @@ -477,9 +469,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
log.warn("publish activate event fail! e {}", e);
}
// UnionTypeModel type =
// UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));
String url = null;
//取出具体是哪个union_type
//根据不同的url走不同的回调
... ... @@ -510,12 +499,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
} else {
url += "?identify_id=" + click.getIdentify_id();
}
// if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
// url += "&idfa=" + click.getIdfa();
// } else {
// url += "&imei=" + click.getImei();
// }
activeUnion.info("activateUnion in call url={}", url);
//改成httpclient方式调用
Pair<Integer, String> pair = HttpUtils.httpGet(url);
... ...