更新用户基本信息
//usercontroller
@PutMapping("/update")
public Result update(@RequestBody User user){
userService.update(user);
return Result.success();
}
//userService
void update(User user);
//userServiceImpl
@Override
public void update(User user){
user.setUpdateTime(LocalDateTime.now());
userMapper.update(user);
}
//userMapper
@Update("update user set nickname=#{nickname},email=#{email},update_time=#{updateTime} where id=#{id}")
void update(User user);
标签:14,void,userMapper,update,用户,2024,User,id,user
From: https://www.cnblogs.com/muzhaodi/p/18073940