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.SchVirtualLogApi;
import com.docus.server.dto.scheduling.management.schvirtuallog.AddSchVirtualLogDTO;
import com.docus.server.dto.scheduling.management.schvirtuallog.DeleteSchVirtualLogDTO;
import com.docus.server.dto.scheduling.management.schvirtuallog.EditSchVirtualLogDTO;
import com.docus.server.service.ISchVirtualLogService;
import com.docus.server.vo.scheduling.management.schvirtuallog.SchVirtualLogVO;
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 SchVirtualLogController implements SchVirtualLogApi {
    @Resource
    private ISchVirtualLogService iSchVirtualLogService;

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

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

    /**
     * 新增
     *
     * @param addSchVirtualLogDTO 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("新增")
    @Override
    public void add(AddSchVirtualLogDTO addSchVirtualLogDTO) {
        iSchVirtualLogService.add(addSchVirtualLogDTO);
    }

    /**
     * 编辑
     *
     * @param editSchVirtualLogDTO 编辑参数
     * @return 成功或失败
     */
    @ApiOperation("编辑")
    @Override
    public void edit(EditSchVirtualLogDTO editSchVirtualLogDTO) {
        iSchVirtualLogService.edit(editSchVirtualLogDTO);
    }

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