123456789101112131415161718192021222324252627282930 |
- package com.yingying.tourist.web;
- import com.yingying.tourist.result.MessageResult;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.Map;
- @Controller
- public class TestController {
- @GetMapping(value = {"/",""})
- public MessageResult<String> home(){
- return new MessageResult<String>().ok("hello,home");
- }
- @GetMapping("hello")
- public MessageResult<String> helloWorld(){
- return new MessageResult<String>().ok("hello,world");
- }
- @RequestMapping("/index")
- public String index(Map<String, Object> map){
- map.put("user", "YeLuoFengXing");
- return "index";
- }
- }
|