use of com.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class SocialResource method createSocial.
/**
* POST /socials : Create a new social.
*
* @param social the social to create
* @return the ResponseEntity with status 201 (Created) and with body the new social, or with status 400 (Bad Request) if the social has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/socials")
@Timed
public ResponseEntity<Social> createSocial(@RequestBody Social social) throws URISyntaxException {
log.debug("REST request to save Social : {}", social);
if (social.getId() != null) {
throw new BadRequestAlertException("A new social cannot already have an ID", ENTITY_NAME, "idexists");
}
Social result = socialService.save(social);
return ResponseEntity.created(new URI("/api/social/" + 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 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.dubion.web.rest.errors.BadRequestAlertException in project dubion by valsamiq.
the class AlphaResource method createAlpha.
/**
* POST /alphas : Create a new alpha.
*
* @param alpha the alpha to create
* @return the ResponseEntity with status 201 (Created) and with body the new alpha, or with status 400 (Bad Request) if the alpha has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/alphas")
@Timed
public ResponseEntity<Alpha> createAlpha(@RequestBody Alpha alpha) throws URISyntaxException {
log.debug("REST request to save Alpha : {}", alpha);
if (alpha.getId() != null) {
throw new BadRequestAlertException("A new alpha cannot already have an ID", ENTITY_NAME, "idexists");
}
Alpha result = alphaService.save(alpha);
return ResponseEntity.created(new URI("/api/alphas/" + 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 ArtistResource method createArtist.
/**
* POST /artists : Create a new artist.
*
* @param artist the artist to create
* @return the ResponseEntity with status 201 (Created) and with body the new artist, or with status 400 (Bad Request) if the artist has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/artists")
@Timed
public ResponseEntity<Artist> createArtist(@RequestBody Artist artist) throws URISyntaxException {
log.debug("REST request to save Artist : {}", artist);
if (artist.getId() != null) {
throw new BadRequestAlertException("A new artist cannot already have an ID", ENTITY_NAME, "idexists");
}
Artist result = artistService.save(artist);
return ResponseEntity.created(new URI("/api/artist/" + 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 BetaResource method createBeta.
/**
* POST /betas : Create a new beta.
*
* @param beta the beta to create
* @return the ResponseEntity with status 201 (Created) and with body the new beta, or with status 400 (Bad Request) if the beta has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/betas")
@Timed
public ResponseEntity<Beta> createBeta(@RequestBody Beta beta) throws URISyntaxException {
log.debug("REST request to save Beta : {}", beta);
if (beta.getId() != null) {
throw new BadRequestAlertException("A new beta cannot already have an ID", ENTITY_NAME, "idexists");
}
Beta result = betaService.save(beta);
return ResponseEntity.created(new URI("/api/betas/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Aggregations