Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #4
0
  public String listByTime() throws Exception {

    Result result = userService.findUsersByTime(startTime, endTime, name, page, pageSize);
    super.toVm(result);
    return SUCCESS;
  }
Пример #5
0
 public String doUpdate() throws Exception {
   Result result = userService.update(user);
   result.addDefaultModel("message", "修改成功");
   super.toVm(result);
   return SUCCESS;
 }
Пример #6
0
 public String doAdd() throws Exception {
   Result result = userService.createUser(user);
   super.toVm(result);
   return SUCCESS;
 }