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

import cn.reghao.autodop.dmaster.app.db.query.config.BuildDirQuery;
import cn.reghao.autodop.dmaster.app.db.repository.config.build.BuildDirRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.build.BuildDir;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @author reghao
 * @date 2021-06-11 18:02:57
 */
@Service
public class BuildDirQueryImpl implements BuildDirQuery {
    private BuildDirRepository buildDirRepository;

    public BuildDirQueryImpl(BuildDirRepository buildDirRepository) {
        this.buildDirRepository = buildDirRepository;
    }

    @Override
    public Page<BuildDir> findByPage(Pageable pageable) {
        return buildDirRepository.findAll(pageable);
    }

    @Override
    public BuildDir findByMachineId(String machineId) {
        return buildDirRepository.findByMachineId(machineId);
    }
}
