Przeglądaj źródła

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

huangzhiyong 8 lat temu
rodzic
commit
70710da8b3

+ 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);
                }