use of com.dubion.domain.RatingArtist in project dubion by valsamiq.
the class RatingArtistResource method getRatingArtist.
/**
* GET /rating-artists/:id : get the "id" ratingArtist.
*
* @param id the id of the ratingArtist to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the ratingArtist, or with status 404 (Not Found)
*/
@GetMapping("/rating-artists/{id}")
@Timed
public ResponseEntity<RatingArtist> getRatingArtist(@PathVariable Long id) {
log.debug("REST request to get RatingArtist : {}", id);
RatingArtist ratingArtist = ratingArtistService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(ratingArtist));
}
use of com.dubion.domain.RatingArtist in project dubion by valsamiq.
the class RatingArtistResource method createRatingArtist.
/**
* POST /rating-artists : Create a new ratingArtist.
*
* @param ratingArtist the ratingArtist to create
* @return the ResponseEntity with status 201 (Created) and with body the new ratingArtist, or with status 400 (Bad Request) if the ratingArtist has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/rating-artists")
@Timed
public ResponseEntity<RatingArtist> createRatingArtist(@RequestBody RatingArtist ratingArtist) throws URISyntaxException {
log.debug("REST request to save RatingArtist : {}", ratingArtist);
if (ratingArtist.getId() != null) {
throw new BadRequestAlertException("A new ratingArtist cannot already have an ID", ENTITY_NAME, "idexists");
}
RatingArtist result = ratingArtistService.save(ratingArtist);
return ResponseEntity.created(new URI("/api/rating-artist/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.dubion.domain.RatingArtist in project dubion by valsamiq.
the class RatingArtistResource method updateRatingArtist.
/**
* PUT /rating-artists : Updates an existing ratingArtist.
*
* @param ratingArtist the ratingArtist to update
* @return the ResponseEntity with status 200 (OK) and with body the updated ratingArtist,
* or with status 400 (Bad Request) if the ratingArtist is not valid,
* or with status 500 (Internal Server Error) if the ratingArtist couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/rating-artists")
@Timed
public ResponseEntity<RatingArtist> updateRatingArtist(@RequestBody RatingArtist ratingArtist) throws URISyntaxException {
log.debug("REST request to update RatingArtist : {}", ratingArtist);
if (ratingArtist.getId() == null) {
return createRatingArtist(ratingArtist);
}
RatingArtist result = ratingArtistService.save(ratingArtist);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, ratingArtist.getId().toString())).body(result);
}
Aggregations