Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created June 6, 2017 03:56
Show Gist options
  • Save gregturn/d3d17c3cd21e5d076e14e43944f824b3 to your computer and use it in GitHub Desktop.
Save gregturn/d3d17c3cd21e5d076e14e43944f824b3 to your computer and use it in GitHub Desktop.
@GetMapping(value = "/supervisors/{id}", produces = MediaTypes.HAL_JSON_VALUE)
public ResponseEntity<Resource<Supervisor>> findOne(@PathVariable Long id) {
Resource<Manager> managerResource = controller.findOne(id).getBody();
Resource<Supervisor> supervisorResource = new Resource<>(
new Supervisor(managerResource.getContent()),
managerResource.getLinks());
return ResponseEntity.ok(supervisorResource);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment