Bladeren bron

update check

GITZYY 1 week geleden
bovenliggende
commit
0b617f4db3

+ 26 - 0
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/api/executor/ApiServiceImpl.java

@@ -0,0 +1,26 @@
+package com.hrsk.cloud.eg.app.api.executor;
+
+import com.hrsk.cloud.eg.client.api.ApiService;
+import com.hrsk.cloud.eg.client.dto.cmd.ApiInvokeCmd;
+import com.hrsk.pangu.dto.SingleResponse;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @author zhangyy
+ * @version 1.0
+ * @description: ApiServiceImpl
+ * @date 2024/11/16 10:06
+ */
+@Service
+public class ApiServiceImpl implements ApiService {
+
+    @Resource
+    private ApiInvokeCmdExe apiInvokeCmdExe;
+
+    @Override
+    public SingleResponse<String> invoke(ApiInvokeCmd apiInvokeCmd) {
+        return SingleResponse.of(apiInvokeCmdExe.execute(apiInvokeCmd));
+    }
+}

+ 3 - 2
egress-gateway-service-infrastructure/src/main/java/com/hrsk/cloud/eg/infrastructure/gatewayimpl/ApiGatewayImpl.java

@@ -1,11 +1,12 @@
 package com.hrsk.cloud.eg.infrastructure.gatewayimpl;
 
 import com.google.gson.JsonElement;
-import com.hrsk.cloud.eg.client.api.ApiService;
 import com.hrsk.cloud.eg.client.dto.cmd.ApiInvokeCmd;
 import com.hrsk.cloud.eg.domain.api.Api;
 import com.hrsk.cloud.eg.domain.api.ApiFactory;
 import com.hrsk.cloud.eg.domain.api.ApiGateway;
+import com.hrsk.cloud.eg.domain.api.channel.guide.http.HttpApiResponse;
+import com.hrsk.cloud.eg.domain.common.GsonUtils;
 import com.hrsk.cloud.eg.infrastructure.client.http.HttpClient;
 import com.hrsk.cloud.eg.infrastructure.repository.database.dao.EgressApiChannelDao;
 import com.hrsk.cloud.eg.infrastructure.repository.database.entity.EgressApiChannelDo;
@@ -14,7 +15,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
-
+import com.hrsk.cloud.eg.domain.api.channel.guide.common.EgressApiErrorCodeEnum;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.stream.Collectors;

+ 2 - 0
egress-gateway-service-infrastructure/src/main/java/com/hrsk/cloud/eg/infrastructure/repository/database/dao/EgressApiChannelDao.java

@@ -3,6 +3,7 @@ package com.hrsk.cloud.eg.infrastructure.repository.database.dao;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.hrsk.cloud.eg.infrastructure.repository.database.entity.EgressApiChannelDo;
 
+
 /**
  * @author: bianlanzhou
  * @create: 2024-09-06 14:51
@@ -11,3 +12,4 @@ import com.hrsk.cloud.eg.infrastructure.repository.database.entity.EgressApiChan
 public interface EgressApiChannelDao extends BaseMapper<EgressApiChannelDo> {
 
 }
+