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.schcollector.AddSchCollectorDTO;
import com.docus.server.dto.scheduling.management.schcollector.DeleteSchCollectorDTO;
import com.docus.server.dto.scheduling.management.schcollector.EditSchCollectorDTO;
import com.docus.server.dto.scheduling.management.schcollector.UpdateSchCollectorDTO;
import com.docus.server.vo.scheduling.management.schcollector.LoadSchCollectorVO;
import com.docus.server.vo.scheduling.management.schcollector.SchCollectorVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
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 java.util.List;


/**
 * 采集器管理 API
 *
 * @author AutoGenerator
 * @since 2023-07-15
 */

@FeignClient(value = "collector-scheduling-management", contextId = "collector-scheduling-management.SchCollectorApi")
@RequestMapping("/sch/collector")
public interface SchCollectorApi {
    /**
     * 按主键查询
     *
     * @return 实体
     */

    @GetMapping("/find/all")
    List<LoadSchCollectorVO> findAll();

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

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

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

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

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

    @PostMapping("/add")
    boolean add(@RequestBody AddSchCollectorDTO addSchCollectorDTO);

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

    @PutMapping("/edit")
    boolean edit(@RequestBody EditSchCollectorDTO editSchCollectorDTO);

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

    @DeleteMapping("/delete")
    int delete(@RequestBody DeleteSchCollectorDTO deleteSchCollectorDTO);

    /**
     * 选为当前版本并更新
     *
     * @param updateDTO 版本更新参数
     * @return 成功或失败
     */

    @PutMapping("/updateVersion")
    boolean updateVersion(@RequestBody UpdateSchCollectorDTO updateDTO);
}
