package cn.reghao.autodop.dmaster.rbac.db.crud;

import cn.reghao.autodop.dmaster.rbac.db.repository.UserRepository;
import cn.reghao.autodop.dmaster.rbac.model.po.User;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2021-09-10 19:12:38
 */
@Service
public class UserCrudImpl implements UserCrud {
    private final UserRepository userRepository;

    public UserCrudImpl(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public User save(User user) {
        userRepository.save(user);
        return user;
    }

    @Override
    public void saveAll(List<User> users) {
    }

    @Override
    public void update(User user) {
        userRepository.save(user);
    }

    @Override
    public void delete(User user) {
        userRepository.delete(user);
    }
}
