diff --git a/piikii-output-web/avocado/src/main/kotlin/com/piikii/output/web/avocado/adapter/AvocadoPlaceInfoResponse.kt b/piikii-output-web/avocado/src/main/kotlin/com/piikii/output/web/avocado/adapter/AvocadoPlaceInfoResponse.kt index 189bddfb..c4af0346 100644 --- a/piikii-output-web/avocado/src/main/kotlin/com/piikii/output/web/avocado/adapter/AvocadoPlaceInfoResponse.kt +++ b/piikii-output-web/avocado/src/main/kotlin/com/piikii/output/web/avocado/adapter/AvocadoPlaceInfoResponse.kt @@ -20,6 +20,7 @@ data class AvocadoPlaceInfoResponse( val businessType: String?, val category: String?, val microReview: String?, + val businessHours: String?, val buttons: Buttons, @JsonProperty("x") val longitude: Double?, @@ -40,6 +41,7 @@ data class AvocadoPlaceInfoResponse( latitude = latitude, reviewCount = visitorReviewCount ?: 0, category = category, + openingHours = businessHours, origin = Origin.AVOCADO, ) } diff --git a/piikii-output-web/lemon/src/main/kotlin/com/piikii/output/web/lemon/adapter/LemonPlaceInfoResponse.kt b/piikii-output-web/lemon/src/main/kotlin/com/piikii/output/web/lemon/adapter/LemonPlaceInfoResponse.kt index 538ad514..06a7286d 100644 --- a/piikii-output-web/lemon/src/main/kotlin/com/piikii/output/web/lemon/adapter/LemonPlaceInfoResponse.kt +++ b/piikii-output-web/lemon/src/main/kotlin/com/piikii/output/web/lemon/adapter/LemonPlaceInfoResponse.kt @@ -32,6 +32,7 @@ data class LemonPlaceInfoResponse( latitude = basicInfo.latitude, reviewCount = basicInfo.feedback.countOfBlogReview, category = basicInfo.category.firstCategoryName, + openingHours = basicInfo.openHour.toPrintFormat(), origin = Origin.LEMON, ) } @@ -106,13 +107,33 @@ data class LemonPlaceInfoResponse( @JsonIgnoreProperties(ignoreUnknown = true) data class OpenHour( val periodList: List?, - ) + val offdayList: List?, + ) { + fun toPrintFormat(): String? { + val openingHour = periodList + ?.first { it.periodName == OPEN_HOUR_PERIOD_NAME } + ?.toPrintFormat() + val offdaySchedule = offdayList + ?.map { it.toPrintFormat() } + ?.joinToString { JOINER } + return "$openingHour$JOINER$offdaySchedule" + } + + companion object { + const val OPEN_HOUR_PERIOD_NAME = "영업기간" + const val JOINER = "\n" + } + } @JsonIgnoreProperties(ignoreUnknown = true) data class Period( val periodName: String, val timeList: List