Browse Source

add 获取bean

GITZYY 4 months ago
parent
commit
1ff4e514e5

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

@@ -17,6 +17,7 @@ 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.springframework.stereotype.Service;
 
 import java.time.Instant;
 import java.util.*;

+ 1 - 0
egress-gateway-service-infrastructure/src/main/java/com/hrsk/cloud/eg/infrastructure/client/http/RetryRestTemplate.java

@@ -35,6 +35,7 @@ import java.util.List;
  */
 @Configuration
 public class RetryRestTemplate {
+
     private RetryRequestConfig requestConfig = new RetryRequestConfig();
 
     public RetryRestTemplate(RetryRequestConfig requestConfig) {

+ 1 - 0
egress-gateway-service-infrastructure/src/main/java/com/hrsk/cloud/eg/infrastructure/service/impl/EgApiServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.hrsk.cloud.eg.client.constant.GlobalDataStatusEnum;
 import com.hrsk.cloud.eg.domain.common.GsonUtils;
+import com.hrsk.cloud.eg.domain.common.HessianUtils;
 import com.hrsk.cloud.eg.infrastructure.repository.database.dao.EgressApiChannelDao;
 import com.hrsk.cloud.eg.infrastructure.repository.database.dao.EgressApiDao;
 import com.hrsk.cloud.eg.infrastructure.repository.database.entity.*;

+ 148 - 155
start/src/test/java/GenerateConfigTest.java

@@ -1,15 +1,8 @@
-import com.alibaba.fastjson2.JSONObject;
 import com.hrsk.cloud.eg.Application;
-import com.hrsk.cloud.eg.app.loan.executor.GenerateCheckIntoHttpApiConfigCmdExe;
-import com.hrsk.cloud.eg.app.loan.executor.GenerateCheckIntoHttpApiConfigV2CmdExe;
-import com.hrsk.cloud.eg.utils.SpringGetBeanUtils;
-import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import javax.annotation.Resource;
-import java.util.List;
 
 /**
  * @author zhangyy
@@ -20,154 +13,154 @@ import java.util.List;
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = Application.class)
 public class GenerateConfigTest {
-
-    @Resource
-    private GenerateCheckIntoHttpApiConfigCmdExe generateCHeckIntoHttpApiConfigCmdExe;
-
-    @Resource
-    private ProductBusinessApiInfoService productBusinessApiInfoService;
-
-    @Resource
-    private GenerateCheckIntoHttpApiConfigV2CmdExe generateCheckIntoHttpApiConfigV2CmdExe;
-
-    @Resource
-    private SpringGetBeanUtils springGetBeanUtils;
-
-    @Test
-    public void createHuiRonApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("9");
-        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
-        generateCHeckIntoHttpApiConfigCmdExe.generateHuiRonHuiRonApiConfig(jsonString);
-    }
-
-    @Test
-    public void createOpenApiRsaTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("1");
-        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
-        generateCHeckIntoHttpApiConfigCmdExe.generateOpenApiRSAConfig(jsonString);
-    }
-
-
-    @Test
-    public void createQinYuApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("4");
-//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-        generateCHeckIntoHttpApiConfigCmdExe.generateQinYuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createJinDieApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("5");
-//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-        generateCHeckIntoHttpApiConfigCmdExe.generateJinDieConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createXinLuApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("7");
-        generateCHeckIntoHttpApiConfigCmdExe.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createXkdApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("10");
-        generateCHeckIntoHttpApiConfigCmdExe.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createRxkApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("6");
-        generateCHeckIntoHttpApiConfigCmdExe.generateRxkConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHuiZhonApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huizhong");
-        generateCHeckIntoHttpApiConfigCmdExe.generateHuiZhongConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createYinHuaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YinHua");
-        generateCHeckIntoHttpApiConfigCmdExe.generateYinHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHuiXinApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huixin");
-        generateCHeckIntoHttpApiConfigCmdExe.generateHuixinConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createYuKuaiHuaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YuKuaiHua");
-        generateCHeckIntoHttpApiConfigCmdExe.generateYuKuaiHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createYinJieHuaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YiJie");
-        generateCHeckIntoHttpApiConfigCmdExe.generateYinJieConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createYouRonApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Yourong");
-        generateCHeckIntoHttpApiConfigCmdExe.generateYouRonConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHamiguaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Hamigua");
-        generateCHeckIntoHttpApiConfigCmdExe.generateHamiguaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHaohanwuyinApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Haohanwuyin");
-        generateCHeckIntoHttpApiConfigCmdExe.generateHaohanwuyinConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createGexinjinfuApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Gexinjinfu");
-        generateCheckIntoHttpApiConfigV2CmdExe.generateGexinjinfuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createKuaiyidaiApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Kuaiyidai");
-        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createKuaiyidaiNightApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiNight");
-        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createKuaiyidaiFourToOneApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiFourToOne");
-        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createKuaiyidaiV2ApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiV2");
-        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void getBean(){
-
-    }
+//
+//    @Resource
+//    private GenerateCheckIntoHttpApiConfigCmdExe generateCHeckIntoHttpApiConfigCmdExe;
+//
+//    @Resource
+//    private ProductBusinessApiInfoService productBusinessApiInfoService;
+//
+//    @Resource
+//    private GenerateCheckIntoHttpApiConfigV2CmdExe generateCheckIntoHttpApiConfigV2CmdExe;
+//
+//    @Resource
+//    private SpringGetBeanUtils springGetBeanUtils;
+//
+//    @Test
+//    public void createHuiRonApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("9");
+//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
+//        generateCHeckIntoHttpApiConfigCmdExe.generateHuiRonHuiRonApiConfig(jsonString);
+//    }
+//
+//    @Test
+//    public void createOpenApiRsaTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("1");
+//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
+//        generateCHeckIntoHttpApiConfigCmdExe.generateOpenApiRSAConfig(jsonString);
+//    }
+//
+//
+//    @Test
+//    public void createQinYuApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("4");
+////        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//        generateCHeckIntoHttpApiConfigCmdExe.generateQinYuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createJinDieApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("5");
+////        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//        generateCHeckIntoHttpApiConfigCmdExe.generateJinDieConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createXinLuApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("7");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createXkdApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("10");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createRxkApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("6");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateRxkConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createHuiZhonApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huizhong");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateHuiZhongConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createYinHuaApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YinHua");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateYinHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createHuiXinApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huixin");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateHuixinConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createYuKuaiHuaApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YuKuaiHua");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateYuKuaiHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createYinJieHuaApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YiJie");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateYinJieConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createYouRonApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Yourong");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateYouRonConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createHamiguaApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Hamigua");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateHamiguaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createHaohanwuyinApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Haohanwuyin");
+//        generateCHeckIntoHttpApiConfigCmdExe.generateHaohanwuyinConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createGexinjinfuApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Gexinjinfu");
+//        generateCheckIntoHttpApiConfigV2CmdExe.generateGexinjinfuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createKuaiyidaiApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Kuaiyidai");
+//        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createKuaiyidaiNightApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiNight");
+//        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void createKuaiyidaiFourToOneApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiFourToOne");
+//        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//
+//    @Test
+//    public void createKuaiyidaiV2ApiTest(){
+//        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("KuaiyidaiV2");
+//        generateCheckIntoHttpApiConfigV2CmdExe.generateKuaiyidaiConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+//    }
+//
+//    @Test
+//    public void getBean(){
+//
+//    }
 }
 
 

+ 4 - 4
start/src/test/java/RedisTest.java

@@ -6,7 +6,9 @@
  */
 
 import com.hrsk.cloud.eg.Application;
+import com.hrsk.cloud.eg.domain.api.channel.customized.LoanManagerService;
 import com.hrsk.cloud.eg.infrastructure.utils.RedisUtil;
+import com.hrsk.pangu.domain.DomainFactory;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -38,10 +40,8 @@ public class RedisTest {
 
     @Test
     public void getRedisUtil(){
-        System.out.println(redisUtil.get("key1"));
-        String key = String.format(BUSINESS_API_KEY, 1);
-        Object value = redisUtil.get(key);
-        System.out.println(value);
+        LoanManagerService loanManagerService = DomainFactory.create(LoanManagerService.class);
+        System.out.println(loanManagerService);
     }
 }
 

+ 0 - 3
start/src/test/java/StartApiTest.java

@@ -1,6 +1,5 @@
 import com.hrsk.cloud.eg.Application;
 import com.hrsk.cloud.eg.domain.api.ApiGateway;
-import com.hrsk.cloud.eg.app.loan.executor.GenerateCheckIntoHttpApiConfigCmdExe;
 import com.hrsk.cloud.eg.infrastructure.service.EgApiChannelService;
 import com.hrsk.cloud.eg.infrastructure.service.EgApiLoanExtendService;
 import com.hrsk.cloud.eg.infrastructure.service.EgApiService;
@@ -28,8 +27,6 @@ import java.util.Map;
 @SpringBootTest(classes = Application.class)
 public class StartApiTest {
 
-    @Resource
-    private GenerateCheckIntoHttpApiConfigCmdExe generateCHeckIntoHttpApiConfigCmdExe;
 
 
     @Resource