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.SchCollectorVersionApi;
import com.docus.server.dto.scheduling.management.schcollectorversion.AddSchCollectorVersionDTO;
import com.docus.server.dto.scheduling.management.schcollectorversion.DeleteSchCollectorVersionDTO;
import com.docus.server.dto.scheduling.management.schcollectorversion.EditSchCollectorVersionDTO;
import com.docus.server.service.ISchCollectorService;
import com.docus.server.service.ISchCollectorVersionService;
import com.docus.server.vo.scheduling.management.schcollectorversion.SchCollectorVersionVO;
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 SchCollectorVersionController implements SchCollectorVersionApi {
    @Resource
    private ISchCollectorVersionService iSchCollectorVersionService;
    @Resource
    private ISchCollectorService iSchCollectorService;

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

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

    /**
     * 新增
     *
     * @param addSchCollectorVersionDTO 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("新增")
    @Override
    public boolean add(AddSchCollectorVersionDTO addSchCollectorVersionDTO) {
        return iSchCollectorVersionService.add(addSchCollectorVersionDTO);
    }

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

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

}
