Retrieving details for a specific Todo

We will now add the method to retrieve details for a specific Todo:

    @GetMapping(path = "/users/{name}/todos/{id}")
public Todo retrieveTodo(@PathVariable String name, @PathVariable
int id) {
return todoService.retrieveTodo(id);
}

A couple of things to note are as follows:

  • The URI mapped is /users/{name}/todos/{id}
  • We have two path variables defined for name and id
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset