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

import cn.reghao.autodop.dmaster.app.db.query.config.PackerConfigQuery;
import cn.reghao.autodop.dmaster.app.db.repository.config.build.PackerConfigRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.build.PackerConfig;
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 PackerConfigQueryImpl implements PackerConfigQuery {
    private final PackerConfigRepository packerRepository;

    public PackerConfigQueryImpl(PackerConfigRepository packerRepository) {
        this.packerRepository = packerRepository;
    }

    @Override
    public PackerConfig findByName(String name) {
        return packerRepository.findByName(name);
    }

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

    @Override
    public List<PackerConfig> findAllByIsDeleteFalse() {
        return packerRepository.findAllByIsDeleteFalse();
    }
}
