package cn.reghao.autodop.dmaster.app.db.repository.config;

import cn.reghao.autodop.dmaster.app.model.po.config.AppConfig;
import cn.reghao.autodop.dmaster.app.model.po.config.build.CompilerConfig;
import cn.reghao.autodop.dmaster.app.model.po.config.build.PackerConfig;
import cn.reghao.autodop.dmaster.app.model.po.config.build.RepoAuthConfig;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 *
 * @author reghao
 * @date 2020-01-21 14:53:03
 */
public interface AppConfigRepository extends JpaRepository<AppConfig, Integer>, JpaSpecificationExecutor<AppConfig> {
    AppConfig findByAppId(String appId);
    AppConfig findByIsDeleteFalseAndAppId(String appId);
    Page<AppConfig> findByEnv(String env, Pageable pageable);

    List<AppConfig> findAllByRepoAuthConfig(RepoAuthConfig repoAuthConfig);
    List<AppConfig> findAllByCompilerConfig(CompilerConfig compilerConfig);
    List<AppConfig> findAllByPackerConfig(PackerConfig packerConfig);
}
