use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class SeriesResource method createSeries.
/**
* POST /series : Create a new series.
*
* @param series the series to create
* @return the ResponseEntity with status 201 (Created) and with body the new series, or with status 400 (Bad Request) if the series has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/series")
@Timed
public ResponseEntity<Series> createSeries(@RequestBody Series series) throws URISyntaxException {
log.debug("REST request to save Series : {}", series);
if (series.getId() != null) {
throw new BadRequestAlertException("A new series cannot already have an ID", ENTITY_NAME, "idexists");
}
Series result = seriesRepository.save(series);
return ResponseEntity.created(new URI("/api/series/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class UserExtResource method createUserExt.
/**
* POST /user-exts : Create a new userExt.
*
* @param userExt the userExt to create
* @return the ResponseEntity with status 201 (Created) and with body the new userExt, or with status 400 (Bad Request) if the userExt has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/user-exts")
@Timed
public ResponseEntity<UserExt> createUserExt(@RequestBody UserExt userExt) throws URISyntaxException {
log.debug("REST request to save UserExt : {}", userExt);
if (userExt.getId() != null) {
throw new BadRequestAlertException("A new userExt cannot already have an ID", ENTITY_NAME, "idexists");
}
UserExt result = userExtRepository.save(userExt);
return ResponseEntity.created(new URI("/api/user-exts/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
use of com.furyviewer.web.rest.errors.BadRequestAlertException in project FuryViewer by TheDoctor-95.
the class SeriesStatsResource method createSeriesStats.
/**
* POST /series-stats : Create a new seriesStats.
*
* @param seriesStats the seriesStats to create
* @return the ResponseEntity with status 201 (Created) and with body the new seriesStats, or with status 400 (Bad Request) if the seriesStats has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/series-stats")
@Timed
public ResponseEntity<SeriesStats> createSeriesStats(@RequestBody SeriesStats seriesStats) throws URISyntaxException {
log.debug("REST request to save SeriesStats : {}", seriesStats);
if (seriesStats.getId() != null) {
throw new BadRequestAlertException("A new seriesStats cannot already have an ID", ENTITY_NAME, "idexists");
}
SeriesStats result = seriesStatsRepository.save(seriesStats);
return ResponseEntity.created(new URI("/api/series-stats/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Aggregations