// <3> @RequestMapping(method = RequestMethod.GET) ResponseEntity<Resources<Object>> root() { Resources<Object> objects = new Resources<>(Collections.emptyList()); URI uri = MvcUriComponentsBuilder.fromMethodCall( MvcUriComponentsBuilder.on(getClass()).getCollection()) .build() .toUri(); Link link = new Link(uri.toString(), "customers"); objects.add(link); return ResponseEntity.ok(objects); }
@RequestMapping(method = RequestMethod.GET) HttpEntity<Resources<Profile>> showCustomers() { Resources<Profile> resources = new Resources<Profile>(this.repository.findAll()); resources.add(this.entityLinks.linkToCollectionResource(Profile.class)); return new ResponseEntity<Resources<Profile>>(resources, HttpStatus.OK); }