Search in sources :

Example 6 with FavouriteArtist

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));
}
Also used : FavouriteArtist(com.furyviewer.domain.FavouriteArtist) Timed(com.codahale.metrics.annotation.Timed)

Example 7 with 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);
}
Also used : Artist(com.furyviewer.domain.Artist) FavouriteArtist(com.furyviewer.domain.FavouriteArtist) FavouriteArtist(com.furyviewer.domain.FavouriteArtist) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

FavouriteArtist (com.furyviewer.domain.FavouriteArtist)7 Timed (com.codahale.metrics.annotation.Timed)4 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 Transactional (org.springframework.transaction.annotation.Transactional)3 Artist (com.furyviewer.domain.Artist)1 BadRequestAlertException (com.furyviewer.web.rest.errors.BadRequestAlertException)1 URI (java.net.URI)1