Пример #1
0
 // 修改
 @RequiresPermissions("admin:action:edit")
 @RequestMapping(value = "alter")
 public String alter(HttpServletRequest request, Action actionInfo, int moduleId) {
   Action action = this.actionService.findActionById(actionInfo.getId());
   actionInfo.setModule(this.moduleService.findModuleById(moduleId));
   actionInfo.setCreateTime(action.getCreateTime());
   this.actionService.saveAction(actionInfo);
   // 跳转
   String currentPage = (String) request.getSession().getAttribute("currentPage");
   return "redirect:" + currentPage;
 }
Пример #2
0
  // 增加
  @RequiresPermissions("admin:action:edit")
  @RequestMapping(value = "add", method = RequestMethod.POST)
  public String toAdd(Action actionInfo, HttpServletRequest request, int moduleId) {
    actionInfo.setCreateTime(new Date());
    actionInfo.setModule(this.moduleService.findModuleById(moduleId));
    this.actionService.saveAction(actionInfo);

    // 跳转
    String currentPage = (String) request.getSession().getAttribute("currentPage");
    return "redirect:" + currentPage;
  }