Skip to content

Commit

Permalink
✨ 검색 파라미터 검증 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
allbegray committed Mar 30, 2023
1 parent df6e88e commit 77e72de
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = 'herbaccara'
version = '0.0.6'
version = '0.0.7'
sourceCompatibility = '1.8'

publishing {
Expand Down
20 changes: 10 additions & 10 deletions src/main/kotlin/herbaccara/jusokr/JusoKrService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ class JusoKrService(
admCd: String,
rnMgtSn: String,
udrtYn: String,
buldMnnm: String,
buldSlno: String
buldMnnm: Int,
buldSlno: Int
): AddrCoordApiResult {
val url = "/addrlink/addrCoordApi.do"

val endpoint = UriComponentsBuilder
.fromHttpUrl("${properties.rootUri}$url")
.queryParam("confmKey", properties.coordConfmKey)
.queryParam("admCd", admCd)
.queryParam("rnMgtSn", rnMgtSn)
.queryParam("udrtYn", udrtYn)
.queryParam("admCd", admCd.filter { it.isDigit() })
.queryParam("rnMgtSn", rnMgtSn.filter { it.isDigit() })
.queryParam("udrtYn", udrtYn.filter { it.isDigit() })
.queryParam("buldMnnm", buldMnnm)
.queryParam("buldSlno", buldSlno)
.queryParam("resultType", "json")
Expand All @@ -105,8 +105,8 @@ class JusoKrService(
admCd: String,
rnMgtSn: String,
udrtYn: String,
buldMnnm: String,
buldSlno: String,
buldMnnm: Int,
buldSlno: Int,
searchType: SearchType? = null,
dongNm: String? = null
): AddrDetailApiResult {
Expand All @@ -115,9 +115,9 @@ class JusoKrService(
val endpoint = UriComponentsBuilder
.fromHttpUrl("${properties.rootUri}$url")
.queryParam("confmKey", properties.detailConfmKey)
.queryParam("admCd", admCd)
.queryParam("rnMgtSn", rnMgtSn)
.queryParam("udrtYn", udrtYn)
.queryParam("admCd", admCd.filter { it.isDigit() })
.queryParam("rnMgtSn", rnMgtSn.filter { it.isDigit() })
.queryParam("udrtYn", udrtYn.filter { it.isDigit() })
.queryParam("buldMnnm", buldMnnm)
.queryParam("buldSlno", buldSlno)
.apply {
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/herbaccara/jusokr/model/AddrCoordApiResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ data class AddrCoordApiResult(
val rnMgtSn: String,
val bdMgtSn: String,
val udrtYn: String,
val buldMnnm: String,
val buldSlno: String,
val buldMnnm: Int,
val buldSlno: Int,
val entX: String,
val entY: String,
val bdNm: String
Expand Down
12 changes: 7 additions & 5 deletions src/main/kotlin/herbaccara/jusokr/model/AddrDetailApiResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ data class AddrDetailApiResult(
) : ApiResult<Juso> {

data class Juso(
val buldMnnm: String,
val rnMgtSn: String,
val dongNm: String,
val admCd: String,
val buldSlno: String,
val udrtYn: String
val rnMgtSn: String,
val udrtYn: String,
val buldMnnm: Int,
val buldSlno: Int,
val dongNm: String?,
val floorNm: String?,
val hoNm: String?
)
}
26 changes: 13 additions & 13 deletions src/main/kotlin/herbaccara/jusokr/model/AddrEngApiResult.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ data class AddrEngApiResult(
) : ApiResult<Juso> {

data class Juso(
val zipNo: String,
val emdNm: String,
val rn: String,
val roadAddr: String,
val jibunAddr: String,
val siNm: String,
val sggNm: String,
val zipNo: String,
val admCd: String,
val udrtYn: String,
val lnbrMnnm: String,
val roadAddr: String,
val korAddr: String,
val lnbrSlno: String,
val buldMnnm: String,
val bdKdcd: String,
val rnMgtSn: String,
val bdKdcd: String,
val siNm: String,
val sggNm: String,
val emdNm: String,
val liNm: String,
val rn: String,
val udrtYn: String,
val buldMnnm: Int,
val buldSlno: Int,
val mtYn: String,
val buldSlno: String
val lnbrMnnm: Int,
val lnbrSlno: Int,
val korAddr: String
)
}

0 comments on commit 77e72de

Please sign in to comment.