From 08e585ca5ed2e56f1391e1939aeb141485a1df81 Mon Sep 17 00:00:00 2001 From: Kim-Dong-Jun99 Date: Mon, 19 Feb 2024 22:45:33 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Refactor=20:=20json=20=ED=8C=8C=EC=8B=B1=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .http/OpenApi.http | 2 +- .../tenten/tentenbe/global/component/OpenApiComponent.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.http/OpenApi.http b/.http/OpenApi.http index 3a0ff69..22b8a5a 100644 --- a/.http/OpenApi.http +++ b/.http/OpenApi.http @@ -23,7 +23,7 @@ GET https://apis.data.go.kr/B551011/KorService1/categoryCode1?serviceKey={{open- ### 지역기반 관광 정보 조회 GET https://apis.data.go.kr/B551011/KorService1/areaBasedList1?serviceKey={{open-api-key}}&_type=json&MobileOS=ETC&MobileApp=TestApp&listYN=Y - &contentTypeId=39 + &contentTypeId=12 &numOfRows=20 &pageNo=1 diff --git a/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java b/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java index de1c131..ecd0ffa 100644 --- a/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java +++ b/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java @@ -91,10 +91,10 @@ public List getTourItems(Long contentTypeId, Long page, Long size) { Long areaCode = null; Long subAreaCode = null; Long contentId = null; - if (!(item.get("areaCode") == null) && !item.get("areaCode").isEmpty()) { + if (!(item.get("areacode") == null) && !item.get("areacode").isEmpty()) { areaCode = Long.parseLong(item.get("areaCode")); } - if (!(item.get("sigunguCode") == null) && !item.get("sigunguCode").isEmpty()) { + if (!(item.get("sigungucode") == null) && !item.get("sigungucode").isEmpty()) { subAreaCode = Long.parseLong(item.get("sigunguCode")); } if (item.get("contentid") == null || item.get("contentid").isEmpty()) { From bcb85e5c97afa54a64f7beb3303997a0c23dd1a7 Mon Sep 17 00:00:00 2001 From: Kim-Dong-Jun99 Date: Mon, 19 Feb 2024 22:52:37 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Refactor=20:=20json=20=ED=8C=8C=EC=8B=B1=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenten/tentenbe/global/component/OpenApiComponent.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java b/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java index ecd0ffa..e98d0d4 100644 --- a/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java +++ b/src/main/java/org/tenten/tentenbe/global/component/OpenApiComponent.java @@ -92,10 +92,10 @@ public List getTourItems(Long contentTypeId, Long page, Long size) { Long subAreaCode = null; Long contentId = null; if (!(item.get("areacode") == null) && !item.get("areacode").isEmpty()) { - areaCode = Long.parseLong(item.get("areaCode")); + areaCode = Long.parseLong(item.get("areacode")); } if (!(item.get("sigungucode") == null) && !item.get("sigungucode").isEmpty()) { - subAreaCode = Long.parseLong(item.get("sigunguCode")); + subAreaCode = Long.parseLong(item.get("sigungucode")); } if (item.get("contentid") == null || item.get("contentid").isEmpty()) { continue;