package incheon.cmm.g2f.download.service;

import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer; 
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;

public interface DownloadUtilService {
    Path createDownloadTempDirectory() throws IOException;
    
    Path createShapefileFromPostGIS(Path tempDir, String tableName, String layerName, int srid, String spceTy,
            List<Map<String, Object>> shapeData, String geomColumn) throws IOException;
    
    Path createDxfFile(Path tempDir, String layerName, 
                      Consumer<Consumer<Map<String, Object>>> dataProvider,
                      String columns) throws IOException;
    
    ResponseEntity<Resource> createFileDownloadResponse(Path filePath, String fileName) throws IOException;
    void cleanupDownloadFiles(Path tempDir) throws IOException;
    void validateTableName(String tableName);
    
    Path createCsvFile(Path tempDir, String layerName, List<Map<String, Object>> data, String columns)
            throws IOException;
    Path createExcelFile(Path tempDir, String layerName, List<Map<String, Object>> data, String columns)
            throws IOException;
    
    String sanitizeFileName(String name);
}