diff --git a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/util/HttpUtil.java b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/util/HttpUtil.java index 33fa823..d09256a 100644 --- a/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/util/HttpUtil.java +++ b/module-building-pictures/src/main/java/cn/com/tenlion/buildingpictures/util/HttpUtil.java @@ -26,31 +26,31 @@ public class HttpUtil { * @return */ public static String sendGet(String url) { - HttpGet httpget = new HttpGet(url); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httpget); - } catch (IOException e1) { - e1.printStackTrace(); - } - String result = null; - try { - HttpEntity entity = response.getEntity(); - if (entity != null) { - result = EntityUtils.toString(entity); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - response.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return result; + HttpGet httpget = new HttpGet(url); + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpget); + } catch (IOException e1) { + e1.printStackTrace(); + } + String result = null; + try { + HttpEntity entity = response.getEntity(); + if (entity != null) { + result = EntityUtils.toString(entity); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return result; } - + /** * 发送HttpPost请求,参数为map * @param url @@ -58,49 +58,49 @@ public class HttpUtil { * @return */ public static String sendPost(String url, Map map) { - List formparams = new ArrayList(); - for (Map.Entry entry : map.entrySet()) { - formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); - } - UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, Consts.UTF_8); - HttpPost httppost = new HttpPost(url); - httppost.setEntity(entity); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity1 = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity1); - } catch (Exception e) { - e.printStackTrace(); - } - return result; + List formparams = new ArrayList(); + for (Map.Entry entry : map.entrySet()) { + formparams.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); + } + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, Consts.UTF_8); + HttpPost httppost = new HttpPost(url); + httppost.setEntity(entity); + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httppost); + } catch (IOException e) { + e.printStackTrace(); + } + HttpEntity entity1 = response.getEntity(); + String result = null; + try { + result = EntityUtils.toString(entity1); + } catch (Exception e) { + e.printStackTrace(); + } + return result; } - + /** * 发送不带参数的HttpPost请求 * @param url * @return */ public static String sendPost(String url) { - HttpPost httppost = new HttpPost(url); - CloseableHttpResponse response = null; - try { - response = httpclient.execute(httppost); - } catch (IOException e) { - e.printStackTrace(); - } - HttpEntity entity = response.getEntity(); - String result = null; - try { - result = EntityUtils.toString(entity); - } catch (Exception e) { - e.printStackTrace(); - } - return result; + HttpPost httppost = new HttpPost(url); + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httppost); + } catch (IOException e) { + e.printStackTrace(); + } + HttpEntity entity = response.getEntity(); + String result = null; + try { + result = EntityUtils.toString(entity); + } catch (Exception e) { + e.printStackTrace(); + } + return result; } } \ No newline at end of file diff --git a/module-config-table/src/main/java/cn/com/tenlion/configtable/controller/route/configtable/ConfigTableRouteController.java b/module-config-table/src/main/java/cn/com/tenlion/configtable/controller/route/configtable/ConfigTableRouteController.java index a1f8b8f..638a7d3 100644 --- a/module-config-table/src/main/java/cn/com/tenlion/configtable/controller/route/configtable/ConfigTableRouteController.java +++ b/module-config-table/src/main/java/cn/com/tenlion/configtable/controller/route/configtable/ConfigTableRouteController.java @@ -44,4 +44,11 @@ public class ConfigTableRouteController extends DefaultBaseController { return new ModelAndView("configtable/list-field"); } + + + @GetMapping("input-field") + public ModelAndView inputField() { + return new ModelAndView("configtable/input-field"); + } + } \ No newline at end of file diff --git a/module-config-table/src/main/resources/templates/configtable/list-field.html b/module-config-table/src/main/resources/templates/configtable/list-field.html index a051543..82b82fc 100644 --- a/module-config-table/src/main/resources/templates/configtable/list-field.html +++ b/module-config-table/src/main/resources/templates/configtable/list-field.html @@ -128,6 +128,7 @@ + @@ -259,6 +260,31 @@