@PathVariable
//接收请求URL中占位符的值
@GetMapping("/getId/{id}")//{id}写在请求URL中,参数来源于URL中,所以@PathVariable可以多个
//单个入参时id可不写,多个入参需要写
public String pathVariable(@PathVariable("id") Integer id) {
}
@RequestParam
//将URL的请求参数绑定到控制器的方法参数上
@GetMapping("/getId")//例:getId?id=0001,参数来源于URL中,所以@RequestParam可以多个
//单个入参时id可不写,甚至@RequestParam("id")都可不写,多个入参需要写全
public String requestParam(@RequestParam("id") Integer id) {
}