Skip to content

Commit 0d4d32f

Browse files
authored
feat(be) : 언어 별 mock 데이터 추가(#139) (#140)
1 parent 9f00930 commit 0d4d32f

File tree

3 files changed

+94
-1
lines changed

3 files changed

+94
-1
lines changed

src/main/kotlin/com/back/koreaTravelGuide/domain/ai/aiChat/tool/TourTool.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,21 @@ class TourTool(
146146
"관광정보 상세조회를 가져올 수 없습니다."
147147
}
148148
}
149+
150+
/**
151+
* 1
152+
* fetchTours - 지역기반 관광정보 조회
153+
* 케이스 : 부산광역시 사하구에 있는 관광지 조회
154+
* "areacode": "6" 부산
155+
* "sigungucode": "10" 사하구
156+
* "contenttypeid": "76" 관광지 (해외)
157+
* "serviceSegment" : "EngService2" (영어)
158+
*
159+
*
160+
* 2
161+
* fetchTourDetail - 상세조회
162+
* 케이스 : 콘텐츠ID가 "264247인 관광정보의 "상베 정보" 조회
163+
* "contentid": "264247,
164+
* "serviceSegment" : "EngService2" (영어)
165+
*/
149166
}

src/main/kotlin/com/back/koreaTravelGuide/domain/ai/tour/service/core/TourAreaBasedServiceCore.kt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,19 @@ class TourAreaBasedServiceCore(
2222
tourParams: TourParams,
2323
serviceSegment: String,
2424
): TourResponse {
25+
// 부산 사하구 관광안내소(콘텐츠타입 76, EngService2)에 대한 프리셋 응답
2526
if (
27+
serviceSegment == ENGLISH_SERVICE_SEGMENT &&
28+
tourParams.contentTypeId == "76" &&
29+
tourParams.areaCode == "6" &&
30+
tourParams.sigunguCode == "10"
31+
) {
32+
return PRESET_AREA_TOUR_RESPONSE_AMISAN
33+
}
34+
35+
// 부산 사하구 관광지 목록(콘텐츠타입 12, KorService2)에 대한 프리셋 응답
36+
if (
37+
serviceSegment == KOREAN_SERVICE_SEGMENT &&
2638
tourParams.contentTypeId == "12" &&
2739
tourParams.areaCode == "6" &&
2840
tourParams.sigunguCode == "10"
@@ -34,6 +46,37 @@ class TourAreaBasedServiceCore(
3446
}
3547

3648
private companion object {
49+
private const val ENGLISH_SERVICE_SEGMENT = "EngService2"
50+
private const val KOREAN_SERVICE_SEGMENT = "KorService2"
51+
private const val JAPANESE_SERVICE_SEGMENT = "JpnService2"
52+
53+
// 아미산 전망대 관광지 안내 프리셋, 영어 호출
54+
val PRESET_AREA_TOUR_RESPONSE_AMISAN =
55+
TourResponse(
56+
items =
57+
listOf(
58+
TourItem(
59+
contentId = "2947925",
60+
contentTypeId = "76",
61+
createdTime = "20221209105240",
62+
modifiedTime = "20230206164719",
63+
title = "Amisan Observatory (아미산 전망대)",
64+
addr1 = "77 , Dadaenakjo 2-gil, Saha-gu, Busan",
65+
areaCode = "6",
66+
firstimage = null,
67+
firstimage2 = null,
68+
mapX = "128.9607725966",
69+
mapY = "35.0528020123",
70+
distance = null,
71+
mlevel = "6",
72+
sigunguCode = "10",
73+
lDongRegnCd = "26",
74+
lDongSignguCd = "380",
75+
),
76+
),
77+
)
78+
79+
// 을숙도 공원 관광지 안내 프리셋, 한국어 호출
3780
val PRESET_AREA_TOUR_RESPONSE =
3881
TourResponse(
3982
items =

src/main/kotlin/com/back/koreaTravelGuide/domain/ai/tour/service/core/TourDetailServiceCore.kt

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,47 @@ class TourDetailServiceCore(
2121
detailParams: TourDetailParams,
2222
serviceSegment: String,
2323
): TourDetailResponse {
24-
if (detailParams.contentId == "127974") {
24+
// 을숙도 철새공원 상세정보(EngService2, contentId 264247) 프리셋
25+
if (serviceSegment == ENGLISH_SERVICE_SEGMENT && detailParams.contentId == "264247") {
26+
return PRESET_DETAIL_RESPONSE_EN
27+
}
28+
29+
// 동촌유원지 상세정보(KorService2, contentId 127974) 프리셋
30+
if (serviceSegment == KOREAN_SERVICE_SEGMENT && detailParams.contentId == "127974") {
2531
return PRESET_DETAIL_RESPONSE
2632
}
2733

2834
return tourApiClient.fetchTourDetail(detailParams, serviceSegment)
2935
}
3036

3137
private companion object {
38+
private const val ENGLISH_SERVICE_SEGMENT = "EngService2"
39+
private const val KOREAN_SERVICE_SEGMENT = "KorService2"
40+
41+
// 을숙도 철새공원 상세정보 영어 프리셋
42+
val PRESET_DETAIL_RESPONSE_EN =
43+
TourDetailResponse(
44+
items =
45+
listOf(
46+
TourDetailItem(
47+
contentId = "264247",
48+
title = "Eulsukdo Migratory Bird Park (을숙도 철새공원)",
49+
overview =
50+
"Eulsukdo Migratory Bird Park, designated as Natural Monument No. 179," +
51+
"is located in the lower part of Elsukdo Island. " +
52+
"Renovated in 2009, the park is the central area for migratory bird habitats and ecology tourism. " +
53+
"In winter, migratory birds can be seen at the wetlands.",
54+
addr1 = "1240, Nakdongnam-ro, Saha-gu, Busan",
55+
mapX = "128.9353792487",
56+
mapY = "35.0937941809",
57+
firstImage = "http://tong.visitkorea.or.kr/cms/resource/66/2487966_image2_1.JPG",
58+
tel = "+82-51-209-2031",
59+
homepage = """<a href="http://www.busan.go.kr/wetland/index" target="_blank">www.busan.go.kr</a>""",
60+
),
61+
),
62+
)
63+
64+
// 동촌유원지 상세정보 한국어 프리셋
3265
val PRESET_DETAIL_RESPONSE =
3366
TourDetailResponse(
3467
items =

0 commit comments

Comments
 (0)