Skip to content

Commit d9a25d7

Browse files
committed
feat(be): yml, build.gradle 환경 변수(#49)
1 parent a8a8baf commit d9a25d7

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

build.gradle.kts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,39 @@ ktlint {
117117
buildConfig {
118118
useKotlinOutput()
119119

120+
val areaCodes =
121+
file("src/main/resources/area-codes.yml")
122+
.readText()
123+
.substringAfter("codes:")
124+
.lines()
125+
.filter { it.contains(":") }
126+
.joinToString(", ") { line ->
127+
val parts = line.split(":")
128+
"${parts[0].trim()}: ${parts[1].trim().replace("\"", "")}"
129+
}
130+
131+
val sigunguCodes =
132+
file("src/main/resources/sigungu-codes.yml")
133+
.readText()
134+
.substringAfter("codes:")
135+
.lines()
136+
.filter { it.contains(":") }
137+
.joinToString(", ") { line ->
138+
val parts = line.split(":")
139+
"${parts[0].trim()}: ${parts[1].trim().replace("\"", "")}"
140+
}
141+
142+
val contentTypeCodes =
143+
file("src/main/resources/content-type-id.yml")
144+
.readText()
145+
.substringAfter("codes:")
146+
.lines()
147+
.filter { it.contains(":") }
148+
.joinToString(", ") { line ->
149+
val parts = line.split(":")
150+
"${parts[0].trim()}: ${parts[1].trim().replace("\"", "")}"
151+
}
152+
120153
val regionCodes =
121154
file("src/main/resources/region-codes.yml")
122155
.readText()
@@ -140,6 +173,9 @@ buildConfig {
140173
.substringAfter("ai-fallback: \"")
141174
.substringBefore("\"")
142175

176+
buildConfigField("String", "AREA_CODES_DESCRIPTION", "\"\"\"$areaCodes\"\"\"")
177+
buildConfigField("String", "SIGUNGU_CODES_DESCRIPTION", "\"\"\"$sigunguCodes\"\"\"")
178+
buildConfigField("String", "CONTENT_TYPE_CODES_DESCRIPTION", "\"\"\"$contentTypeCodes\"\"\"")
143179
buildConfigField("String", "REGION_CODES_DESCRIPTION", "\"\"\"$regionCodes\"\"\"")
144180
buildConfigField("String", "KOREA_TRAVEL_GUIDE_SYSTEM", "\"\"\"$systemPrompt\"\"\"")
145181
buildConfigField("String", "AI_ERROR_FALLBACK", "\"\"\"$errorPrompt\"\"\"")

src/main/resources/area-codes.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tour:
2+
area:
3+
codes:
4+
서울: "1"
5+
인천: "2"
6+
대전: "3"
7+
대구: "4"
8+
광주: "5"
9+
부산: "6"
10+
울산: "7"
11+
세종특별자치시: "8"
12+
경기도: "31"
13+
강원특별자치도: "32"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tour:
2+
content-type-id:
3+
codes:
4+
관광지: "12"
5+
문화시설: "14"
6+
축제공연행사: "15"
7+
여행코스: "25"
8+
레포츠: "28"
9+
숙박: "32"
10+
쇼핑: "38"
11+
음식점: "39"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tour:
2+
sigungu:
3+
codes:
4+
강남구: "1"
5+
강동구: "2"
6+
강북구: "3"
7+
강서구: "4"
8+
관악구: "5"
9+
광진구: "6"
10+
구로구: "7"
11+
금천구: "8"
12+
노원구: "9"
13+
도봉구: "10"

0 commit comments

Comments
 (0)