From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期三, 27 五月 2020 09:59:29 +0800 Subject: [PATCH] merage --- src/main/java/com/highdatas/mdm/util/RuleClient.java | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/highdatas/mdm/util/RuleClient.java b/src/main/java/com/highdatas/mdm/util/RuleClient.java index 16e61e5..513ac4e 100644 --- a/src/main/java/com/highdatas/mdm/util/RuleClient.java +++ b/src/main/java/com/highdatas/mdm/util/RuleClient.java @@ -14,7 +14,6 @@ import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.stereotype.Component; -import org.springframework.util.MultiValueMap; import org.springframework.util.StringUtils; import org.springframework.web.client.RestTemplate; @@ -40,11 +39,10 @@ public HashMap<String,Boolean> execuImmeForCollect(String tableName,String userId) { //TODO String url = this.url + prefix + "execuImmeForCollect"; - HashMap<String, Object> params = new HashMap<>(); + HashMap<String, String> params = new HashMap<>(); params.put("tableName",tableName); - params.put("createUserId",userId); - String urlParamsByMap = HttpUtils.getUrlParamsByMap(params); - String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, null, urlParamsByMap, null); + params.put("createUserId",tableName); + String s = HttpRestClient(url, HttpMethod.POST, params, null, null); JSONObject result = (JSONObject) JSON.parse(s); String sucess = result.getString(Constant.Success); JSONObject dataObject = result.getJSONObject(Constant.Data); @@ -80,7 +78,7 @@ params.put("tableName",tableName); params.put("pageNum",pageNo.toString()); params.put("pageSize",pageSize.toString()); - String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, params, null, null); + String s = HttpRestClient(url, HttpMethod.POST, params, null, null); JSONObject result = (JSONObject) JSON.parse(s); String sucess = result.getString(Constant.Success); if (StringUtils.isEmpty(sucess) || !Boolean.valueOf(sucess)) { @@ -96,7 +94,7 @@ params.put("tableName",tableName); params.put("isTemp",isTemp); - String s = HttpUtils.HttpRestClient(url, HttpMethod.POST, params,null, MediaType.APPLICATION_JSON); + String s = HttpRestClient(url, HttpMethod.POST, params,null, MediaType.APPLICATION_JSON); JSONObject result = (JSONObject) JSON.parse(s); boolean sucess = result.getBoolean(Constant.Success); if (!sucess) { @@ -122,7 +120,7 @@ } - public String HttpRestClient(String url, HttpMethod method, MultiValueMap<String, String> formParams, String getParams, MediaType mediaType) { + public String HttpRestClient(String url, HttpMethod method, HashMap<String, String> formParams, String getParams, MediaType mediaType) { if (!StringUtils.isEmpty(getParams)) { url = url + Constant.QUESTION + getParams; } @@ -138,7 +136,7 @@ headers.setContentType(mediaType); } - HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(formParams, headers); + HttpEntity<HashMap<String, String>> requestEntity = new HttpEntity<HashMap<String, String>>(formParams, headers); // 鎵цHTTP璇锋眰 ResponseEntity<String> response = client.exchange(url, method, requestEntity, String.class); -- Gitblit v1.8.0