package com.ruoyi.platform.service;

import com.ruoyi.platform.domain.Experiment;
import com.ruoyi.platform.domain.Workflow;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;

import java.io.IOException;
import java.util.List;

/**
 * (Experiment)表服务接口
 *
 * @author makejava
 * @since 2023-10-18 13:37:48
 */
public interface ExperimentService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    Experiment queryById(Integer id) throws IOException;

    /**
     * 分页查询
     *
     * @param experiment  筛选条件
     * @param pageRequest 分页对象
     * @return 查询结果
     */
    Page<Experiment> queryByPage(Experiment experiment, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param experiment 实例对象
     * @return 实例对象
     */
    Experiment insert(Experiment experiment) throws Exception;

    /**
     * 修改数据
     *
     * @param experiment 实例对象
     * @return 实例对象
     */
    Experiment update(Experiment experiment) throws Exception;

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);
    String removeById(Integer id) throws Exception;
    Experiment runExperiment(Integer id) throws Exception;

    Experiment addAndRunExperiment(Experiment experiment) throws Exception;

    /**
     * 分页查询实验状态
     *
     * @param experiment  筛选条件
     * @param pageRequest 分页对象
     * @return 查询结果
     */
    Page<Experiment> selectStatus(Experiment experiment, PageRequest pageRequest) throws IOException;



    ResponseEntity<Experiment> showExperimentConfig(Experiment experiment);

    List<Experiment> queryByWorkflowId(Long id);

    void checkDeclaredName(Experiment insert) throws Exception;
}
