package com.docus.server.controller;

import com.docus.infrastructure.web.request.SearchRequest;
import com.docus.infrastructure.web.response.PageResult;
import com.docus.server.api.scheduling.management.SchCollectorVersionFileApi;
import com.docus.server.dto.scheduling.management.SchCollectorVersionFileDTO;
import com.docus.server.service.ISchCollectorVersionFileService;
import com.docus.server.vo.scheduling.management.SchCollectorVersionFileVO;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * 采集器版本列表更新包管理 控制器类
 *
 * @author AutoGenerator
 * @since 2023-07-14
 */
@RestController
public class SchCollectorVersionFileController implements SchCollectorVersionFileApi {
    @Resource
    private ISchCollectorVersionFileService iSchCollectorVersionFileService;

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

    /**
     * 关键字搜素
     *
     * @param searchRequest 搜索参数
     * @return 分页列表
     */
    @Override
    public PageResult<SchCollectorVersionFileVO> search(SearchRequest searchRequest) {
        return iSchCollectorVersionFileService.search(searchRequest);
    }

    /**
     * 新增
     *
     * @param schCollectorVersionFileDTO 编辑参数
     * @return 成功或失败
     */
    @Override
    public boolean add(SchCollectorVersionFileDTO schCollectorVersionFileDTO) {
        return iSchCollectorVersionFileService.add(schCollectorVersionFileDTO);
    }

    /**
     * 编辑
     *
     * @param schCollectorVersionFileDTO 编辑参数
     * @return 成功或失败
     */
    @Override
    public boolean edit(SchCollectorVersionFileDTO schCollectorVersionFileDTO) {
        return iSchCollectorVersionFileService.edit(schCollectorVersionFileDTO);
    }

    /**
     * 批量删除
     *
     * @param ids 主键ids
     * @return 成功或失败
     */
    @Override
    public int delete(List<String> ids) {
        return iSchCollectorVersionFileService.delete(ids);
    }
}
