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