Пример #1
0
 /**
  * 跳转到角色编辑页面
  *
  * @param id
  * @param model
  * @return
  */
 @RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
 public String update(@PathVariable int id, Model model) {
   model.addAttribute(roleService.load(id));
   model.addAttribute("types", EnumUtils.enum2Name(RoleType.class));
   return "role/update";
 }
Пример #2
0
 /**
  * 跳转到添加角色信息(把枚举定义的角色信息带到添加页面)
  *
  * @param model
  * @return
  */
 @RequestMapping(value = "/add", method = RequestMethod.GET)
 public String add(Model model) {
   model.addAttribute(new Role());
   model.addAttribute("types", EnumUtils.enum2Name(RoleType.class));
   return "role/add";
 }