|
@@ -0,0 +1,15 @@
|
|
1
|
+package hello;
|
|
2
|
+
|
|
3
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
4
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
5
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
6
|
+import org.springframework.web.bind.annotation.RestController;
|
|
7
|
+
|
|
8
|
+@RestController
|
|
9
|
+public class GreetingController {
|
|
10
|
+
|
|
11
|
+ @RequestMapping(method = RequestMethod.GET, value = "/greeting")
|
|
12
|
+ public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name){
|
|
13
|
+ return new Greeting(1, "Hello " + name);
|
|
14
|
+ }
|
|
15
|
+}
|