@RequestMapping(value="add", method=RequestMethod.POST)
//@ResponseBody这个去掉,返回类型如下
@MethodLog("添加用户")
public ResponseEntity<String> add(HttpServletRequest reuqest, User user) throws Exception {
HttpHeaders responseHeaders = new HttpHeaders();
responseHeaders.setContentType(MediaType.TEXT_HTML);
try {
return new ResponseEntity<String>(String.valueOf(userService.insert(user)), responseHeaders, HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}