use of com.furyviewer.domain.RateMovie in project FuryViewer by TheDoctor-95.
the class RateMovieResource method getRateMovie.
/**
* GET /rate-movies/:id : get the "id" rateMovie.
*
* @param id the id of the rateMovie to retrieve
* @return the ResponseEntity with status 200 (OK) and with body the rateMovie, or with status 404 (Not Found)
*/
@GetMapping("/rate-movies/{id}")
@Timed
public ResponseEntity<RateMovie> getRateMovie(@PathVariable Long id) {
log.debug("REST request to get RateMovie : {}", id);
RateMovie rateMovie = rateMovieRepository.findOne(id);
return ResponseUtil.wrapOrNotFound(Optional.ofNullable(rateMovie));
}
use of com.furyviewer.domain.RateMovie in project FuryViewer by TheDoctor-95.
the class RateMovieResource method RateMovie.
@PostMapping("/rate-movies/id/{idMovie}/rate/{rate}")
@Timed
public ResponseEntity<RateMovie> RateMovie(@PathVariable Long idMovie, @PathVariable int rate) throws URISyntaxException {
Movie m = movieRepository.findOne(idMovie);
RateMovie rm = new RateMovie();
rm.setMovie(m);
rm.setRate(rate);
return createRateMovie(rm);
}
use of com.furyviewer.domain.RateMovie in project FuryViewer by TheDoctor-95.
the class RateMovieResource method updateRateMovie.
/**
* PUT /rate-movies : Updates an existing rateMovie.
*
* @param rateMovie the rateMovie to update
* @return the ResponseEntity with status 200 (OK) and with body the updated rateMovie,
* or with status 400 (Bad Request) if the rateMovie is not valid,
* or with status 500 (Internal Server Error) if the rateMovie couldn't be updated
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PutMapping("/rate-movies")
@Timed
public ResponseEntity<RateMovie> updateRateMovie(@RequestBody RateMovie rateMovie) throws URISyntaxException {
log.debug("REST request to update RateMovie : {}", rateMovie);
if (rateMovie.getId() == null) {
return createRateMovie(rateMovie);
}
RateMovie result = rateMovieRepository.save(rateMovie);
return ResponseEntity.ok().headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, rateMovie.getId().toString())).body(result);
}
Aggregations