package com.docus.server.api.archivefile;

import com.docus.infrastructure.web.request.SearchRequest;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.enums.CollectTypeEnum;
import com.docus.server.vo.archivefile.TaskMessageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
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.TaskMessageApi")
@RequestMapping("/collect/taskMessage")
public interface TaskMessageApi {

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

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

    /**
     * 查询范围批量重试
     *
     * @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;

    /**
     * 任务类型查询
     */
    @ApiOperation("任务类型查询")
    @GetMapping("/find/type")
    CollectTypeEnum[] findType();
}
