use of com.furyviewer.domain.Season in project FuryViewer by TheDoctor-95.
the class SeasonResource method getSeason.
/**
* GET
*
* @param id the id of the series to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the season, or with status 404 (Not Found)
*/
@GetMapping("/seasons/{id}")
@Timed
public ResponseEntity<Season> getSeason(@PathVariable Long id) {
log.debug("REST request to get Season : {}", id);
Season season = seasonRepository.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(season));
}
use of com.furyviewer.domain.Season in project FuryViewer by TheDoctor-95.
the class SeasonResource method updateSeason.
/**
* PUT /seasons : Updates an existing season.
*
* @param season the season to update
* @return the ResponseEntity with status 200 (OK) and with body the updated season,
* or with status 400 (Bad Request) if the season is not valid,
* or with status 500 (Internal Server Error) if the season couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/seasons")
@Timed
public ResponseEntity<Season> updateSeason(@RequestBody Season season) throws URISyntaxException {
log.debug("REST request to update Season : {}", season);
if (season.getId() == null) {
return createSeason(season);
}
Season result = seasonRepository.save(season);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, season.getId().toString())).body(result);
}
Aggregations