Polish text.

* Replace "mediatype" with "media type".
* Remove usage of "produces" clauses in Spring MVC route definitions, since XML support was removed from Spring HATEOAS.
This commit is contained in:
Greg Turnquist
2019-02-04 11:34:54 -06:00
parent b42758025d
commit dd57e0a515
13 changed files with 47 additions and 95 deletions

View File

@@ -17,7 +17,6 @@ package org.springframework.hateoas.examples;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.*;
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.Resource;
import org.springframework.hateoas.ResourceSupport;
import org.springframework.hateoas.Resources;
@@ -43,7 +42,7 @@ class EmployeeController {
this.assembler = assembler;
}
@GetMapping(value = "/", produces = MediaTypes.HAL_JSON_VALUE)
@GetMapping("/")
public ResourceSupport root() {
ResourceSupport rootResource = new ResourceSupport();
@@ -55,7 +54,7 @@ class EmployeeController {
return rootResource;
}
@GetMapping(value = "/employees", produces = MediaTypes.HAL_JSON_VALUE)
@GetMapping("/employees")
public Resources<Resource<Employee>> findAll() {
return assembler.toResources(repository.findAll());
}
@@ -72,7 +71,7 @@ class EmployeeController {
.body(assembler.toResource(savedEmployee));
}
@GetMapping(value = "/employees/{id}", produces = MediaTypes.HAL_JSON_VALUE)
@GetMapping("/employees/{id}")
public Resource<Employee> findOne(@PathVariable Long id) {
return repository.findById(id)
.map(assembler::toResource)