| | |
| | | private Map<String, String> buildRequestHeaders(LocalDateTime startTime) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("x-hcsb-serviceno", "IS044056"); |
| | | // header.put("x-hcsb-serviceno", "IS002347"); |
| | | // header.put("x-hcsb-serviceno", "IS044056"); |
| | | header.put("x-hcsb-serviceno", "IS002347"); |
| | | header.put("x-hcsb-version", "2.0"); |
| | | header.put("x-hcsb-sourcesyscode", "14"); |
| | | header.put("x-hcsb-token", "ArGE2JnHtxG/Zx5nrnGY4eOfMUJGGJokAJHigG1BrCY="); |
| | |
| | | // 校验data字段是否为JsonObject |
| | | JsonElement dataElement = jsonObject.get("data"); |
| | | if (dataElement == null || !dataElement.isJsonObject()) { |
| | | log.warn("【parseResponseData】响应数据中data字段为空或非对象类型,原始数据:{}", result); |
| | | log.info("【parseResponseData】响应数据中data字段为空或非对象类型,原始数据:{}", result); |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | JsonObject dataObject = dataElement.getAsJsonObject(); |
| | | JsonElement resultElement = dataObject.get("result"); |
| | | if (resultElement == null || !resultElement.isJsonArray()) { |
| | | log.warn("【parseResponseData】响应数据中result字段为空或非数组类型,原始数据:{}", result); |
| | | log.info("【parseResponseData】响应数据中result字段为空或非数组类型,原始数据:{}", result); |
| | | return new ArrayList<>(); |
| | | } |
| | | |