Exemplo n.º 1
0
 @RequiresPermissions("sys:dict:edit")
 @RequestMapping(value = "delete")
 public String delete(String id, RedirectAttributes redirectAttributes) {
   if (Global.isDemoMode()) {
     addMessage(redirectAttributes, "演示模式,不允许操作!");
     return "redirect:" + Global.getAdminPath() + "/sys/dict/?repage";
   }
   dictService.delete(id);
   addMessage(redirectAttributes, "删除字典成功");
   return "redirect:" + Global.getAdminPath() + "/sys/dict/?repage";
 }
Exemplo n.º 2
0
 @RequiresPermissions("sys:dict:edit")
 @RequestMapping(value = "save") // @Valid
 public String save(
     Dict dict, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
   if (Global.isDemoMode()) {
     addMessage(redirectAttributes, "演示模式,不允许操作!");
     return "redirect:" + Global.getAdminPath() + "/sys/dict/?repage&type=" + dict.getType();
   }
   if (!beanValidator(model, dict)) {
     return form(dict, model);
   }
   dictService.save(dict);
   addMessage(redirectAttributes, "保存字典'" + dict.getLabel() + "'成功");
   return "redirect:" + Global.getAdminPath() + "/sys/dict/?repage&type=" + dict.getType();
 }