Spring 会将{id:id}这个json转换成Map对象,只要将@requestBody中的参数改成Map就可以了,如下
@RequestMapping(value="/delete",method=RequestMethod.POST,produces="application/json")标签:lang,Map,java,deserialize,map,json,Integer,id,delete From: https://blog.51cto.com/u_2650279/6142616
@ResponseStatus(HttpStatus.OK)
public void delete(@RequestBody Map map){
this.moduleService.deleteModule(Integer.parseInt(map.get("id")+""));
}