Class QuotesController

java.lang.Object
info.ejava.examples.svc.content.quotes.controllers.QuotesController

@RestController public class QuotesController extends Object
  • Field Details

  • Constructor Details

    • QuotesController

      public QuotesController(QuotesService quotesService)
  • Method Details

    • createQuote

      @RequestMapping(path="api/quotes", method=POST, consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> createQuote(@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

      @RequestMapping(path="api/quotes", method=GET, 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

      @RequestMapping(path="api/quotes/{id}", method=PUT, consumes={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<Void> updateQuote(@PathVariable("id") int id, @RequestBody QuoteDTO quote)
    • containsQuote

      @RequestMapping(path="api/quotes/{id}", method=HEAD) public org.springframework.http.ResponseEntity<Void> containsQuote(@PathVariable("id") int id)
    • getQuote

      @RequestMapping(path="api/quotes/{id}", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> getQuote(@PathVariable("id") int id)
    • randomQuote

      @RequestMapping(path="api/quotes/random", method=GET, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<QuoteDTO> randomQuote()
    • deleteQuote

      @RequestMapping(path="api/quotes/{id}", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteQuote(@PathVariable("id") int id)
    • deleteAllQuotes

      @RequestMapping(path="api/quotes", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllQuotes()