@RequestMapping("/test")
@ResponseBody
public AjaxJson test(@RequestBody JSONObject body){
AjaxJson json = new AjaxJson();
try {
if (body.containsKey("id") || body.containsKey("name") || body.containsKey("content")) {
String id = body.getString("id");
String name = body.getString("name");
String content = body.getString("content");
log.info("-----------------"+id+"----------"+name+"-----------"+content+"----------------------");
json.setMsg("请求成功");
json.setSuccess(true);
}else {
json.setSuccess(false);
json.setMsg("参数不合法");
}
}catch (Exception e){
json.setMsg(e.toString());
json.setSuccess(false);
e.printStackTrace();
}
return json;
}
