package com.docus.server.api.segmentation;

import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.dto.segmentation.ocrruletest.AddOcrRuleTestDTO;
import com.docus.server.dto.segmentation.ocrruletest.DeleteOcrRuleTestDTO;
import com.docus.server.dto.segmentation.ocrruletest.EditOcrRuleTestDTO;
import com.docus.server.entity.segmentation.OcrFileInfoTest;
import com.docus.server.vo.segmentation.ocrruletest.OcrRuleTestVO;
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-08-29
 */
@FeignClient(value = "docus-segmentation", contextId = "docus-segmentation.OcrRuleTestApi")
@RequestMapping("/ocr/RuleTest")
public interface OcrRuleTestApi {



    @GetMapping("/start/{id}")
    List<OcrFileInfoTest> start (@PathVariable(value = "id") String id);

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

    /**
     * 查询所有
     *
     * @return 实体
     */
    @GetMapping("/findAll")
    List<OcrRuleTestVO> findAll();

    /**
     * 关键字搜索
     *
     * @param searchDTO 搜索参数
     * @return 分页列表
     */
    @PostMapping("/search")
    PageResult<OcrRuleTestVO> search(@RequestBody SearchDTO searchDTO);

    /**
     * 新增
     *
     * @param addOcrRuleTestDTO 新增参数
     */
    @PostMapping("/add")
    void add(@RequestBody AddOcrRuleTestDTO addOcrRuleTestDTO);

    /**
     * 编辑
     *
     * @param editOcrRuleTestDTO 编辑参数
     */
    @PutMapping("/edit")
    void edit(@RequestBody EditOcrRuleTestDTO editOcrRuleTestDTO);

    /**
     * 删除后保存
     *
     * @param editOcrRuleTestDTOList 编辑参数
     */
    @PutMapping("/deleteAndAdd")
    void deleteAndAdd(@RequestBody List<EditOcrRuleTestDTO> editOcrRuleTestDTOList);

    /**
     * 批量删除
     *
     * @param deleteOcrRuleTestDTO 删除参数
     * @return 成功或失败
     */
    @DeleteMapping("/delete")
    int delete(@RequestBody DeleteOcrRuleTestDTO deleteOcrRuleTestDTO);
}
