Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 public String doUpdate() throws Exception {
   Result result = userService.update(user);
   result.addDefaultModel("message", "修改成功");
   super.toVm(result);
   return SUCCESS;
 }