package cn.bunny.mvc.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RequestMapping("userRest")
@RestController
public class UseRestController {

    @GetMapping("page/test")
    public ModelAndView test() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("test/test");
        modelAndView.addObject("message", "这是消息内容");
        return modelAndView;
    }

    @GetMapping("page/test2")
    public ModelAndView test2(ModelAndView modelAndView) {
        modelAndView.addObject("hello", "你好");
        modelAndView.setViewName("test/test2");
        return modelAndView;
    }
}
