@@ -0,0 +1,1767 @@
+package org.forest.executors.url;%0A%0Aimport org.forest.converter.json.ForestJsonConverter;%0Aimport org.forest.http.ForestRequest;%0Aimport org.forest.mapping.MappingTemplate;%0Aimport org.forest.utils.RequestNameValue;%0Aimport org.forest.utils.StringUtils;%0A%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.net.URLEncoder;%0Aimport java.util.List;%0A%0A/**%0A * @author gongjun%5Bjun.gong@thebeastshop.com%5D%0A * @since 2017-05-19 14:11%0A */%0Apublic class QueryableURLBuilder extends URLBuilder %7B%0A%0A    @Override%0A    public String buildUrl(ForestRequest request) %7B%0A        String url = request.getUrl();%0A        List%3CRequestNameValue%3E data = request.getDataNameValueList();%0A        StringBuilder paramBuilder = new StringBuilder();%0A        ForestJsonConverter jsonConverter = request.getConfiguration().getJsonCoverter();%0A        for (int i = 0; i %3C data.size(); i++) %7B%0A            RequestNameValue nameValue = data.get(i);%0A            paramBuilder.append(nameValue.getName());%0A            String value = MappingTemplate.getParameterValue(jsonConverter, nameValue.getValue());%0A            paramBuilder.append('=');%0A            if (StringUtils.isNotEmpty(value)) %7B%0A                String encodedValue = null;%0A                try %7B%0A                    encodedValue = URLEncoder.encode(value, %22UTF-8%22);%0A                %7D catch (UnsupportedEncodingException e) %7B%0A                %7D%0A                if (encodedValue != null) %7B%0A                    paramBuilder.append(encodedValue);%0A                %7D%0A            %7D%0A            if (i %3C data.size() - 1) %7B%0A                paramBuilder.append('&');%0A            %7D%0A        %7D%0A        String query = paramBuilder.toString();%0A        if (StringUtils.isNotEmpty(query)) %7B%0A            return url + %22?%22 + query;%0A        %7D%0A        return url;%0A    %7D%0A%0A%7D%0A

添加URL builder