Interface RentersJSONIfaceMapping
- All Superinterfaces:
RentersHttpIface
This is an implementation of a Spring 6 HTTP Interface, which
provides a client-side definition for HTTP calls versus writing
the RestTemplate/RestClient calls manually.
Since annotations are hard-wired within code, this version of the
interface was written to address JSON requests/responses.
-
Field Summary
Fields inherited from interface info.ejava.assignments.api.houserenters.client.renters.RentersHttpIface
RENTER_PATH, RENTERS_PATH
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<RenterDTO> createRenter
(RenterDTO renter) org.springframework.http.ResponseEntity
<RenterDTO> org.springframework.http.ResponseEntity
<RenterListDTO> getRenters
(Integer pageNumber, Integer pageSize) org.springframework.http.ResponseEntity
<Void> org.springframework.http.ResponseEntity
<Void> org.springframework.http.ResponseEntity
<Void> removeRenter
(String id) org.springframework.http.ResponseEntity
<RenterDTO> updateRenter
(String id, RenterDTO renter)
-
Method Details
-
createRenter
@PostExchange(url="/api/renters", contentType="application/json", accept="application/json") org.springframework.http.ResponseEntity<RenterDTO> createRenter(@RequestBody RenterDTO renter) - Specified by:
createRenter
in interfaceRentersHttpIface
-
getRenters
@GetExchange(url="/api/renters", accept="application/json") org.springframework.http.ResponseEntity<RenterListDTO> getRenters(@RequestParam(name="pageNumber",required=false) Integer pageNumber, @RequestParam(name="pageSize",required=false) Integer pageSize) - Specified by:
getRenters
in interfaceRentersHttpIface
-
getRenter
@GetExchange(url="/api/renters/{id}", accept="application/json") org.springframework.http.ResponseEntity<RenterDTO> getRenter(@PathVariable("id") String id) - Specified by:
getRenter
in interfaceRentersHttpIface
-
hasRenter
@HttpExchange(method="HEAD", url="/api/renters/{id}") org.springframework.http.ResponseEntity<Void> hasRenter(@PathVariable("id") String id) - Specified by:
hasRenter
in interfaceRentersHttpIface
-
updateRenter
@PutExchange(url="/api/renters/{id}", contentType="application/json", accept="application/json") org.springframework.http.ResponseEntity<RenterDTO> updateRenter(@PathVariable("id") String id, @RequestBody RenterDTO renter) - Specified by:
updateRenter
in interfaceRentersHttpIface
-
removeRenter
@DeleteExchange("/api/renters/{id}") org.springframework.http.ResponseEntity<Void> removeRenter(@PathVariable("id") String id) - Specified by:
removeRenter
in interfaceRentersHttpIface
-
removeAllRenters
- Specified by:
removeAllRenters
in interfaceRentersHttpIface
-