|
|
@ -39,30 +39,33 @@ public class CityGridApiImpl implements CityGridApi { |
|
|
|
response = HttpRequest.post(httpUrl).body(data) |
|
|
|
.header("lan", "zh") |
|
|
|
.header("Content-type", "application/json").execute(); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
LOGGER.error(interFaceName + "信息异常:" + e.getMessage()); |
|
|
|
} |
|
|
|
LOGGER.info(interFaceName + "返回数据:" + response.body()); |
|
|
|
|
|
|
|
JSONObject res = JSONObject.parseObject(response.body()); |
|
|
|
SendEventResultDto result = null; |
|
|
|
if (0 == Integer.parseInt(res.get("code").toString())) { |
|
|
|
// try {
|
|
|
|
// result = (SendEventResultDto) JSONObject.toJavaObject((JSONObject) res.get("data"), SendEventResultDto.class);
|
|
|
|
// result.setCode("0");
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// LOGGER.error(interFaceName + "返回结果处理错误:" + e.getMessage());
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// try {
|
|
|
|
// result = (SendEventResultDto) JSONObject.toJavaObject(res, SendEventResultDto.class);
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// LOGGER.error(interFaceName + "返回结果处理错误:" + e.getMessage());
|
|
|
|
// }
|
|
|
|
// try {
|
|
|
|
// result = (SendEventResultDto) JSONObject.toJavaObject((JSONObject) res.get("data"), SendEventResultDto.class);
|
|
|
|
// result.setCode("0");
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// LOGGER.error(interFaceName + "返回结果处理错误:" + e.getMessage());
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// try {
|
|
|
|
// result = (SendEventResultDto) JSONObject.toJavaObject(res, SendEventResultDto.class);
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// LOGGER.error(interFaceName + "返回结果处理错误:" + e.getMessage());
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
LOGGER.error(interFaceName + "信息异常:" + e.getMessage()); |
|
|
|
SendEventResultDto dto = new SendEventResultDto(); |
|
|
|
dto.setCode("-1"); |
|
|
|
dto.setMessage(null == response?"调用接口失败":response.body()); |
|
|
|
return JSONObject.toJSONString(dto); |
|
|
|
} |
|
|
|
|
|
|
|
return response.body(); |
|
|
|
} |
|
|
|
|
|
|
|