예제 #1
0
 @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");
 }
예제 #2
0
 @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");
 }
예제 #3
0
 @RequestMapping(method = RequestMethod.GET)
 public Set<Competition> getAllCompetitions() {
   LOG.info("Se recuperan todas las competiciones");
   return handlerCompetitions.getCompetitions();
 }
예제 #4
0
 @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);
 }
예제 #5
0
 @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");
 }