Authored by zhengwen.ge

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

@@ -76,10 +76,6 @@ public class RedirectServiceImpl implements IRedirectService { @@ -76,10 +76,6 @@ public class RedirectServiceImpl implements IRedirectService {
76 logger.warn("jump: channelId is null, requst param is {}", commonJumpReqVO); 76 logger.warn("jump: channelId is null, requst param is {}", commonJumpReqVO);
77 return; 77 return;
78 } 78 }
79 -// if (StringUtils.isEmpty(commonJumpReqVO.getChannel_code())) {  
80 -// logger.warn("jump: trackCode is null, requst param is {}", commonJumpReqVO);  
81 -// return;  
82 -// }  
83 String redirectUrl = builderCommonUrl(commonJumpReqVO); 79 String redirectUrl = builderCommonUrl(commonJumpReqVO);
84 response.setStatus(301); 80 response.setStatus(301);
85 response.sendRedirect(redirectUrl); 81 response.sendRedirect(redirectUrl);
@@ -147,9 +143,13 @@ public class RedirectServiceImpl implements IRedirectService { @@ -147,9 +143,13 @@ public class RedirectServiceImpl implements IRedirectService {
147 143
148 private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){ 144 private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){
149 logger.info("builderCommonUrl request is {}", commonJumpReqVO); 145 logger.info("builderCommonUrl request is {}", commonJumpReqVO);
150 -// String param = this.generateReqParam(commonJumpReqVO);  
151 String go_url = commonJumpReqVO.getGo_url(); 146 String go_url = commonJumpReqVO.getGo_url();
152 - StringBuffer targetUrl = new StringBuffer(commonJumpReqVO.getGo_url()); 147 + //如果go_url没有http:需要代码加上,不然301跳转不过去
  148 + StringBuffer bf = new StringBuffer();
  149 + if(!go_url.startsWith("http")){
  150 + go_url = bf.append("http://").append(go_url).toString();
  151 + }
  152 + StringBuffer targetUrl = new StringBuffer(go_url);
153 targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl; 153 targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl;
154 // String redirectUrl = null; 154 // String redirectUrl = null;
155 if(targetUrl.toString().contains("?")){ 155 if(targetUrl.toString().contains("?")){
@@ -111,14 +111,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher @@ -111,14 +111,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
111 try { 111 try {
112 clickUnion.info("enter clickUnion with param is {}", request); 112 clickUnion.info("enter clickUnion with param is {}", request);
113 //检查输入参数 113 //检查输入参数
114 -// if (StringUtils.isEmpty(request.getAppid())) {  
115 -// log.warn("clickUnion error because appid is empty with param is {}", request);  
116 -// return new UnionResponse(201, "appid is empty");  
117 -// }  
118 -// if (StringUtils.isEmpty(request.getTd())) {  
119 -// log.warn("clickUnion error because td is empty with param is {}", request);  
120 -// return new UnionResponse(201, "td is empty");  
121 -// }  
122 if (StringUtils.isEmpty(request.getUnion_type())) { 114 if (StringUtils.isEmpty(request.getUnion_type())) {
123 log.warn("clickUnion error because union_type is empty with param is {}", request); 115 log.warn("clickUnion error because union_type is empty with param is {}", request);
124 return new UnionResponse(201, "union_type is empty"); 116 return new UnionResponse(201, "union_type is empty");
@@ -127,7 +119,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher @@ -127,7 +119,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
127 log.warn("clickUnion error because union_type is error with param is {}", request); 119 log.warn("clickUnion error because union_type is error with param is {}", request);
128 return new UnionResponse(201, "union_type is error"); 120 return new UnionResponse(201, "union_type is error");
129 } 121 }
130 -// UnionTypeModel m = UnionConstant.unionTypeMap.get(Integer.parseInt(request.getUnion_type()));  
131 MktMarketingUrl type = redisValueCache.get("yh:union:uniontype:"+request.getUnion_type(),MktMarketingUrl.class); 122 MktMarketingUrl type = redisValueCache.get("yh:union:uniontype:"+request.getUnion_type(),MktMarketingUrl.class);
132 if(type==null){ 123 if(type==null){
133 type = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(request.getUnion_type())); 124 type = mktMarketingUrlDAO.selectByPrimaryKey(Long.valueOf(request.getUnion_type()));
@@ -452,6 +443,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher @@ -452,6 +443,7 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
452 j.put("app_key", request.getAppkey()); 443 j.put("app_key", request.getAppkey());
453 j.put("active_type", "90"); 444 j.put("active_type", "90");
454 j.put("tdid", request.getTdid()); 445 j.put("tdid", request.getTdid());
  446 + j.put("interfaceType",click.getInterfaceType());
455 //打印90天的大数据日志 447 //打印90天的大数据日志
456 activeDingdang.info(j.toString()); 448 activeDingdang.info(j.toString());
457 449
@@ -477,9 +469,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher @@ -477,9 +469,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
477 log.warn("publish activate event fail! e {}", e); 469 log.warn("publish activate event fail! e {}", e);
478 } 470 }
479 471
480 - // UnionTypeModel type =  
481 - // UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));  
482 -  
483 String url = null; 472 String url = null;
484 //取出具体是哪个union_type 473 //取出具体是哪个union_type
485 //根据不同的url走不同的回调 474 //根据不同的url走不同的回调
@@ -510,12 +499,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher @@ -510,12 +499,6 @@ public class UnionServiceImpl implements IUnionService,ApplicationEventPublisher
510 } else { 499 } else {
511 url += "?identify_id=" + click.getIdentify_id(); 500 url += "?identify_id=" + click.getIdentify_id();
512 } 501 }
513 -  
514 -// if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {  
515 -// url += "&idfa=" + click.getIdfa();  
516 -// } else {  
517 -// url += "&imei=" + click.getImei();  
518 -// }  
519 activeUnion.info("activateUnion in call url={}", url); 502 activeUnion.info("activateUnion in call url={}", url);
520 //改成httpclient方式调用 503 //改成httpclient方式调用
521 Pair<Integer, String> pair = HttpUtils.httpGet(url); 504 Pair<Integer, String> pair = HttpUtils.httpGet(url);