use of com.furyviewer.domain.FavouriteArtist in project FuryViewer by TheDoctor-95.
the class FavouriteArtistResource method getFavouriteArtist.
/**
* GET /favourite-artists/:id : get the "id" favouriteArtist.
*
* @param id the id of the favouriteArtist to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the favouriteArtist, or with status 404 (Not Found)
*/
@GetMapping("/favourite-artists/{id}")
@Timed
public ResponseEntity<FavouriteArtist> getFavouriteArtist(@PathVariable Long id) {
log.debug("REST request to get FavouriteArtist : {}", id);
FavouriteArtist favouriteArtist = favouriteArtistRepository.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(favouriteArtist));
}
use of com.furyviewer.domain.FavouriteArtist in project FuryViewer by TheDoctor-95.
the class FavouriteArtistResource method favouriteSeries.
@PostMapping("/favourite-artists/id/{idArtist}/liked")
@Timed
public ResponseEntity<FavouriteArtist> favouriteSeries(@PathVariable Long idArtist) throws URISyntaxException {
log.debug("REST request to save FavouriteArtist : {}", idArtist);
Artist a = artistRepository.findOne(idArtist);
FavouriteArtist fA = new FavouriteArtist();
fA.setArtist(a);
fA.setLiked(true);
return createFavouriteArtist(fA);
}
Aggregations