Authored by linlong

update

... ... @@ -15,6 +15,14 @@ public class UnionReqVO{
private String u_id;
private String union_type;
private String utm_source;
private String utm_medium;
private String utm_campaign;
public String getChannel_id() {
return channel_id;
}
... ... @@ -46,5 +54,37 @@ public class UnionReqVO{
public void setU_id(String u_id) {
this.u_id = u_id;
}
public String getUnion_type() {
return union_type == null ? "" :union_type;
}
public void setUnion_type(String union_type) {
this.union_type = union_type;
}
public String getUtm_source() {
return utm_source == null ? "" :utm_source ;
}
public void setUtm_source(String utm_source) {
this.utm_source = utm_source;
}
public String getUtm_medium() {
return utm_medium == null ? "" :utm_medium;
}
public void setUtm_medium(String utm_medium) {
this.utm_medium = utm_medium;
}
public String getUtm_campaign() {
return utm_campaign == null ? "" : utm_campaign;
}
public void setUtm_campaign(String utm_campaign) {
this.utm_campaign = utm_campaign;
}
}
... ...
... ... @@ -60,10 +60,17 @@ public class RedirectServiceImpl implements IRedirectService{
private String builderUrlForPanshi(UnionReqVO uionReqVO){
String param = this.generateReqParam(uionReqVO);
String targetUrl = uionReqVO.getTarget_url();
StringBuffer targetUrl = new StringBuffer(uionReqVO.getTarget_url());
targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl;
if(targetUrl.toString().contains("?")){
targetUrl.append("&utm_source=").append(uionReqVO.getUtm_source()).append("&utm_medium=").append(uionReqVO.getUtm_medium()).append("&utm_campaign=").append(uionReqVO.getUtm_campaign());
}else{
targetUrl.append("?utm_source=").append(uionReqVO.getUtm_source()).append("&utm_medium=").append(uionReqVO.getUtm_medium()).append("&utm_campaign=").append(uionReqVO.getUtm_campaign());
}
try {
param = URLEncoder.encode(param, "UTF-8");
targetUrl = URLEncoder.encode(targetUrl, "UTF-8");
targetUrl = new StringBuffer(URLEncoder.encode(targetUrl.toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
logger.warn("builderUrlForPanshi: urlEncode failed: request param is {}", uionReqVO);
}
... ...