package com.docus.server.api.scheduling.management;

import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.dto.scheduling.management.schcollectorversionfile.AddSchCollectorVersionFileDTO;
import com.docus.server.dto.scheduling.management.schcollectorversionfile.DeleteSchCollectorVersionFileDTO;
import com.docus.server.dto.scheduling.management.schcollectorversionfile.EditSchCollectorVersionFileDTO;
import com.docus.server.vo.scheduling.management.schcollectorversionfile.SchCollectorVersionFileVO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;


/**
 * 采集器版本列表更新包管理 API
 *
 * @author AutoGenerator
 * @since 2023-07-15
 */

@FeignClient(value = "collector-scheduling-management", contextId = "collector-scheduling-management.SchCollectorVersionFileApi")
@RequestMapping("/sch/collectorVersionFile")
public interface SchCollectorVersionFileApi {

    /**
     * 按主键查询
     *
     * @param id 主键id
     * @return 实体
     */

    @GetMapping("/find/{id}")
    SchCollectorVersionFileVO findById(@PathVariable(value = "id") String id);

    /**
     * 关键字搜索
     *
     * @param searchDTO 搜索参数
     * @return 分页列表
     */

    @PostMapping("/search")
    PageResult<SchCollectorVersionFileVO> search(@RequestBody SearchDTO searchDTO);

    /**
     * 新增
     *
     * @param addSchCollectorVersionFileDTO 新增参数
     * @return 成功或失败
     */

    @PostMapping("/add")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "files", value = "文件", required = true, dataTypeClass = MultipartFile.class)
    })
    boolean add(@Validated AddSchCollectorVersionFileDTO addSchCollectorVersionFileDTO, @RequestPart("files") MultipartFile[] multipartFiles) throws Exception;

    /**
     * 编辑
     *
     * @param editSchCollectorVersionFileDTO 编辑参数
     * @return 成功或失败
     */

    @PutMapping("/edit")
    boolean edit(@RequestBody EditSchCollectorVersionFileDTO editSchCollectorVersionFileDTO);

    /**
     * 批量删除
     *
     * @param deleteSchCollectorVersionFileDTO 删除参数
     * @return 成功或失败
     */

    @DeleteMapping("/delete")
    int delete(@RequestBody DeleteSchCollectorVersionFileDTO deleteSchCollectorVersionFileDTO);
}
