use of com.dubion.domain.Beta in project dubion by valsamiq.
the class BetaResource method getBeta.
/**
* GET /betas/:id : get the "id" beta.
*
* @param id the id of the beta to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the beta, or with status 404 (Not Found)
*/
@GetMapping("/betas/{id}")
@Timed
public ResponseEntity<Beta> getBeta(@PathVariable Long id) {
log.debug("REST request to get Beta : {}", id);
Beta beta = betaService.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(beta));
}
use of com.dubion.domain.Beta in project dubion by valsamiq.
the class BetaResource method updateBeta.
/**
* PUT /betas : Updates an existing beta.
*
* @param beta the beta to update
* @return the ResponseEntity with status 200 (OK) and with body the updated beta,
* or with status 400 (Bad Request) if the beta is not valid,
* or with status 500 (Internal Server Error) if the beta couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/betas")
@Timed
public ResponseEntity<Beta> updateBeta(@RequestBody Beta beta) throws URISyntaxException {
log.debug("REST request to update Beta : {}", beta);
if (beta.getId() == null) {
return createBeta(beta);
}
Beta result = betaService.save(beta);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, beta.getId().toString())).body(result);
}
use of com.dubion.domain.Beta 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