管道基础大数据平台系统开发-【后端】-Server
12
13693261870
2022-11-21 07a68b8d93aa059968a9709f2c81e6625338032c
src/main/java/com/lf/server/helper/RestHelper.java
@@ -150,7 +150,7 @@
            return EntityUtils.toString(entity, StaticData.TEXT_ENCODER);
        } catch (Exception ex) {
            log.error(ex);
            log.error(ex.getMessage(), ex);
            return getErrorInfo(uri, ex);
        }
@@ -178,7 +178,7 @@
            return EntityUtils.toString(entity, StaticData.TEXT_ENCODER);
        } catch (Exception ex) {
            log.error(ex);
            log.error(ex.getMessage(), ex);
            return getErrorInfo(uri, ex);
        }
@@ -196,7 +196,7 @@
            return rest.getForObject(uri, String.class);
        } catch (Exception ex) {
            log.error(ex);
            log.error(ex.getMessage(), ex);
            return getErrorInfo(uri, ex);
        }
@@ -216,7 +216,19 @@
            return rest.postForObject(uri, entity, String.class);
        } catch (Exception ex) {
            log.error(ex);
            log.error(ex.getMessage(), ex);
            return getErrorInfo(uri, ex);
        }
    }
    public static String postForRest(String uri, Map<String, Object> map) {
        try {
            RestTemplate rest = getRestTemplate();
            return rest.postForObject(uri, map, String.class);
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
            return getErrorInfo(uri, ex);
        }