package com.ruoyi.platform.service;

import com.ruoyi.platform.domain.Service;
import com.ruoyi.platform.domain.ServiceVersion;
import com.ruoyi.platform.vo.serviceVos.ServiceVersionVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

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

public interface ServiceService {
    Page<Service> queryByPageService(Service service, PageRequest pageRequest) throws IOException;

    Page<ServiceVersionVo> queryByPageServiceVersion(ServiceVersion serviceVersion, int page, int size) throws IOException;

    Service addService(Service service);

    ServiceVersion addServiceVersion(ServiceVersionVo serviceVersionVo) throws Exception;

    Service editService(Service service);

    String editServiceVersion(ServiceVersionVo serviceVersionVo) throws Exception;

    Service getService(Long id);

    ServiceVersionVo getServiceVersion(Long id) throws IOException;

    Map<String, Object> serviceVersionCompare(Long id1, Long id2) throws IllegalAccessException, IOException;

    String deleteService(Long id) throws Exception;

    String deleteServiceVersion(Long id);

    String runServiceVersion(Long id) throws Exception;

    String stopServiceVersion(Long id);

    String updateServiceVersion(ServiceVersion serviceVersion, Boolean reRun) throws Exception;

    HashMap<String, String> getServiceVersionLog(Long id, String startTime, String endTime);

    Map<String, Object> getServiceVersionDocs(Long id);

    List<ServiceVersion> serviceVersionList(Long id);

    Map<String, String> getRunState(List<String> deploymentNames);

    void updateRunState(Map<String, String> runStates, List<ServiceVersion> serviceVersionList);
}
