use of com.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class FavouriteBandResource method createFavouriteBand.
/**
* POST /favourite-bands : Create a new favouriteBand.
*
* @param favouriteBand the favouriteBand to create
* @return the ResponseEntity with status 201 (Created) and with body the new favouriteBand, or with status 400 (Bad Request) if the favouriteBand has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/favourite-bands")
@Timed
public ResponseEntity<FavouriteBand> createFavouriteBand(@RequestBody FavouriteBand favouriteBand) throws URISyntaxException {
log.debug("REST request to save FavouriteBand : {}", favouriteBand);
if (favouriteBand.getId() != null) {
throw new BadRequestAlertException("A new favouriteBand cannot already have an ID", ENTITY_NAME, "idexists");
}
FavouriteBand result = favouriteBandService.save(favouriteBand);
return ResponseEntity.created(new URI("/api/favourite-bands/" + 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 FavouriteSongResource method createFavouriteSong.
/**
* POST /favourite-songs : Create a new favouriteSong.
*
* @param favouriteSong the favouriteSong to create
* @return the ResponseEntity with status 201 (Created) and with body the new favouriteSong, or with status 400 (Bad Request) if the favouriteSong has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/favourite-songs")
@Timed
public ResponseEntity<FavouriteSong> createFavouriteSong(@RequestBody FavouriteSong favouriteSong) throws URISyntaxException {
log.debug("REST request to save FavouriteSong : {}", favouriteSong);
if (favouriteSong.getId() != null) {
throw new BadRequestAlertException("A new favouriteSong cannot already have an ID", ENTITY_NAME, "idexists");
}
FavouriteSong result = favouriteSongService.save(favouriteSong);
return ResponseEntity.created(new URI("/api/favourite-song/" + 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 InstrumentResource method createInstrument.
/**
* POST /instruments : Create a new instrument.
*
* @param instrument the instrument to create
* @return the ResponseEntity with status 201 (Created) and with body the new instrument, or with status 400 (Bad Request) if the instrument has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/instruments")
@Timed
public ResponseEntity<Instrument> createInstrument(@RequestBody Instrument instrument) throws URISyntaxException {
log.debug("REST request to save Instrument : {}", instrument);
if (instrument.getId() != null) {
throw new BadRequestAlertException("A new instrument cannot already have an ID", ENTITY_NAME, "idexists");
}
Instrument result = instrumentRepository.save(instrument);
return ResponseEntity.created(new URI("/api/instruments/" + 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 LabelResource method createLabel.
/**
* POST /labels : Create a new label.
*
* @param label the label to create
* @return the ResponseEntity with status 201 (Created) and with body the new label, or with status 400 (Bad Request) if the label has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/labels")
@Timed
public ResponseEntity<Label> createLabel(@RequestBody Label label) throws URISyntaxException {
log.debug("REST request to save Label : {}", label);
if (label.getId() != null) {
throw new BadRequestAlertException("A new label cannot already have an ID", ENTITY_NAME, "idexists");
}
Label result = labelService.save(label);
return ResponseEntity.created(new URI("/api/labels/" + 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 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);
}
Aggregations