class UserServiceImpl implements UserService {

    @Override
    public void update(User user) {
        User dbUser = findById(user.getId());
        if (root.equals(dbUser.getEmail())) {
            throw new RuntimeException("ROOT 用户不能修改");
        }

        user.setPassword(DigestUtils.md5Hex(user.getPassword()));
        userRepository.update(user);
    }

}