use of com.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class FavouriteAlbumResource method createFavouriteAlbum.
/**
* POST /favourite-albums : Create a new favouriteAlbum.
*
* @param favouriteAlbum the favouriteAlbum to create
* @return the ResponseEntity with status 201 (Created) and with body the new favouriteAlbum, or with status 400 (Bad Request) if the favouriteAlbum has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/favourite-albums")
@Timed
public ResponseEntity<FavouriteAlbum> createFavouriteAlbum(@RequestBody FavouriteAlbum favouriteAlbum) throws URISyntaxException {
log.debug("REST request to save FavouriteAlbum : {}", favouriteAlbum);
if (favouriteAlbum.getId() != null) {
throw new BadRequestAlertException("A new favouriteAlbum cannot already have an ID", ENTITY_NAME, "idexists");
}
FavouriteAlbum result = favouriteAlbumService.save(favouriteAlbum);
return ResponseEntity.created(new URI("/api/favourite-albums/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class GammaResource method createGamma.
/**
* POST /gammas : Create a new gamma.
*
* @param gamma the gamma to create
* @return the ResponseEntity with status 201 (Created) and with body the new gamma, or with status 400 (Bad Request) if the gamma has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/gammas")
@Timed
public ResponseEntity<Gamma> createGamma(@RequestBody Gamma gamma) throws URISyntaxException {
log.debug("REST request to save Gamma : {}", gamma);
if (gamma.getId() != null) {
throw new BadRequestAlertException("A new gamma cannot already have an ID", ENTITY_NAME, "idexists");
}
Gamma result = gammaService.save(gamma);
return ResponseEntity.created(new URI("/api/gammas/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class GenreResource method createGenre.
/**
* POST /genres : Create a new genre.
*
* @param genre the genre to create
* @return the ResponseEntity with status 201 (Created) and with body the new genre, or with status 400 (Bad Request) if the genre has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/genres")
@Timed
public ResponseEntity<Genre> createGenre(@RequestBody Genre genre) throws URISyntaxException {
log.debug("REST request to save Genre : {}", genre);
if (genre.getId() != null) {
throw new BadRequestAlertException("A new genre cannot already have an ID", ENTITY_NAME, "idexists");
}
Genre result = genreRepository.save(genre);
return ResponseEntity.created(new URI("/api/genres/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.dubion.web.rest.errors.BadRequestAlertException 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);
}
Aggregations