9 小时以前 9bad721754fe8bbe2e5f459d0706e0fefac569f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package cn.iocoder.yudao.module.system.api.storage;
 
import cn.iocoder.yudao.module.system.controller.admin.storage.vo.SystemStorageBlobRespVO;
import cn.iocoder.yudao.module.system.service.storage.SystemStorageBlobService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
 
@Service
public class StorageBlobApiImpl implements StorageBlobApi {
 
    @Resource
    private SystemStorageBlobService systemStorageBlobService;
 
    @Override
    public Long saveBlob(byte[] content, String originalFileName, String contentType) {
        // 业务文件不进公共目录:走临时签名地址,与前端上传的默认行为保持一致
        SystemStorageBlobRespVO blob = systemStorageBlobService.saveBlob(content, originalFileName, contentType, false);
        return blob == null ? null : blob.getId();
    }
 
}