package com.tsi.monitoring.controller;

import com.tsi.monitoring.service.ReportService;
import com.tsi.monitoring.vo.ReportVo;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/report")
@Slf4j
public class ReportController {
    private final ReportService reportService;

    @PostMapping("/{type}/download")
    public ResponseEntity<byte[]> download(@PathVariable String type, @RequestBody Map<String, Object> paramMap) {
        return this.reportService.getReport(type, paramMap);
    }
}
