kongdeqiang
2024-12-04 80cacfd0dcee0174f2a8d9ae322a2fcf857cef63
src/main/java/com/boying/util/HTTPEntityUtil.java
@@ -38,6 +38,28 @@
        return httpEntity;
    }
    //map类型使用
    public static HttpEntity setEntity2(Map<String, Object> map) {
        HttpHeaders headers = new HttpHeaders();
       // headers.setContentType(MediaType.parseMediaType("application/json; charset=UTF-8"));
        headers.add("Tenant-Id","1");
        headers.add("isToken","false");
        headers.add("Authorization","Basic YXBwOmFwcA==");
        ReturnData returnData = new ReturnData();
        try {
            if (map != null) {
                HttpEntity<Map<String, Object>> httpEntity = new
                        HttpEntity<>(map, headers);
                return httpEntity;
            }
        } catch (Exception e) {
            returnData.setCode(-1);
            returnData.setMsg("系统内部出错!FASP-HESSIAN-1001: 请求 网关出现异常!");
        }
        HttpEntity<String> httpEntity = new HttpEntity<>(headers);
        return httpEntity;
    }
    //list类型使用
    public static HttpEntity setEntityForList(List<Map<String, Object>> list){
        HttpHeaders headers = new HttpHeaders();