|
|
1
|
+package com.yoho.unions.server.service.impl;
|
|
|
2
|
+
|
|
|
3
|
+import com.yoho.service.model.union.request.ActivateUnionRequestBO;
|
|
|
4
|
+import com.yoho.service.model.union.request.ClickUnionRequestBO;
|
|
|
5
|
+import com.yoho.unions.server.service.IUnionService;
|
|
|
6
|
+import org.apache.commons.lang.StringUtils;
|
|
|
7
|
+import org.slf4j.Logger;
|
|
|
8
|
+import org.slf4j.LoggerFactory;
|
|
|
9
|
+import org.springframework.stereotype.Service;
|
|
|
10
|
+
|
|
|
11
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
12
|
+import java.net.URLDecoder;
|
|
|
13
|
+
|
|
|
14
|
+/**
|
|
|
15
|
+ * 汇川对接
|
|
|
16
|
+ * Created by zhengwen.ge on 2017/9/21.
|
|
|
17
|
+ */
|
|
|
18
|
+@Service("UnionServiceImpl_6")
|
|
|
19
|
+public class HuiChuanServiceImpl extends UnionServiceImpl implements IUnionService {
|
|
|
20
|
+
|
|
|
21
|
+ static Logger log = LoggerFactory.getLogger(HuiChuanServiceImpl.class);
|
|
|
22
|
+
|
|
|
23
|
+ public ClickUnionRequestBO clickHttpRequestTOBO(HttpServletRequest request, ClickUnionRequestBO bo){
|
|
|
24
|
+ bo = new ClickUnionRequestBO();
|
|
|
25
|
+ String idfa = request.getParameter("IDFA_SUM");
|
|
|
26
|
+ String imei = request.getParameter("IMEI_SUM");
|
|
|
27
|
+
|
|
|
28
|
+ bo.setIdfa(idfa);
|
|
|
29
|
+ bo.setImei(imei);
|
|
|
30
|
+
|
|
|
31
|
+ bo.setUnion_type(request.getParameter("UNION_TYPE"));
|
|
|
32
|
+ String callBackUrl = request.getParameter("CALLBACK_URL");
|
|
|
33
|
+ bo.setCallbackurl(callBackUrl);
|
|
|
34
|
+ log.info("HuiChuan request is {}",bo);
|
|
|
35
|
+ return bo;
|
|
|
36
|
+ }
|
|
|
37
|
+
|
|
|
38
|
+ @Override
|
|
|
39
|
+ public String getCallbackUrl(ClickUnionRequestBO clickBO, ActivateUnionRequestBO activateUnionRequestBO) {
|
|
|
40
|
+ try{
|
|
|
41
|
+ if(null!=clickBO.getCallbackurl()){
|
|
|
42
|
+ String url = URLDecoder.decode(clickBO.getCallbackurl(),"UTF-8");
|
|
|
43
|
+ return url;
|
|
|
44
|
+ }
|
|
|
45
|
+ }catch (Exception e){
|
|
|
46
|
+ log.warn("getCallbackUrl exception is {}",e.getMessage());
|
|
|
47
|
+ }
|
|
|
48
|
+ return null;
|
|
|
49
|
+ }
|
|
|
50
|
+} |