package cn.iocoder.yudao.module.system.service.storage;
|
|
import cn.iocoder.yudao.module.system.controller.admin.storage.vo.SystemStorageBlobRespVO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.storage.SystemStorageBlobDO;
|
import org.springframework.web.multipart.MultipartFile;
|
|
import java.io.File;
|
import java.util.List;
|
|
/**
|
* 文件主表 Service 接口
|
*
|
* @author 芋道源码
|
*/
|
public interface SystemStorageBlobService {
|
|
/**
|
* 上传文件
|
*
|
* @param files 文件列表
|
* @param isPublic 是否公共文件(true=永久有效,false=临时token控制)
|
* @return 上传结果(含预览/下载地址)
|
*/
|
List<SystemStorageBlobRespVO> upload(List<MultipartFile> files, Boolean isPublic);
|
|
/**
|
* 通过token获取文件
|
*
|
* @param fileName 唯一文件名
|
* @param token JWT token
|
* @return 文件对象
|
*/
|
File getFileByToken(String fileName, String token);
|
|
/**
|
* 通过publicKey获取公共文件
|
*
|
* @param fileName 唯一文件名
|
* @param publicKey 公共访问key
|
* @return 文件对象
|
*/
|
File getPublicFile(String fileName, String publicKey);
|
|
/**
|
* 获取下载时的原始文件名
|
*
|
* @param fileName 唯一文件名
|
* @return 原始文件名
|
*/
|
String getDownloadFileName(String fileName);
|
|
/**
|
* 获得文件
|
*
|
* @param id 编号
|
* @return 文件
|
*/
|
SystemStorageBlobDO getStorageBlob(Long id);
|
|
/**
|
* 批量删除文件
|
*
|
* @param ids 编号列表
|
*/
|
void deleteStorageBlobs(List<Long> ids);
|
|
}
|