package top.tqx.demo_1.service;

import org.springframework.web.multipart.MultipartFile;
import top.tqx.demo_1.common.PageResult;
import top.tqx.demo_1.vo.FileVO;

import java.io.InputStream;

public interface FileService {

    FileVO uploadFile(MultipartFile file, Long userId, Long deptId, Integer userType, Long targetDeptId, Boolean isPublic);

    PageResult<FileVO> pageFiles(Integer pageNum, Integer pageSize, String fileName, top.tqx.demo_1.entity.User user);

    FileVO getFileById(Long id, top.tqx.demo_1.entity.User user);

    void deleteFile(Long id);
    
    byte[] getFileContent(Long id, top.tqx.demo_1.entity.User user);
    
    FileVO uploadStreamFromBackend(InputStream inputStream, String fileName, String fileType, Long userId, Long deptId) throws Exception;
    
    void updateFileDescription(Long fileId, String description);
    
    top.tqx.demo_1.entity.File getFileEntityById(Long id);
    
    void updateFileEntity(top.tqx.demo_1.entity.File file);
    
    void approveFile(Long fileId, Long auditorId);
    
    void rejectFile(Long fileId, Long auditorId);
    
    PageResult<FileVO> getPendingFiles(Integer pageNum, Integer pageSize);
}
