|
@@ -1,10 +1,14 @@
|
1
|
1
|
package com.yingying.tourist.web;
|
2
|
2
|
|
3
|
3
|
import com.yingying.tourist.result.MessageResult;
|
|
4
|
+import org.springframework.stereotype.Controller;
|
4
|
5
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
6
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
5
|
7
|
import org.springframework.web.bind.annotation.RestController;
|
6
|
8
|
|
7
|
|
-@RestController
|
|
9
|
+import java.util.Map;
|
|
10
|
+
|
|
11
|
+@Controller
|
8
|
12
|
public class TestController {
|
9
|
13
|
|
10
|
14
|
@GetMapping(value = {"/",""})
|
|
@@ -16,4 +20,10 @@ public class TestController {
|
16
|
20
|
public MessageResult<String> helloWorld(){
|
17
|
21
|
return new MessageResult<String>().ok("hello,world");
|
18
|
22
|
}
|
|
23
|
+
|
|
24
|
+ @RequestMapping("/index")
|
|
25
|
+ public String index(Map<String, Object> map){
|
|
26
|
+ map.put("user", "YeLuoFengXing");
|
|
27
|
+ return "index";
|
|
28
|
+ }
|
19
|
29
|
}
|