liutao hace 3 días
padre
commit
4b8991f750

+ 17 - 15
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ChongQingRuiShangXinCreditService.java

@@ -2,14 +2,19 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.base.Function;
 import com.hrsk.cloud.eg.client.dto.plan.command.EgLoanApiConfigInfoCmd;
 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.clinet.vo.DataVo;
-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.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.domain.common.Md5Util;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
@@ -31,11 +36,7 @@ import java.security.Key;
 @Service
 public class ChongQingRuiShangXinCreditService implements LoanDockingApi {
 
-    @Resource
-    private EgApiService egApiService;
 
-    @Resource
-    private RetryRestTemplate httpRestTemplate;
 
     @Override
     public ServerCodeEnums getType() {
@@ -85,10 +86,10 @@ public class ChongQingRuiShangXinCreditService implements LoanDockingApi {
     "iv": "18521959"
     }
      */
-    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 ChongQingRuiShangXinCreditService qualityCheck begin...userId:{}",userInfo.getUserId());
-          
+
             byte[] requestConfig = configInfo.getRequestConfig();
             Object deserialize = HessianUtils.deserialize(requestConfig);
             JSONObject config = JSONObject.parseObject(deserialize.toString());
@@ -99,9 +100,10 @@ public class ChongQingRuiShangXinCreditService implements LoanDockingApi {
             checkInfo.setAppid(config.getString("appid"));
             String url = config.getString("checkUrl");
             log.info("credit qualityCheck ChongQingRuiShangXinCreditService request userId:{}, url:{}, CheckInfo:{}",userInfo.getUserId(), url, checkInfo);
-            String response = null;
-            try{
-                response =httpRestTemplate.restTemplate().postForObject(url,checkInfo, String.class);
+            HttpApiResponse response = null;
+            try {
+                HttpApiRequest request=new HttpApiRequest(HttpApiRequestConfig.postRequest(JSON.toJSONString(checkInfo),"post",url));
+                response =httpClientFunc.apply(request);
             }catch (Exception e){
                 log.error("重庆睿双鑫准入异常,异常信息:{}", e.getMessage(), e);
             }
@@ -109,7 +111,7 @@ public class ChongQingRuiShangXinCreditService implements LoanDockingApi {
             if (response == null) {
                 return DataVo.timeout(product.getApiId(),product.getPlanName());
             }
-            JSONObject jsonObject=JSONObject.parseObject(response);
+            JSONObject jsonObject = JSONObject.parseObject(response.getData().toString());
             if (jsonObject == null) {
                 return DataVo.timeout(product.getApiId(),product.getPlanName());
             }

+ 1 - 9
egress-gateway-service-domain/src/main/java/com/hrsk/cloud/eg/domain/api/channel/customized/threedocking/impl/ShenYangHengXinCreditService.java

@@ -2,11 +2,7 @@ package com.hrsk.cloud.eg.domain.api.channel.customized.threedocking.impl;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.hrsk.cloud.eg.clinet.vo.DataVo;
-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 lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
@@ -31,11 +27,7 @@ import java.util.Map;
 @Service
 public class ShenYangHengXinCreditService implements LoanDockingApi {
 
-    @Resource
-    private EgApiService egApiService;
 
-    @Resource
-    private RetryRestTemplate httpRestTemplate;
 
     @Override
     public ServerCodeEnums getType() {