diff --git a/app/src/main/java/fc/be/app/domain/member/controller/dto/response/MyPlacesResponse.java b/app/src/main/java/fc/be/app/domain/member/controller/dto/response/MyPlacesResponse.java index 7d0e8db0..20cb2f7b 100644 --- a/app/src/main/java/fc/be/app/domain/member/controller/dto/response/MyPlacesResponse.java +++ b/app/src/main/java/fc/be/app/domain/member/controller/dto/response/MyPlacesResponse.java @@ -39,7 +39,7 @@ public record PlaceInfo( String phone, Integer areaCode, Integer sigunguCode, - Integer zipCode, + String zipCode, Double latitude, Double longitude ) { diff --git a/app/src/main/java/fc/be/app/domain/place/Location.java b/app/src/main/java/fc/be/app/domain/place/Location.java index 0dab2c2f..381abeee 100644 --- a/app/src/main/java/fc/be/app/domain/place/Location.java +++ b/app/src/main/java/fc/be/app/domain/place/Location.java @@ -26,7 +26,7 @@ public class Location { private Integer sigunguCode; @Comment("우편번호") - private Integer zipCode; + private String zipCode; @Comment("위도") private Double latitude; @@ -35,7 +35,7 @@ public class Location { private Double longitude; @Builder - public Location(String address, String addressDetail, String phone, Integer areaCode, Integer sigunguCode, Integer zipCode, Double latitude, Double longitude) { + public Location(String address, String addressDetail, String phone, Integer areaCode, Integer sigunguCode, String zipCode, Double latitude, Double longitude) { this.address = address; this.addressDetail = addressDetail; this.phone = phone; diff --git a/app/src/main/java/fc/be/app/domain/place/dto/PlaceInfoGetResponse.java b/app/src/main/java/fc/be/app/domain/place/dto/PlaceInfoGetResponse.java index 801480b5..6db79cd2 100644 --- a/app/src/main/java/fc/be/app/domain/place/dto/PlaceInfoGetResponse.java +++ b/app/src/main/java/fc/be/app/domain/place/dto/PlaceInfoGetResponse.java @@ -37,7 +37,7 @@ public ContentTypeId deserialize(JsonParser p, DeserializationContext ctxt) thro AccommodationDTO.class, Accommodation.class, FacilityDTO.class, Facility.class, FestivalDTO.class, Festival.class, - LeportsDTO.class, Festival.class, + LeportsDTO.class, Leports.class, RestaurantDTO.class, Restaurant.class, ShopDTO.class, Shop.class, SpotDTO.class, Spot.class diff --git a/app/src/test/java/fc/be/app/domain/review/unit/ReviewFixture.java b/app/src/test/java/fc/be/app/domain/review/unit/ReviewFixture.java index 6bfdc28e..43c6f223 100644 --- a/app/src/test/java/fc/be/app/domain/review/unit/ReviewFixture.java +++ b/app/src/test/java/fc/be/app/domain/review/unit/ReviewFixture.java @@ -38,7 +38,7 @@ default Place restaurant() { .phone("") .areaCode(1) .sigunguCode(18) - .zipCode(5838) + .zipCode("5838") .latitude(37.4776672007) .longitude(127.1249768726) .build()) diff --git a/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/AreaBasedSyncMapper.java b/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/AreaBasedSyncMapper.java index 13d008d4..bcb462e2 100644 --- a/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/AreaBasedSyncMapper.java +++ b/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/AreaBasedSyncMapper.java @@ -23,7 +23,7 @@ public PlaceDTO generate(AreaBasedSyncList1Response.Item item) { .phone(item.tel()) .areaCode(Integer.parseInt(item.areacode())) .sigunguCode(Integer.parseInt(item.sigungucode())) - .zipCode(Integer.parseInt(item.zipcode())) + .zipCode(item.zipcode()) .latitude(Double.parseDouble(item.mapy())) .longitude(Double.parseDouble(item.mapx())) .build()) diff --git a/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/DetailCommonMapper.java b/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/DetailCommonMapper.java index f1fb8519..f6887e05 100644 --- a/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/DetailCommonMapper.java +++ b/openapi/src/main/java/fc/be/openapi/tourapi/dto/mapper/DetailCommonMapper.java @@ -25,7 +25,7 @@ public PlaceDTO generate(DetailCommon1Response.Item item) { .phone(item.tel()) .areaCode(Integer.parseInt(item.areacode())) .sigunguCode(Integer.parseInt(item.sigungucode())) - .zipCode(Integer.parseInt(item.zipcode())) + .zipCode(item.zipcode()) .latitude(Double.parseDouble(item.mapy())) .longitude(Double.parseDouble(item.mapx())) .build()) diff --git a/openapi/src/main/java/fc/be/openapi/tourapi/dto/response/bone/LocationDTO.java b/openapi/src/main/java/fc/be/openapi/tourapi/dto/response/bone/LocationDTO.java index 0ef2943c..4ef71141 100644 --- a/openapi/src/main/java/fc/be/openapi/tourapi/dto/response/bone/LocationDTO.java +++ b/openapi/src/main/java/fc/be/openapi/tourapi/dto/response/bone/LocationDTO.java @@ -15,7 +15,7 @@ public class LocationDTO { private String phone; private Integer areaCode; private Integer sigunguCode; - private Integer zipCode; + private String zipCode; private Double latitude; private Double longitude; } 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; + } }