- @RequestParam
当controller层要实现一个方法的时候,用的是@GetMapping(“params”),括号里是"params",后面就用@RequestParam
@GetMapping("params")
public ResponseEntity<List<SpecParam>> queryParams(@RequestParam("gid") Long gid) {
······
}
- @PathVariable
当controller层要实现一个方法的时候,用的是@DeleteMapping(“group/{id}”),括号里是"“group/{id}”,后面就用@PathVariable
@DeleteMapping("group/{id}")
public ResponseEntity<Void> delSpecGroup(@PathVariable("id") Long id){
······
}