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

import cn.reghao.autodop.dmaster.app.db.query.config.CompilerConfigQuery;
import cn.reghao.autodop.dmaster.app.db.repository.config.build.CompilerConfigRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.build.CompilerConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2021-06-11 18:02:57
 */
@Service
public class CompilerConfigQueryImpl implements CompilerConfigQuery {
    private final CompilerConfigRepository compilerRepository;

    public CompilerConfigQueryImpl(CompilerConfigRepository compilerRepository) {
        this.compilerRepository = compilerRepository;
    }

    @Override
    public CompilerConfig findByName(String name) {
        return compilerRepository.findByName(name);
    }

    @Override
    public Page<CompilerConfig> findAll(Pageable pageable) {
        return compilerRepository.findAll(pageable);
    }

    @Override
    public List<CompilerConfig> findAllByIsDeleteFalse() {
        return compilerRepository.findAllByIsDeleteFalse();
    }
}
