Class QuotesController
java.lang.Object
info.ejava.examples.svc.content.quotes.controllers.QuotesController
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> containsQuote(int id) org.springframework.http.ResponseEntity<QuoteDTO> createQuote(String contentType, List<String> accept, QuoteDTO quote) This method provides two example method signatures.org.springframework.http.ResponseEntity<Void> org.springframework.http.ResponseEntity<Void> deleteQuote(int id) org.springframework.http.ResponseEntity<QuoteDTO> getQuote(int id) org.springframework.http.ResponseEntity<QuoteListDTO> getQuotes(int offset, int limit) org.springframework.http.ResponseEntity<QuoteDTO> org.springframework.http.ResponseEntity<Void> updateQuote(int id, QuoteDTO quote)
-
Field Details
-
quotesService
-
-
Constructor Details
-
QuotesController
-
-
Method Details
-
createQuote
@PostMapping(path="api/quotes", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> createQuote(@RequestHeader(name="Content-Type") String contentType, @RequestHeader(name="Accept") List<String> accept, @RequestBody QuoteDTO quote) This method provides two example method signatures. Use the @RequestBody form when headers are of no interest. Use RequestEntity<Quote> form when headers are of interest -
getQuotes
@GetMapping(path="api/quotes", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteListDTO> getQuotes(@RequestParam(name="offset",defaultValue="0") int offset, @RequestParam(name="limit",defaultValue="0") int limit) -
updateQuote
-
containsQuote
@RequestMapping(path="api/quotes/{id}", method=HEAD) public org.springframework.http.ResponseEntity<Void> containsQuote(@PathVariable("id") int id) -
getQuote
@GetMapping(path="api/quotes/{id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> getQuote(@PathVariable("id") int id) -
randomQuote
@GetMapping(path="api/quotes/random", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> randomQuote() -
deleteQuote
@DeleteMapping("api/quotes/{id}") public org.springframework.http.ResponseEntity<Void> deleteQuote(@PathVariable("id") int id) -
deleteAllQuotes
-