package cd.casic.ci.process.process.service.target;


import cd.casic.ci.process.dto.req.target.*;
import cd.casic.ci.process.dto.resp.sftpFile.FileBase64DownloadResp;
import cd.casic.ci.process.dto.resp.target.TargetManagerResp;
import cd.casic.ci.process.process.dataObject.base.BaseIdReq;
import cd.casic.ci.process.process.dataObject.target.TargetManager;
import cd.casic.ci.process.util.SftpUploadUtil;
import cd.casic.framework.commons.pojo.PageResult;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.Valid;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author HopeLi
 * @version v1.0
 * @ClassName TargetManagerService
 * @Date: 2025/5/17 10:20
 * @Description:
 */
public interface TargetManagerService extends IService<TargetManager> {
    void createTarget(@Valid TargetManagerCreateReq req);

    void updateTarget(@Valid TargetManagerUpdateReq req);

    void deleteTarget(@Valid BaseIdReq req);

    PageResult<TargetManagerResp> findTargetPage(@Valid TargetQueryReq query);

    List<TargetManagerResp> findTargetList(@Valid TargetQueryReq query);

    String fileUpload(MultipartFile file) throws SftpUploadUtil.SftpUploadException;

    void createVersion(@Valid TargetVersionCreateReq req);

    void deleteVersion(@Valid BaseIdReq req);

    void updateVersion(@Valid TargetVersionUpdateReq req);

    void fileDownload(@Valid BaseIdReq req, HttpServletResponse response);

    FileBase64DownloadResp zipDownload(@Valid BaseIdReq req, HttpServletResponse response);
}
