package com.docus.server.controller;

import com.docus.infrastructure.web.request.SearchDTO;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.api.scheduling.management.SchCollectRecordRetryLogApi;
import com.docus.server.dto.scheduling.management.schcollectrecordretrylog.AddSchCollectRecordRetryLogDTO;
import com.docus.server.dto.scheduling.management.schcollectrecordretrylog.DeleteSchCollectRecordRetryLogDTO;
import com.docus.server.dto.scheduling.management.schcollectrecordretrylog.EditSchCollectRecordRetryLogDTO;
import com.docus.server.entity.scheduling.management.SchCollectRecordRetryLog;
import com.docus.server.service.ISchCollectRecordRetryLogService;
import com.docus.server.vo.scheduling.management.schcollectrecordretrylog.SchCollectRecordRetryLogVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 采集记录表重试表 控制器类
 *
 * @author AutoGenerator
 * @since 2023-07-15
 */
@Api(value = "采集记录表重试表管理接口", tags = "采集记录表重试表管理接口")
@RestController
public class SchCollectRecordRetryLogController implements SchCollectRecordRetryLogApi {
    @Resource
    private ISchCollectRecordRetryLogService iSchCollectRecordRetryLogService;

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

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

    /**
     * 新增
     *
     * @param addSchCollectRecordRetryLogDTO 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("新增")
    @Override
    public SchCollectRecordRetryLog add(AddSchCollectRecordRetryLogDTO addSchCollectRecordRetryLogDTO) {
        return iSchCollectRecordRetryLogService.add(addSchCollectRecordRetryLogDTO);
    }

    /**
     * 编辑
     *
     * @param editSchCollectRecordRetryLogDTO 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("编辑")
    @Override
    public boolean edit(EditSchCollectRecordRetryLogDTO editSchCollectRecordRetryLogDTO) {
        return iSchCollectRecordRetryLogService.edit(editSchCollectRecordRetryLogDTO);
    }

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