コード例 #1
0
 @RequestMapping(value = "delete/{id}")
 public String delete(@PathVariable("id") Long id, RedirectAttributes redirectAttributes) {
   User user = accountService.getUser(id);
   accountService.deleteUser(id);
   redirectAttributes.addFlashAttribute("message", "删除用户" + user.getLoginName() + "成功");
   return "redirect:/admin/user";
 }
コード例 #2
0
 @RequestMapping(value = "update", method = RequestMethod.POST)
 public String update(
     @Valid @ModelAttribute("user") User user, RedirectAttributes redirectAttributes) {
   accountService.updateUser(user);
   redirectAttributes.addFlashAttribute("message", "更新用户" + user.getLoginName() + "成功");
   return "redirect:/admin/user";
 }