Closed jun108059 closed 2 weeks ago
Sample code
@GetMapping("/api/reststop/foods")
fun getRestBestFoods() = runBlocking {
val allRestBestFoods = restBestFoodService.fetchAllPages()
allRestBestFoods.forEach { response ->
response.list.forEach { restBestFood ->
println(restBestFood)
}
}
allRestBestFoods
}
suspend fun fetchReststopFood(pageNo: Int): ReststopFoodResponse {
return webClient.get()
.uri { builder ->
builder.path("/openapi/restinfo/restBestfoodList")
.queryParam("key", "secret")
.queryParam("type", "json")
.queryParam("numOfRows", "99")
.queryParam("pageNo", pageNo)
.build()
}
.retrieve()
.bodyToMono(ReststopFoodResponse::class.java)
.awaitSingle()
}
โ๐ป Description
๋ฐ๋๋ฝ ๋ฐ์ ๊ฐ๋ฅ์ฑ