spring boot 2.* 参数接收

测试环境:spring boot 2.1.0
/*
//数组和参数同时传递需要借助实体类实现
//接收json
@RequestMapping(value = "test3",method = RequestMethod.POST)
public String test3(@RequestBody String obj){
System.out.println(obj);
return "1";
}
//接收数组
@RequestMapping(value = "test2",method = RequestMethod.POST)
public String test2(String[] obj){
System.out.println(obj);
return "1";
}
//接收指定参数
@RequestMapping(value = "test1",method = RequestMethod.POST)
public String test1(String id){
System.out.println(id);
return "1";
}*/
posted @ 2018-11-16 11:20  vip95595  阅读(203)  评论(0编辑  收藏  举报