|
|
|
@ -114,6 +114,18 @@ public class ABDownTask {
|
|
|
|
|
@Value("${ab.wxfans.secret}")
|
|
|
|
|
private String wxSecretKey;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 配置文件中加载配置信息 - 河小象
|
|
|
|
|
*/
|
|
|
|
|
@Value("${ab.hexx.appId}")
|
|
|
|
|
private String hexxAppId;
|
|
|
|
|
|
|
|
|
|
@Value("${ab.hexx.url}")
|
|
|
|
|
private String hexxUrl;
|
|
|
|
|
|
|
|
|
|
@Value("${ab.hexx.secretKey}")
|
|
|
|
|
private String hexxSecretKey;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 任务处理入口,主要用于时间记录
|
|
|
|
|
*
|
|
|
|
@ -504,8 +516,8 @@ public class ABDownTask {
|
|
|
|
|
// 补充其他的下游请求字段
|
|
|
|
|
long time = System.currentTimeMillis() / 1000;
|
|
|
|
|
heXXMessageCovDTO.setTimestamp(time);
|
|
|
|
|
heXXMessageCovDTO.setAppId(panDaAppId);
|
|
|
|
|
heXXMessageCovDTO.setSignature(SecureUtil.sha1("app_id="+ panDaAppId +"×tamp="+ time + "&secret=" + panDaSecretKey));
|
|
|
|
|
heXXMessageCovDTO.setAppId(hexxAppId);
|
|
|
|
|
heXXMessageCovDTO.setSignature(SecureUtil.sha1("app_id="+ hexxAppId +"×tamp="+ time + "&secret=" + hexxSecretKey));
|
|
|
|
|
// 数据实体转成Json 不忽略空kv 有序
|
|
|
|
|
String jsonStr = JSON.toJSONString(heXXMessageCovDTO);
|
|
|
|
|
log.info("========== [ready send json is {} ] =============", jsonStr);
|
|
|
|
@ -513,7 +525,7 @@ public class ABDownTask {
|
|
|
|
|
// todo 失败重发请求3次
|
|
|
|
|
while (count <= 3){
|
|
|
|
|
// 调用HTTP请求发送数据
|
|
|
|
|
HttpResponse httpResponse = sendPandaReq(jsonStr);
|
|
|
|
|
HttpResponse httpResponse = sendHXXReq(jsonStr);
|
|
|
|
|
if (httpResponse.isOk() && httpResponse.body().contains("success")){
|
|
|
|
|
log.info("========== [request success, response is {} ] ==========", httpResponse.body());
|
|
|
|
|
break;
|
|
|
|
@ -742,6 +754,20 @@ public class ABDownTask {
|
|
|
|
|
return httpResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 调用HTTP请求发送数据
|
|
|
|
|
*
|
|
|
|
|
* @param json 请求的body内容
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private HttpResponse sendHXXReq(String json){
|
|
|
|
|
HttpResponse httpResponse = HttpRequest
|
|
|
|
|
.post(hexxUrl)
|
|
|
|
|
.body(json)
|
|
|
|
|
.execute();
|
|
|
|
|
return httpResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 调用HTTP请求发送数据
|
|
|
|
|
*
|
|
|
|
|