|
|
package com.yoho.unions.server.service.impl;
|
|
|
|
|
|
import com.yoho.service.model.union.request.ActivateUnionRequestBO;
|
|
|
import com.yoho.service.model.union.request.ClickUnionRequestBO;
|
|
|
import com.yoho.unions.server.service.IUnionService;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.net.URLDecoder;
|
|
|
|
|
|
/**
|
|
|
* 汇川对接
|
|
|
* Created by zhengwen.ge on 2017/9/21.
|
|
|
*/
|
|
|
@Service("UnionServiceImpl_6")
|
|
|
public class HuiChuanServiceImpl extends UnionServiceImpl implements IUnionService {
|
|
|
|
|
|
static Logger log = LoggerFactory.getLogger(HuiChuanServiceImpl.class);
|
|
|
|
|
|
public ClickUnionRequestBO clickHttpRequestTOBO(HttpServletRequest request, ClickUnionRequestBO bo){
|
|
|
bo = new ClickUnionRequestBO();
|
|
|
String idfa = request.getParameter("IDFA_SUM");
|
|
|
String imei = request.getParameter("IMEI_SUM");
|
|
|
|
|
|
bo.setIdfa(idfa);
|
|
|
bo.setImei(imei);
|
|
|
|
|
|
bo.setUnion_type(request.getParameter("UNION_TYPE"));
|
|
|
String callBackUrl = request.getParameter("CALLBACK_URL");
|
|
|
bo.setCallbackurl(callBackUrl);
|
|
|
log.info("HuiChuan request is {}",bo);
|
|
|
return bo;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public String getCallbackUrl(ClickUnionRequestBO clickBO, ActivateUnionRequestBO activateUnionRequestBO) {
|
|
|
try{
|
|
|
if(null!=clickBO.getCallbackurl()){
|
|
|
String url = URLDecoder.decode(clickBO.getCallbackurl(),"UTF-8");
|
|
|
return url;
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
log.warn("getCallbackUrl exception is {}",e.getMessage());
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
} |
...
|
...
|
|