getmapping跟requestmappring

When I was working on a project recently, I found the @GetMapping annotation. I didn’t find the annotation in the lower version I learned at that time. So I checked the source code and found that a new series of path annotations were added after springboot4.3. As follows:
@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping
these annotations to simplify the mapping of the corresponding HTTP method.
Insert picture description here
Taking @GetMapping as an example, it is actually a new combined annotation, which is
the abbreviation of @RequestMapping(method = RequestMethod.GET)

Other annotations can be deduced by analogy.

Guess you like

Origin blog.csdn.net/weixin_43158695/article/details/104583611