From 77d9e02e49d3ae342d2a406c798cc2971cda7494 Mon Sep 17 00:00:00 2001 From: Ok JaeOok Date: Sun, 28 Jan 2024 01:58:51 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20TourAPI=20=EA=B0=80=EA=B3=B5=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=20=EB=B6=80=EB=AC=B8=20=EA=B2=80=EC=A6=9D=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `+` 식별자로 사용되는 키 값들 중 하나라도 없으면 건너뜀 아래의 수행에서만 유효함: - 인접장소 목록 - 검색 결과 --- .../openapi/tourapi/tools/DomainConverter.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/openapi/src/main/java/fc/be/openapi/tourapi/tools/DomainConverter.java b/openapi/src/main/java/fc/be/openapi/tourapi/tools/DomainConverter.java index 3efc7b73..6e2de876 100644 --- a/openapi/src/main/java/fc/be/openapi/tourapi/tools/DomainConverter.java +++ b/openapi/src/main/java/fc/be/openapi/tourapi/tools/DomainConverter.java @@ -70,6 +70,10 @@ public List fromAreaBasedSyncList( List result = new ArrayList<>(); for (var item : items) { + if (checkIdentifierCodesInvalid(item.contentid(), item.contenttypeid(), item.areacode(), item.sigungucode())) { + continue; + } + int itemContentTypeId = contentTypeId == 0 ? Integer.parseInt(item.contenttypeid()) : contentTypeId; var itemClass = convertPlaceToChildDomain(itemContentTypeId); result.add(generateAndCastItem(item, areaBasedSyncMapper::generate, itemClass)); @@ -106,6 +110,10 @@ public List fromSearchKeywordList( List result = new ArrayList<>(); for (var item : items) { + if (checkIdentifierCodesInvalid(item.contentid(), item.contenttypeid(), item.areacode(), item.sigungucode())) { + continue; + } + int itemContentTypeId = contentTypeId == 0 ? Integer.parseInt(item.contenttypeid()) : contentTypeId; if (ContentTypeId.contains(itemContentTypeId)) { var itemClass = convertPlaceToChildDomain(itemContentTypeId); @@ -129,5 +137,14 @@ private T generateAndCastItem(U item, Function generator, Cl } } + private boolean checkIdentifierCodesInvalid(String... values) { + for (var value : values) { + if (value == null || value.isBlank()) { + return true; + } + } + + return false; + } }