public String list() throws Exception { // Result result=userService.findUsers(); Result result = userService.findUsers("", page, pageSize); result.addDefaultModel("message", "test message"); super.toVm(result); return super.SUCCESS; }
public String delete() throws Exception { String id = super.request.getParameter("id"); User deleteUser = new User(); deleteUser.setId(Integer.parseInt(id)); userService.delete(deleteUser); Result result = new Result(); result.setSuccess(true); result.addDefaultModel("userId", id); super.toVm(result); return SUCCESS; }
public String update() throws Exception { String id = super.request.getParameter("id"); Result result = null; if (StringUtils.isEmpty(id)) { result = new Result(); result.setSuccess(false); result.addDefaultModel("message", "not get id"); } else { result = userService.findUserById(id); } super.toVm(result); return SUCCESS; }
public String doUpdate() throws Exception { Result result = userService.update(user); result.addDefaultModel("message", "修改成功"); super.toVm(result); return SUCCESS; }