package cn.reghao.autodop.dmaster.app.db.crud.config.impl;

import cn.reghao.autodop.dmaster.app.db.crud.config.RepoAuthConfigCrud;
import cn.reghao.autodop.dmaster.app.db.repository.config.build.RepoAuthConfigRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.build.RepoAuthConfig;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2020-11-10 21:58:00
 */
@Service
public class RepoAuthConfigCrudImpl implements RepoAuthConfigCrud {
    private final RepoAuthConfigRepository repoAuthRepository;

    public RepoAuthConfigCrudImpl(RepoAuthConfigRepository repoAuthRepository) {
        this.repoAuthRepository = repoAuthRepository;
    }

    @Override
    public RepoAuthConfig save(RepoAuthConfig repoAuthConfig) {
        repoAuthRepository.save(repoAuthConfig);
        return repoAuthConfig;
    }

    @Override
    public void saveAll(List<RepoAuthConfig> list) {
        repoAuthRepository.saveAll(list);
    }

    @Override
    public void update(RepoAuthConfig repoAuthConfig) {
        repoAuthRepository.save(repoAuthConfig);
    }

    @Override
    public void delete(RepoAuthConfig repoAuthConfig) {
        repoAuthRepository.delete(repoAuthConfig);
    }
}
