public ModelAndView del(@PathVariable Long id) { ModelAndView modelAndView = new ModelAndView("redirect:/t/index?sort=sort"); modelAndView.setStatus(HttpStatus.MOVED_PERMANENTLY); if (id == 0L) { return modelAndView; } templateRepository.deleteById(id); return modelAndView; }
|