一、@RestController相当于是@Controller + @ResponseBody
二、使用@RestController注解时 返回内容示例 使用@Controller注解时返回试图页面
三、在一个方法中如果你是要返回一个视图页面,使用@Controller注解即刻
四、在一个方法中要返回一段内容示例,则可以使用@RestController注解或者使用@Controller注解 然后再具体方法上使用@ResponseBody注解
@RequestMapping("orderCheck")
public @ResponseBody JSONObject orderCheck(@RequestBody OrderParam orderParam ) throws InterruptedException {
JSONObject obj = new JSONObject();
obj.put(" params ",orderParam);
return orderService.orderCheck(obj);
}