I have two methods @GetMapping and @GetMapping("/{id}")
@RestController("/user"){
public class UserRestController {
@GetMapping
public ResponseData get() {
...........
return responseData;
}
@GetMapping("/{id}")
public ResponseData getUser(@PathParam("id") Long id) {
ResponseData responseData = new ResponseData();
...........
return responseData;
}
When I hit a URL http://localhost:8080/user I took I @GetMapping("/{id}") method
because it takes id null, how can I solve this issue?