@RequestMapping is used at the class level while @GetMapping is used to connect the methods. This is also an important Spring MVC interview question to knowing how and when to use both RequestMapping and GetMapping is crucial for Java developers.
https://javarevisited.blogspot.com/2021/10/difference-between-requestmapping-and..html#axzz7pqSZXhhc