|
@@ -3,19 +3,19 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONArray;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
+import com.google.common.base.Function;
|
|
|
import com.hrsk.cloud.eg.client.dto.plan.command.PlanCmd;
|
|
|
import com.hrsk.cloud.eg.client.dto.user.command.UserBaseInfoCmd;
|
|
|
import com.hrsk.cloud.eg.client.vo.DataVo;
|
|
|
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
|
|
|
import com.hrsk.cloud.eg.domain.api.channel.customized.common.ServerCodeEnums;
|
|
|
import com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.LoanDockingApi;
|
|
|
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequest;
|
|
|
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiRequestConfig;
|
|
|
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
|
|
|
import com.hrsk.cloud.eg.domain.common.HessianUtils;
|
|
|
-import com.hrsk.cloud.eg.infrastructure.config.client.HessianUtils;
|
|
|
-import com.hrsk.cloud.eg.infrastructure.loanMannager.threedocking.LoanDockingApi;
|
|
|
-import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
|
|
|
-import com.hrsk.cloud.eg.infrastructure.utils.Md5Util;
|
|
|
import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
|
|
|
|
|
|
+import com.hrsk.cloud.eg.domain.common.Md5Util;
|
|
|
import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -47,7 +47,7 @@ public class FuZhouBeiJiuCreditService implements LoanDockingApi {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo) {
|
|
|
+ public DataVo qualityCheck(UserBaseInfoCmd userInfo, PlanCmd product, EgLoanApiConfigInfoCmd configInfo, Function<HttpApiRequest, HttpApiResponse> httpClientFunc) {
|
|
|
try {
|
|
|
log.info("credit FuZhouBeiJiuCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
|
|
|
|
|
@@ -63,9 +63,10 @@ public class FuZhouBeiJiuCreditService implements LoanDockingApi {
|
|
|
put("data", jsonArray);
|
|
|
}};
|
|
|
log.info("credit qualityCheck FuZhouBeiJiuCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, json);
|
|
|
- String response = null;
|
|
|
- try {
|
|
|
- response = httpRestTemplate.restTemplate().postForObject(url, json, String.class);
|
|
|
+ HttpApiResponse response = null;
|
|
|
+ try{
|
|
|
+ HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(JSON.toJSONString(json),"post",url));
|
|
|
+ response =httpClientFunc.apply(request);
|
|
|
} catch (Exception e) {
|
|
|
log.error("福州北久准入异常,异常信息:{}", e.getMessage(), e);
|
|
|
}
|
|
@@ -73,7 +74,7 @@ public class FuZhouBeiJiuCreditService implements LoanDockingApi {
|
|
|
if (response == null) {
|
|
|
return DataVo.timeout(product.getPlanId(), product.getPlanName());
|
|
|
}
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(response);
|
|
|
+ JSONObject jsonObject=JSONObject.parseObject(response.getData().toString());
|
|
|
if (jsonObject == null) {
|
|
|
return DataVo.timeout(product.getPlanId(), product.getPlanName());
|
|
|
}
|