Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
[Fix] TourAPI 가공 처리 부문 검증 로직 추가
Browse files Browse the repository at this point in the history
`+` 식별자로 사용되는 키 값들 중 하나라도 없으면 건너뜀

아래의 수행에서만 유효함:
- 인접장소 목록
- 검색 결과
  • Loading branch information
laigasus committed Jan 27, 2024
1 parent 634f420 commit 77d9e02
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public List<PlaceDTO> fromAreaBasedSyncList(
List<PlaceDTO> 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));
Expand Down Expand Up @@ -106,6 +110,10 @@ public List<PlaceDTO> fromSearchKeywordList(
List<PlaceDTO> 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);
Expand All @@ -129,5 +137,14 @@ private <T, U> T generateAndCastItem(U item, Function<U, PlaceDTO> generator, Cl
}
}

private boolean checkIdentifierCodesInvalid(String... values) {
for (var value : values) {
if (value == null || value.isBlank()) {
return true;
}
}

return false;
}

}

0 comments on commit 77d9e02

Please sign in to comment.