Example #1
0
 /**
  * 添加用户
  *
  * @param user
  * @param model
  */
 @RequiresPermissions("sys:user:add")
 @RequestMapping(value = "create", method = RequestMethod.POST)
 @ResponseBody
 public String create(@Valid User user, Model model) {
   user.setCreateDate(DateUtils.getSysTimestamp());
   userService.saveUser(user);
   return "success";
 }
Example #2
0
 /**
  * 修改用户
  *
  * @param user
  * @param model
  * @return
  */
 @RequiresPermissions("sys:user:update")
 @RequestMapping(value = "update", method = RequestMethod.POST)
 @ResponseBody
 public String update(@Valid @ModelAttribute @RequestBody User user, Model model) {
   user.setModifyDate(DateUtils.getSysTimestamp());
   userService.updateUser(user);
   return "success";
 }