Authored by gemingdan

中岸广告

package com.yoho.unions.server.service.impl;
import com.yoho.unions.common.utils.HttpUtils;
import com.yoho.unions.server.service.IOrderPushService;
import com.yoho.unions.vo.OrderInfo;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by mingdan.ge on 2019/11/25.
*/
@Service
public class ChineseANS2SImpl implements IOrderPushService {
static Logger logger = LoggerFactory.getLogger(ChineseANS2SImpl.class);
static final String preUrl = "https://www.chinesean.com/affiliate/tracking3.do?pId=19865";
@Override
public void pushOrder(List<OrderInfo> orderInfos){
orderInfos.forEach(o->{
//https://www.chinesean.com/affiliate/tracking3.do?pId=PROGRAMID&tracking=REFID&cpa=&cpl=&cps=AMOUNT,TIERID&txId=TXID
String url=preUrl+"&tracking="+o.getOrderCode()+"cpa=&cpl=&cps="+o.getOrderAmount()+",TIERID"+"&txId="+o.getUnionData();
Pair<Integer, String> pair = HttpUtils.httpGet(url);
if (pair.getLeft() != 200) {
logger.error("ChineseANS2SImpl.pushOrder error,url is ,result is {}.",url,pair);
}
});
}
}
... ...
... ... @@ -54,6 +54,8 @@
<entry key="3001" value-ref="fanliServiceImpl"/>
<entry key="3063" value-ref="fanliServiceImpl"/>
<entry key="3419" value-ref="panshiServiceImpl"/>
<entry key="100000000017546" value-ref="chineseANS2SImpl"/>
<entry key="100000000017548" value-ref="chineseANS2SImpl"/>
</util:map>
<!-- 输出对象转JSON支持 -->
... ...