From d8d56668d036fb38ca298a49c2b30dad074636d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?hagjoon=28=EC=9D=B4=ED=95=99=EC=A4=80=29?= Date: Tue, 8 Nov 2022 14:13:39 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A0=EC=94=A8API=20-=20=EB=B9=84=ED=96=89?= =?UTF-8?q?=EA=B3=84=ED=9A=8D=EC=84=9C=20=EC=A1=B0=EA=B1=B4=EB=AC=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BasFlightController.java | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java b/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java index 1a48d00..e77f3d8 100644 --- a/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java +++ b/src/main/java/com/palnet/biz/api/bas/flight/controller/BasFlightController.java @@ -291,23 +291,22 @@ public class BasFlightController { sb.append(line); } - CtrTrnsLctnModel weatherResult = ctrTrnsLctnService.convertLatlonToAddress(rs.getNx2(),rs.getNy2()); - - log.info("weatherResult >>>> : {}", weatherResult); - - - String str = sb.toString(); - JSONParser parser = new JSONParser(); - JSONObject jsonObject = (JSONObject) parser.parse(str); - jsonObject.put("area1",weatherResult.getArea1()); - jsonObject.put("area2",weatherResult.getArea2()); - jsonObject.put("area3",weatherResult.getArea3()); - jsonObject.put("landNm",weatherResult.getLandNm()); - jsonObject.put("landNum",weatherResult.getLandNum()); -// CtrCntrlWeatherModel areaResult = new CtrCntrlWeatherModel(); -// areaResult.setArea1(weatherResult.getArea1()); -// areaResult.setArea2(weatherResult.getArea2()); -// areaResult.setArea3(weatherResult.getArea3()); + CtrTrnsLctnModel weatherResult = ctrTrnsLctnService.convertLatlonToAddress(rs.getNx2(),rs.getNy2()); + log.info("weatherResult >>>> : {}", weatherResult); + + + String str = sb.toString(); + JSONParser parser = new JSONParser(); + JSONObject jsonObject = (JSONObject) parser.parse(str); + if(weatherResult != null) { + jsonObject.put("area1",weatherResult.getArea1()); + jsonObject.put("area2",weatherResult.getArea2()); + jsonObject.put("area3",weatherResult.getArea3()); + jsonObject.put("landNm",weatherResult.getLandNm()); + jsonObject.put("landNum",weatherResult.getLandNum()); + } + + rd.close(); conn.disconnect(); log.info(sb.toString());