Search in sources :

Example 1 with BandPrueba

use of com.dubion.domain.BandPrueba in project dubion by valsamiq.

the class BandPruebaResource method updateBandPrueba.

/**
 * PUT  /band-pruebas : Updates an existing bandPrueba.
 *
 * @param bandPrueba the bandPrueba to update
 * @return the ResponseEntity with status 200 (OK) and with body the updated bandPrueba,
 * or with status 400 (Bad Request) if the bandPrueba is not valid,
 * or with status 500 (Internal Server Error) if the bandPrueba couldn't be updated
 * @throws URISyntaxException if the Location URI syntax is incorrect
 */
@PutMapping("/band-pruebas")
@Timed
public ResponseEntity<BandPrueba> updateBandPrueba(@RequestBody BandPrueba bandPrueba) throws URISyntaxException {
    log.debug("REST request to update BandPrueba : {}", bandPrueba);
    if (bandPrueba.getId() == null) {
        return createBandPrueba(bandPrueba);
    }
    BandPrueba result = bandPruebaService.save(bandPrueba);
    return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, bandPrueba.getId().toString())).body(result);
}
Also used : BandPrueba(com.dubion.domain.BandPrueba) Timed(com.codahale.metrics.annotation.Timed)

Example 2 with BandPrueba

use of com.dubion.domain.BandPrueba in project dubion by valsamiq.

the class BandPruebaResource method createBandPrueba.

/**
 * POST  /band-pruebas : Create a new bandPrueba.
 *
 * @param bandPrueba the bandPrueba to create
 * @return the ResponseEntity with status 201 (Created) and with body the new bandPrueba, or with status 400 (Bad Request) if the bandPrueba has already an ID
 * @throws URISyntaxException if the Location URI syntax is incorrect
 */
@PostMapping("/band-pruebas")
@Timed
public ResponseEntity<BandPrueba> createBandPrueba(@RequestBody BandPrueba bandPrueba) throws URISyntaxException {
    log.debug("REST request to save BandPrueba : {}", bandPrueba);
    if (bandPrueba.getId() != null) {
        throw new BadRequestAlertException("A new bandPrueba cannot already have an ID", ENTITY_NAME, "idexists");
    }
    BandPrueba result = bandPruebaService.save(bandPrueba);
    return ResponseEntity.created(new URI("/api/band-pruebas/" + result.getId())).headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())).body(result);
}
Also used : BadRequestAlertException(com.dubion.web.rest.errors.BadRequestAlertException) BandPrueba(com.dubion.domain.BandPrueba) URI(java.net.URI) Timed(com.codahale.metrics.annotation.Timed)

Example 3 with BandPrueba

use of com.dubion.domain.BandPrueba in project dubion by valsamiq.

the class BandPruebaResource method getBandPrueba.

/**
 * GET  /band-pruebas/:id : get the "id" bandPrueba.
 *
 * @param id the id of the bandPrueba to retrieve
 * @return the ResponseEntity with status 200 (OK) and with body the bandPrueba, or with status 404 (Not Found)
 */
@GetMapping("/band-pruebas/{id}")
@Timed
public ResponseEntity<BandPrueba> getBandPrueba(@PathVariable Long id) {
    log.debug("REST request to get BandPrueba : {}", id);
    BandPrueba bandPrueba = bandPruebaService.findOne(id);
    return ResponseUtil.wrapOrNotFound(Optional.ofNullable(bandPrueba));
}
Also used : BandPrueba(com.dubion.domain.BandPrueba) Timed(com.codahale.metrics.annotation.Timed)

Aggregations

Timed (com.codahale.metrics.annotation.Timed)3 BandPrueba (com.dubion.domain.BandPrueba)3 BadRequestAlertException (com.dubion.web.rest.errors.BadRequestAlertException)1 URI (java.net.URI)1