Class SongsController
java.lang.Object
info.ejava.examples.db.jpa.songs.controller.SongsController
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
private final SongsService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity
<SongDTO> createSong
(SongDTO songDTO) org.springframework.http.ResponseEntity
<Void> org.springframework.http.ResponseEntity
<Void> deleteSong
(int id) org.springframework.http.ResponseEntity
<SongsPageDTO> findSongsByExample
(Integer pageNumber, Integer pageSize, String sortString, SongDTO probe) org.springframework.http.ResponseEntity
<SongDTO> org.springframework.http.ResponseEntity
<SongDTO> getSong
(int id) org.springframework.http.ResponseEntity
<SongsPageDTO> org.springframework.http.ResponseEntity
<Void> updateSong
(int id, SongDTO songDTO)
-
Field Details
-
SONGS_PATH
- See Also:
-
SONG_PATH
- See Also:
-
RANDOM_SONG_PATH
- See Also:
-
songsService
-
-
Constructor Details
-
SongsController
public SongsController()
-
-
Method Details
-
createSong
-
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
-
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)
-