liyong
3 天以前 d62a74c14a4002c0f401c94976fba8cc77cda6e1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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);
 
}