Slide 40
Slide 40 text
Locations(※ݱࡏ·ͩexperimental)
• ύϥϝʔλΛλΠϓηʔϑʹѻ͑Δ
• Int, Long, Float, Double, Boolean, String, enum͕༻Մೳ
@Location("/users/{userId}")
data class UserLocation(val userId: Long)
fun Application.module() {
install(Locations)
install(Routing) {
get { param ->
// paramUserLocationܕʹͳΔͷͰɺuserIdΛͦͷ··LongܕͰऔಘͰ͖Δ
val userId = param.userId
}
}
}