Class SongsController

java.lang.Object
info.ejava.examples.db.jpa.songs.controller.SongsController

@RestController public class SongsController extends Object
  • Field Details

  • Constructor Details

    • SongsController

      public SongsController()
  • Method Details

    • createSong

      @PostMapping(path="api/songs", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<SongDTO> createSong(@RequestBody SongDTO songDTO)
    • getSongs

      @GetMapping(path="api/songs", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<SongsPageDTO> getSongs(@RequestParam(value="pageNumber",defaultValue="0",required=false) Integer pageNumber, @RequestParam(value="pageSize",defaultValue="5",required=false) Integer pageSize, @RequestParam(value="sort",required=false) String sortString)
    • getSong

      @GetMapping(path="api/songs/{id}", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<SongDTO> getSong(@PathVariable(name="id") int id)
    • getRandomSong

      @GetMapping(path="api/songs/random", produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<SongDTO> getRandomSong()
    • updateSong

      @PutMapping(path="api/songs/{id}", consumes={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<Void> updateSong(@PathVariable("id") int id, @RequestBody SongDTO songDTO)
    • deleteSong

      @DeleteMapping("api/songs/{id}") public org.springframework.http.ResponseEntity<Void> deleteSong(@PathVariable(name="id") int id)
    • deleteAllSongs

      @DeleteMapping("api/songs") public org.springframework.http.ResponseEntity<Void> deleteAllSongs()
    • findSongsByExample

      @PostMapping(path="api/songs/example", consumes={"application/json","application/xml"}, produces={"application/json","application/xml"}) public org.springframework.http.ResponseEntity<SongsPageDTO> findSongsByExample(@RequestParam(value="pageNumber",defaultValue="0",required=false) Integer pageNumber, @RequestParam(value="pageSize",required=false) Integer pageSize, @RequestParam(value="sort",required=false) String sortString, @RequestBody SongDTO probe)