瀏覽代碼

Merge branch 'master' of http://192.168.1.220:10080/esb/esb

huangzhiyong 8 年之前
父節點
當前提交
70710da8b3
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      hos-camel2/src/main/java/camel/gateway/processor/GatewayProcessor.java

+ 9 - 3
hos-camel2/src/main/java/camel/gateway/processor/GatewayProcessor.java

@ -160,13 +160,19 @@ public class GatewayProcessor implements Processor {
                return "";
            }
            Map<String, String> methodMap = new HashMap<>();
            methodMap.put("0", "get");
            methodMap.put("1", "post");
            methodMap.put("2", "delete");
            methodMap.put("3", "put");
            JsonNode jsonNode = objectMapper.readValue(param, JsonNode.class);
            String host = appApi.getMicroServiceUri().split(",")[0];
            String endPoint = "restlet:http://" + host + appApi.getMethodName() + "restletMethods=" + appApi.getMethod();
            String url = appApi.getMicroServiceUri().split(",")[0];
            String endPoint = "restlet:" + url + appApi.getMsMethodName() + "restletMethods=" + methodMap.get(appApi.getMethod());
            final String[] body = {""};
            appApi.getParameters().forEach(p -> {
                String value = jsonNode.asText(p.getName());
                if (p.getType().equals("2")) { //path param
                if (p.getType().equals("0")) { //path param
                    endPoint.replace("{" + p.getName() + "}", value);
                }