package com.docus.server.controller;

import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.api.segmentation.OcrSpecialRuleTestApi;
import com.docus.server.dto.segmentation.ocrspecialruletest.AddOcrSpecialRuleTestDTO;
import com.docus.server.dto.segmentation.ocrspecialruletest.DeleteOcrSpecialRuleTestDTO;
import com.docus.server.dto.segmentation.ocrspecialruletest.EditOcrSpecialRuleTestDTO;
import com.docus.server.service.IOcrSpecialRuleTestService;
import com.docus.server.vo.segmentation.ocrspecialruletest.OcrSpecialRuleTestVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 特殊策略表-调试 控制器类
 *
 * @author AutoGenerator
 * @since 2023-08-29
 */
@Api(value = "特殊策略表-调试", tags = "特殊策略表-调试")
@RestController
public class OcrSpecialRuleTestController implements OcrSpecialRuleTestApi {
    @Resource
    private IOcrSpecialRuleTestService iOcrSpecialRuleTestService;

    /**
     * 按主键查询
     *
     * @param id 主键Id
     * @return 实体
     */
    @ApiOperation("按主键查询")
    @Override
    public OcrSpecialRuleTestVO findById(Long id) {
        return iOcrSpecialRuleTestService.findById(id);
    }

    /**
     * 查询所有
     *
     * @return 实体
     */
    @ApiOperation("查询所有")
    @Override
    public List<OcrSpecialRuleTestVO> findAll() {
        return iOcrSpecialRuleTestService.findAll();
    }

    /**
     * 关键字搜索
     *
     * @param searchDTO 搜索参数
     * @return 分页列表
     */
    @ApiOperation("关键字搜索")
    @Override
    public PageResult<OcrSpecialRuleTestVO> search(SearchDTO searchDTO) {
        return iOcrSpecialRuleTestService.search(searchDTO);
    }

    /**
     * 新增
     *
     * @param addOcrSpecialRuleTestDTO 编辑参数
     */
    @ApiOperation("新增")
    @Override
    public void add(AddOcrSpecialRuleTestDTO addOcrSpecialRuleTestDTO) {
        iOcrSpecialRuleTestService.add(addOcrSpecialRuleTestDTO);
    }

    /**
     * 编辑
     *
     * @param editOcrSpecialRuleTestDTO 编辑参数
     */
    @ApiOperation("编辑")
    @Override
    public void edit(EditOcrSpecialRuleTestDTO editOcrSpecialRuleTestDTO) {
        iOcrSpecialRuleTestService.edit(editOcrSpecialRuleTestDTO);
    }

    /**
     * 批量删除
     *
     * @param deleteOcrSpecialRuleTestDTO 删除参数
     * @return 成功或失败
     */
    @ApiOperation("批量删除")
    @Override
    public int delete(DeleteOcrSpecialRuleTestDTO deleteOcrSpecialRuleTestDTO) {
        return iOcrSpecialRuleTestService.delete(deleteOcrSpecialRuleTestDTO);
    }
}
