Authored by zhengwen.ge

now下载上报

... ... @@ -26,6 +26,7 @@
<value>/MobvistaUnionRest/addUnion4Mobvista</value>
<value>/ActivateUnionRest/addActivate</value>
<value>/ActivateUnionRest/queryActivateDeviceId</value>
<value>/UnionRest/addYas</value>
<value>/jump</value>
<value>/go</value>
<value>/pushUnionOrders</value>
... ...
... ... @@ -85,6 +85,6 @@ public class UnionRest {
@ResponseBody
public UnionResponse addYas(ClickUnionRequestBO request){
log.info("Enter addYas UnionType is {}",request.getUnion_type());
return dingdangService.addYas(request);
}
}
... ...
... ... @@ -2,6 +2,8 @@ package com.yoho.unions.server.service;
import com.yoho.service.model.union.request.ActiveUnionRequestBO;
import com.yoho.service.model.union.request.AddUnionRequestBO;
import com.yoho.service.model.union.request.ClickUnionRequestBO;
import com.yoho.service.model.union.response.UnionResponse;
import com.yoho.service.model.union.response.UnionResponseBO;
/**
... ... @@ -30,5 +32,7 @@ public interface DingdangService {
public UnionResponseBO activeUnion(ActiveUnionRequestBO request) throws Exception;
UnionResponseBO addBigData(int beginTime,int endTime);
UnionResponseBO addBigData(int beginTime,int endTime);
UnionResponse addYas(ClickUnionRequestBO request);
}
... ...
... ... @@ -14,6 +14,7 @@ import com.yoho.unions.common.enums.SourceEnum;
import com.yoho.unions.common.redis.RedisValueCache;
import com.yoho.unions.common.utils.DateUtil;
import com.yoho.unions.common.utils.HttpUtils;
import com.yoho.unions.common.utils.RandomUtil;
import com.yoho.unions.dal.IMktMarketingUrlDAO;
import com.yoho.unions.dal.IUnionActivityLogsDAO;
import com.yoho.unions.dal.IUnionClickLogsDAO;
... ... @@ -341,17 +342,34 @@ public class DingdangServiceImpl implements DingdangService {
return response;
}
@Override
public UnionResponse addYas(ClickUnionRequestBO request){
String unionType = request.getUnion_type();
String ak = "yohoboys_m";
String cd = unionType;
String random = RandomUtil.getRandom(5);
int ts = DateUtil.getCurrentTimeSecond();
//唯一标示;与大数据产品确认用时间戳+5
String cd = ts+random;
String ckf="Y";
String op = "YN_DOWNLOAD_C";
int ts = DateUtil.getCurrentTimeSecond();
StringBuffer sf = new StringBuffer();
// sf.append(yasUrl).append("?h=").append()
return null;
String url = sf.append(yasUrl).append("?h==m.yohobuy.com")
.append("&p=&u=/&ft=117&fst=410&sv=2.1.1&ab=&apf=N")
.append("&ak=").append(ak).append("&cd=").append(cd)
.append("&vd=14839465348061412675814&ud=&rf=").append("&ckf=").append(ckf)
.append("&ts=").append(ts).append("&mktc=").append(unionType)
.append("&op=").append(op)
.append("&sr=360x640&wr=360x640&sd=32&ln=zh-CN&sy=Linux%20aarch64&ce=true&fv=0").toString();
Pair<Integer, String> pair = HttpUtils.httpGet(url);
log.info("addYas sendUrl union success url={}, and result={}", url, pair);
if (pair.getLeft() != 200) {
log.warn("addYas callback error with request={}", url);
return new UnionResponse(204, "callback error");
}
return new UnionResponse();
}
}
... ...
... ... @@ -13,20 +13,6 @@
var jumpTypes = [110];
(function (w, d, s, j, f) {
w['YohoAcquisitionObject'] = f;
w[f] = function () {
w[f].p = arguments;
};
var a = d.createElement(s);
var m = d.getElementsByTagName(s)[0];
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', '//cdn.yoho.cn/yas-jssdk/1.0.16/yas.js', '_yas');
_yas(1 * new Date(), '1.0.16', 'yohoboys_m', '', '');
function isInJump(unionType) {
for (var i = 0 ;i < jumpTypes.length; i++) {
if (unionType == jumpTypes[i]) {
... ... @@ -49,11 +35,26 @@
}
return vars;
}
downUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=cn.yoho.magazine';
queryString = getQueryString();
$.ajax({
method: 'POST',
// url: 'http://union.yoho.cn/union/UnionRest/addYas',
url: 'http://127.0.0.1:8088/union/UnionRest/addYas',
data: {
union_type: queryString.union_type,
},
complete: function(){
window.location.href = downUrl;
window.setTimeout(function(){
window.location.href = "http://m.yohobuy.com";
}, 2000);
}});
queryString = getQueryString();
downUrl = 'http://a.app.qq.com/o/simple.jsp?pkgname=cn.yoho.magazine';
//downUrl = "https://itunes.apple.com/cn/app/yoho!-you-huo/id490655927?mt=8";
window.location.href = downUrl;
// window.location.href = downUrl;
... ...