Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,21 @@ class TourTool(
"관광정보 상세조회를 가져올 수 없습니다."
}
}

/**
* 1
* fetchTours - 지역기반 관광정보 조회
* 케이스 : 부산광역시 사하구에 있는 관광지 조회
* "areacode": "6" 부산
* "sigungucode": "10" 사하구
* "contenttypeid": "76" 관광지 (해외)
* "serviceSegment" : "EngService2" (영어)
*
*
* 2
* fetchTourDetail - 상세조회
* 케이스 : 콘텐츠ID가 "264247인 관광정보의 "상베 정보" 조회
* "contentid": "264247,
* "serviceSegment" : "EngService2" (영어)
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,19 @@ class TourAreaBasedServiceCore(
tourParams: TourParams,
serviceSegment: String,
): TourResponse {
// 부산 사하구 관광안내소(콘텐츠타입 76, EngService2)에 대한 프리셋 응답
if (
serviceSegment == ENGLISH_SERVICE_SEGMENT &&
tourParams.contentTypeId == "76" &&
tourParams.areaCode == "6" &&
tourParams.sigunguCode == "10"
) {
return PRESET_AREA_TOUR_RESPONSE_AMISAN
}

// 부산 사하구 관광지 목록(콘텐츠타입 12, KorService2)에 대한 프리셋 응답
if (
serviceSegment == KOREAN_SERVICE_SEGMENT &&
tourParams.contentTypeId == "12" &&
tourParams.areaCode == "6" &&
tourParams.sigunguCode == "10"
Expand All @@ -34,6 +46,37 @@ class TourAreaBasedServiceCore(
}

private companion object {
private const val ENGLISH_SERVICE_SEGMENT = "EngService2"
private const val KOREAN_SERVICE_SEGMENT = "KorService2"
private const val JAPANESE_SERVICE_SEGMENT = "JpnService2"

// 아미산 전망대 관광지 안내 프리셋, 영어 호출
val PRESET_AREA_TOUR_RESPONSE_AMISAN =
TourResponse(
items =
listOf(
TourItem(
contentId = "2947925",
contentTypeId = "76",
createdTime = "20221209105240",
modifiedTime = "20230206164719",
title = "Amisan Observatory (아미산 전망대)",
addr1 = "77 , Dadaenakjo 2-gil, Saha-gu, Busan",
areaCode = "6",
firstimage = null,
firstimage2 = null,
mapX = "128.9607725966",
mapY = "35.0528020123",
distance = null,
mlevel = "6",
sigunguCode = "10",
lDongRegnCd = "26",
lDongSignguCd = "380",
),
),
)

// 을숙도 공원 관광지 안내 프리셋, 한국어 호출
val PRESET_AREA_TOUR_RESPONSE =
TourResponse(
items =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,47 @@ class TourDetailServiceCore(
detailParams: TourDetailParams,
serviceSegment: String,
): TourDetailResponse {
if (detailParams.contentId == "127974") {
// 을숙도 철새공원 상세정보(EngService2, contentId 264247) 프리셋
if (serviceSegment == ENGLISH_SERVICE_SEGMENT && detailParams.contentId == "264247") {
return PRESET_DETAIL_RESPONSE_EN
}

// 동촌유원지 상세정보(KorService2, contentId 127974) 프리셋
if (serviceSegment == KOREAN_SERVICE_SEGMENT && detailParams.contentId == "127974") {
return PRESET_DETAIL_RESPONSE
}

return tourApiClient.fetchTourDetail(detailParams, serviceSegment)
}

private companion object {
private const val ENGLISH_SERVICE_SEGMENT = "EngService2"
private const val KOREAN_SERVICE_SEGMENT = "KorService2"

// 을숙도 철새공원 상세정보 영어 프리셋
val PRESET_DETAIL_RESPONSE_EN =
TourDetailResponse(
items =
listOf(
TourDetailItem(
contentId = "264247",
title = "Eulsukdo Migratory Bird Park (을숙도 철새공원)",
overview =
"Eulsukdo Migratory Bird Park, designated as Natural Monument No. 179," +
"is located in the lower part of Elsukdo Island. " +
"Renovated in 2009, the park is the central area for migratory bird habitats and ecology tourism. " +
"In winter, migratory birds can be seen at the wetlands.",
addr1 = "1240, Nakdongnam-ro, Saha-gu, Busan",
mapX = "128.9353792487",
mapY = "35.0937941809",
firstImage = "http://tong.visitkorea.or.kr/cms/resource/66/2487966_image2_1.JPG",
tel = "+82-51-209-2031",
homepage = """<a href="http://www.busan.go.kr/wetland/index" target="_blank">www.busan.go.kr</a>""",
),
),
)

// 동촌유원지 상세정보 한국어 프리셋
val PRESET_DETAIL_RESPONSE =
TourDetailResponse(
items =
Expand Down