Match each request with the appropriate handler
1.
Java
@PutMapping("/customers/{id}")
public void first(@PathVariable long id, @RequestParam String name) {
customerMap.put(id, name);
}
Kotlin
@PutMapping("/customers/{id}")
fun first(@PathVariable id: Long, @RequestParam name: String?) {
customerMap[id] = name
}
2.
Java
@PutMapping("/movies/{id}")
public void second(@PathVariable long id) {
movieMap.put(id, 1);
}
Kotlin
@PutMapping("/movies/{id}")
fun second(@PathVariable id: Long) {
movieMap[id] = 1
}
3.
Java
@PostMapping("/customers")
public void third(@RequestParam long id, @RequestParam String name) {
customerMap.put(id, name);
}
Kotlin
@PostMapping("/customers")
fun third(@RequestParam id: Long, @RequestParam name: String?) {
customerMap[id] = name
}