@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public ModelAndView deleteCompetition(@PathVariable("id") Integer id) { LOG.info("Se va a proceder a borrar una competicion"); handlerCompetitions.removeCompetition(new Competition(id)); return this.getResponse("Competición borrada correctamente"); }
@RequestMapping(method = RequestMethod.PUT) public ModelAndView updateCompetition(@RequestBody Competition competition) { LOG.info("Se va a proceder a actualizar una competicion"); handlerCompetitions.updateCompetition(competition); return this.getResponse("Competición actualizada correctamente"); }
@RequestMapping(method = RequestMethod.GET) public Set<Competition> getAllCompetitions() { LOG.info("Se recuperan todas las competiciones"); return handlerCompetitions.getCompetitions(); }
@RequestMapping(value = "/{id}", method = RequestMethod.GET) public Competition getCompetitionById(@PathVariable("id") Integer id) { LOG.info("Se recupera una competicion"); Competition competition = new Competition(id); return handlerCompetitions.findCompetition(competition); }
@RequestMapping(method = RequestMethod.POST) public ModelAndView insertCompetition(@RequestBody Competition competition) { LOG.info("Se va a proceder a insertar una competicion"); handlerCompetitions.addCompetition(competition); return this.getResponse("Competición insertada correctamente"); }