package com.tofly.feesapi.file.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tofly.feesapi.file.entity.File;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * 文件信息处理
 */
public interface IFileInfoService extends IService<File> {
    /**
     * 上传文件,并获取文件id,以 , 隔开
     */
    StringBuilder savafile(HttpServletRequest servletRequest, String filePathBean, String tableID, String tableName);
    
    List<File> savafile(HttpServletRequest servletRequest, String filePathBean);

    File saveFile(MultipartFile file, String filePathBean, String tableID, String tableName);

    StringBuilder saveFileList(List<MultipartFile> fileList, String filePathBean, String tableID, String tableName);

    StringBuilder saveFileList(List<MultipartFile> fileList, String filePath, String tableID, String tableName,String cwrq);

    StringBuilder saveFileList(List<MultipartFile> fileList, String filePathBean, String tableID, String tableName, String yhbh, String notice);

    /**
     * 根据文件id列表删除远程文件略表
     */
    Boolean removeFileListById(List<String> fileIdList);

    /**
     * 根据文件id列表获取文件路径列表
     */
    List<String> getFilePathList(List<BigDecimal> fileIdList);

    /**
     * 根据文件id列表获取文件对象
     */
    List<File> getFileList(List<BigDecimal> fileIdList);

    List<File> getFileList(LambdaQueryWrapper<File> queryWrapper);

    Page getFileList(Page page, String tableName, String tableIds);

    Boolean removeFileListByFile(List<File> fileList);

    void removeFileListByTableId(String tableId, String tableName);

    MultipartFile convertFileToMultipartFileFile(java.io.File file) throws IOException;
}
