java 控制器代码
@RequestMapping(value = "/list",method = RequestMethod.POST)
@ResponseBody
public Page<?> list(@RequestBody Map<String, Object> params) {
return baseOldmanService.listBaseOldman(params);
}
postman 分两步设置:
1.首先在headers中,设置Content-Type为applicationon/json
设置contentType2.然后在body中,选择raw,写入json数据
raw里设置json后台接收参数为单个参数
@RequestMapping("/info")
public R getById(@RequestBody Long id) {
return liveXcxCoursesService.getLiveXcxCoursesById(id);
}
网友评论