package cn.reghao.bnt.web.devops.app.db.query;

import cn.reghao.bnt.common.agent.app.dto.AppInfo;
import cn.reghao.bnt.web.devops.app.model.po.config.AppConfig;
import cn.reghao.bnt.web.devops.app.model.po.config.AppDeployConfig;
import cn.reghao.bnt.web.devops.app.model.vo.AppDeployingNodeVO;
import cn.reghao.bnt.web.devops.app.model.vo.AppRunning;
import cn.reghao.bnt.web.devops.app.model.vo.AppRunningNode;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author reghao
 * @date 2021-06-02 15:01:18
 */
public interface AppDeployQuery {
    List<AppDeployConfig> getByAppId(String appId);
    List<AppDeployingNodeVO> get(String appId);
    List<AppInfo> getAppsByMachineId(String machineId);
    AppDeployConfig getByAppIdAndMachineId(String appId, String machineId);
    boolean isDeploying(String appId, String machineId);
    int countByApp(AppConfig appConfig);

    Page<AppRunning> getAppRunningByPage(String env, String appType, Pageable pageable);
    List<AppRunningNode> getAppRunning(String appId);
    int getAppRunningCountByBuildLogId(String buildLogId);
}
