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

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

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

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

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

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

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

      @RequestMapping(path="api/songs", method=DELETE) public org.springframework.http.ResponseEntity<Void> deleteAllSongs()
    • findSongsByExample

      @RequestMapping(path="api/songs/example", method=POST, 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)