package com.ruoyi.platform.service;



import com.ruoyi.platform.domain.Dataset;
import com.ruoyi.platform.domain.Models;
import com.ruoyi.platform.domain.ModelsVersion;
import com.ruoyi.platform.vo.ModelsVo;
import org.springframework.core.io.InputStreamResource;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * (Models)表服务接口
 *
 * @author Xidaray
 * @since 2023-11-28 16:26:07
 */
public interface ModelsService {

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

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

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

    /**
     * 修改数据
     *
     * @param models 实例对象
     * @return 实例对象
     */
    Models update(Models models);


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

    String removeById(Integer id) throws Exception;

    ResponseEntity<InputStreamResource> downloadModels(Integer id) throws Exception;



    List<Map<String, String>> uploadModels(MultipartFile[] files, String uuid) throws Exception;

    Map uploadModelsPipeline(ModelsVersion modelsVersion) throws Exception;

    ResponseEntity<InputStreamResource> downloadAllModelFiles(Integer modelsId, String version) throws Exception;
    List<String> getModelVersions(Integer modelId) throws Exception;

    String insertModelAndVersion(ModelsVo modelsVo) throws Exception;

    String readFileContent(Integer modelsId, String version) throws Exception;

    public void checkDeclaredName(Models insert) throws Exception;

    List<Map<String, String>> exportModels(String path, String uuid) throws Exception;
}
