From 1aacaae4a3aacfe6d215f4ebf23818536a6b45a6 Mon Sep 17 00:00:00 2001 From: kid1412621 <26278054+kid1412621@users.noreply.github.com> Date: Mon, 7 Oct 2019 19:09:40 +0800 Subject: [PATCH] implements kotlin language feature --- .../kotlin/org/jetbrains/kotlin/demo/GreetingController.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/spring-boot-restful/src/main/kotlin/org/jetbrains/kotlin/demo/GreetingController.kt b/tutorials/spring-boot-restful/src/main/kotlin/org/jetbrains/kotlin/demo/GreetingController.kt index 30428eb4ab..a350a8a330 100644 --- a/tutorials/spring-boot-restful/src/main/kotlin/org/jetbrains/kotlin/demo/GreetingController.kt +++ b/tutorials/spring-boot-restful/src/main/kotlin/org/jetbrains/kotlin/demo/GreetingController.kt @@ -11,7 +11,7 @@ class GreetingController { val counter = AtomicLong() @GetMapping("/greeting") - fun greeting(@RequestParam(value = "name", defaultValue = "World") name: String) = - Greeting(counter.incrementAndGet(), "Hello, $name") + fun greeting(@RequestParam name: String?) = + Greeting(counter.incrementAndGet(), "Hello, ${name ?: "World"}") -} \ No newline at end of file +}