package com.docus.server.api.archivefile;

import com.docus.infrastructure.web.request.SearchRequest;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.entity.TaskConfig;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;


/**
 * API
 * Generated on 2023-06-28
 */
@Api(value = "主动消息任务管理接口", tags = "主动消息任务管理接口")
@FeignClient(value = "docus-collector-api", contextId = "docus-collector-api.TaskConfigApi")
@RequestMapping("/collect/taskConfig")
public interface TaskConfigApi {

    /**
     * 按主键查询
     *
     * @param id 主键id
     * @return 实体
     */
    @ApiOperation("按主键查询")
    @GetMapping("/find/{id}")
    TaskConfig find(@PathVariable(value = "id") String id);

    /**
     * 关键字搜素
     *
     * @param searchRequest 搜索参数
     * @return 分页列表
     */
    @ApiOperation("关键字搜素")
    @PostMapping("/search")
    PageResult<TaskConfig> search(@RequestBody SearchRequest searchRequest);

    /**
     * 新增或编辑
     *
     * @param taskConfig 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("新增或编辑")
    @PostMapping("/saveOrUpdate")
    boolean saveOrUpdate(@RequestBody TaskConfig taskConfig);

    /**
     * 批量删除
     *
     * @param ids 主键ids
     * @return 成功或失败
     */
    @ApiOperation("批量删除")
    @DeleteMapping("/delete")
    int delete(@RequestBody List<Long> ids);

    /**
     * 查询范围批量重试
     *
     * @param searchRequest 搜索参数
     */
    @ApiOperation("查询范围批量重试")
    @PostMapping("/search/retry")
    void searchRetry(@RequestBody SearchRequest searchRequest) throws Exception;

    /**
     * 根据主键批量重试
     */
    @ApiOperation("根据主键批量重试")
    @PostMapping("/find/retry")
    void findRetry(@RequestBody List<Long> ids) throws Exception;
}
