11 小时以前 2b8f88856e90e530ddbfce88aea107a0ec894d5d
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
package cn.iocoder.yudao.module.system.api.storage;
 
import cn.iocoder.yudao.module.system.api.storage.dto.StorageBlobRespDTO;
 
import java.util.List;
 
public interface StorageAttachmentApi {
 
    void bindAttachments(String application, String recordType, Long recordId, List<Long> blobIds);
 
    /**
     * 增量更新附件关联:
     * - 查询现有附件,对比新旧 blobId,只删除多余、只绑定新增
     * - 如果新旧一致,不做任何操作
     *
     * @param application 应用用途
     * @param recordType  业务记录类型
     * @param recordId    业务记录 ID
     * @param newBlobIds  新的 blobId 列表(为 null 时跳过,不做任何操作)
     */
    void updateAttachments(String application, String recordType, Long recordId, List<Long> newBlobIds);
 
    List<StorageBlobRespDTO> listAttachments(String recordType, Long recordId);
 
    void deleteAttachments(List<Long> attachmentIds);
 
    void deleteAttachmentsByRecord(String recordType, Long recordId);
 
}