package com.greenorange.promotion.service.file;

import com.greenorange.promotion.model.dto.fileInfo.UploadFileRequest;
import com.greenorange.promotion.model.entity.FileInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
* @author 35880
* @description 针对表【file_info(文件上传列表)】的数据库操作Service
* @createDate 2025-05-06 17:02:05
*/
public interface FileInfoService extends IService<FileInfo> {


    /**
     * 校验文件
     */
    void validFile(MultipartFile multipartFile, UploadFileRequest uploadFileRequest);


    /**
     * 获取文件保存路径
     */
    String uploadFile(MultipartFile multipartFile, UploadFileRequest uploadFileRequest) throws IOException;


    /**
     * 文件下载
     */
    void downloadFile(String filename, HttpServletResponse response) throws IOException;
}
