postman 传多种类型参数
将Map或者List前面加上@RequestBody注解,将String,Integer前面加上@RequestParam注解即可
1. 参数是Map和String
@RequestMapping("/insertInfo")
@ResponseBody
public ResultCode insertInfo( @RequestBody Map<String,Object> map,
@RequestParam String table_name) {
}
在postman中,将基本类型写在Params栏中,将map写在Body栏中,如下图所示
1. 参数是List和String
public String addUserRole(@RequestParam("userId")Long userId,
@RequestBody List<Long> roleIdList)
在postman中,将基本类型写在Params栏中,将List写在Body栏中,如下图所示