package com.om.controller.admin;


import com.om.entity.dto.DiaLogQueryPageDTO;
import com.om.entity.vo.DiaLogQueryPageVO;

import com.om.service.IDiagnosticLogService;
import com.om.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

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

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bmmx
 * @since 2024-02-27
 */
@RestController
@Api(tags = "诊断日志相关接口")
@RequestMapping("/web/diagnostic-log")
public class DiagnosticLogController {

    @Resource
    private IDiagnosticLogService diagnosticLogService;

    @ApiOperation("分页查询")
    @PostMapping("getPageList")
    public Result<DiaLogQueryPageVO> getPageList(@RequestBody DiaLogQueryPageDTO dto){
        return diagnosticLogService.getPageList(dto);
    }

    @ApiOperation("下载本页全部文件")
    @PostMapping("/batch-download")
    public Result batchDownload(@RequestBody List<Integer> ids){
        return diagnosticLogService.batchDownload(ids);
    }

    @ApiOperation("下载单个文件")
    @GetMapping("/downloadFile")
    public Result downloadFile(@RequestParam Integer id){
        return diagnosticLogService.downloadFile(id);
    }

    @ApiOperation("删除诊断日志")
    @GetMapping("delete")
    public Result delete(@RequestParam Integer id){
        return diagnosticLogService.delete(id);
    }





}
