package com.sunxung.factoring.service.sys;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunxung.factoring.component.enums.FileBusinessInterface;
import com.sunxung.factoring.entity.sys.FileStorageDO;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface FileService extends IService<FileStorageDO> {

    FileStorageDO uploadFile(HttpServletRequest request, FileBusinessInterface fileBusinessEnum);

    List<FileStorageDO> uploadFiles(HttpServletRequest request, List<FileBusinessInterface> list);

    List<FileStorageDO> findByBusinessId(Long businessId, String businessType);

    FileStorageDO findOneByBusinessId(Long businessId, String businessType);

    void updateBusinessId(List<Long> fileIds, Long businessId);

    void updateBusinessId(Long fileId, Long businessId);

    /**
     * 该接口 只能删除 图片上传人 和  操作人 一致的 数据
     * @param id
     */
    void delete(Long id);

    ResponseEntity<Object> downloadFile(Long id,HttpServletResponse res);
}
