• @GetMapping是一个组合注解,是@RequestMapping(method = RequestMethod.GET)的缩写。该注解将HTTP Get 映射到特定的处理方法上。
  • 同理PostMapping也是一个组合注解,是@RequestMapping(method = RequestMethod.POST)的缩写

@PostMapping,@GetMapping最主要的区别是

@PostMapping一般处理对象的findUser

@GetMapping一般处理单个id,比如findbyId

@PutMapper一般用在编辑,也可以只用上面两种