...
|
...
|
@@ -277,43 +277,6 @@ public class UnionServiceImpl implements IUnionService { |
|
|
|
|
|
|
|
|
|
|
|
// UnionTypeModel type =
|
|
|
// UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));
|
|
|
|
|
|
String url = click.getCallbackurl();
|
|
|
if (StringUtils.isNotEmpty(url)) {
|
|
|
try {
|
|
|
url = URLDecoder.decode(url, "UTF-8");
|
|
|
if (url.indexOf("?") > 0) {
|
|
|
url += "&identify_id=" + click.getIdentify_id();
|
|
|
} else {
|
|
|
url += "?identify_id=" + click.getIdentify_id();
|
|
|
}
|
|
|
|
|
|
// if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
|
|
// url += "&idfa=" + click.getIdfa();
|
|
|
// } else {
|
|
|
// url += "&imei=" + click.getImei();
|
|
|
// }
|
|
|
log.info("activateUnion in call url={}", url);
|
|
|
// 调用接口发送短信请求
|
|
|
// AsyncFuture<String> response = service.get("union.activate", url, null, String.class, null);
|
|
|
// String result = response.get();
|
|
|
|
|
|
|
|
|
//改成httpclient方式调用
|
|
|
|
|
|
Pair<Integer, String> pair = HttpUtils.httpGet(url);
|
|
|
log.info("activateUnion call union success url={}, and result={}", url, pair);
|
|
|
if (pair.getLeft() != 200) {
|
|
|
log.warn("callback error with request={}", request);
|
|
|
return new UnionResponse(204, "callback error");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("callback error with request={}", request, e);
|
|
|
return new UnionResponse(204, "callback error");
|
|
|
}
|
|
|
}
|
|
|
// 调用成功,更新数据库
|
|
|
UnionLogs logs = new UnionLogs();
|
|
|
logs.setAppId(click.getAppid());
|
...
|
...
|
@@ -354,6 +317,45 @@ public class UnionServiceImpl implements IUnionService { |
|
|
//打印15天的大数据日志
|
|
|
activeDingdang.info(j.toString());
|
|
|
|
|
|
|
|
|
// UnionTypeModel type =
|
|
|
// UnionConstant.unionTypeMap.get(Integer.parseInt(click.getUnion_type()));
|
|
|
|
|
|
String url = click.getCallbackurl();
|
|
|
if (StringUtils.isNotEmpty(url)) {
|
|
|
try {
|
|
|
url = URLDecoder.decode(url, "UTF-8");
|
|
|
if (url.indexOf("?") > 0) {
|
|
|
url += "&identify_id=" + click.getIdentify_id();
|
|
|
} else {
|
|
|
url += "?identify_id=" + click.getIdentify_id();
|
|
|
}
|
|
|
|
|
|
// if (ClientTypeEnum.IOS.getName().equals(request.getClient_type())) {
|
|
|
// url += "&idfa=" + click.getIdfa();
|
|
|
// } else {
|
|
|
// url += "&imei=" + click.getImei();
|
|
|
// }
|
|
|
log.info("activateUnion in call url={}", url);
|
|
|
// 调用接口发送短信请求
|
|
|
// AsyncFuture<String> response = service.get("union.activate", url, null, String.class, null);
|
|
|
// String result = response.get();
|
|
|
|
|
|
|
|
|
//改成httpclient方式调用
|
|
|
|
|
|
Pair<Integer, String> pair = HttpUtils.httpGet(url);
|
|
|
log.info("activateUnion call union success url={}, and result={}", url, pair);
|
|
|
if (pair.getLeft() != 200) {
|
|
|
log.warn("callback error with request={}", request);
|
|
|
return new UnionResponse(204, "callback error");
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("callback error with request={}", request, e);
|
|
|
//return new UnionResponse(204, "callback error");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
log.info("activateUnion in success request is {}", request);
|
|
|
|
|
|
return new UnionResponse();
|
...
|
...
|
|