fix(SDK): 修改File工具类的实例方式

修改File工具类的实例方式
This commit is contained in:
song-tianyang 2023-02-16 15:54:00 +08:00 committed by 建国
parent 1a868ebc34
commit 4860d72af6
1 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,6 @@
package io.metersphere.metadata.service;
import com.alibaba.nacos.common.utils.ByteUtils;
import groovy.lang.Lazy;
import io.metersphere.base.domain.*;
import io.metersphere.base.mapper.FileAssociationMapper;
import io.metersphere.base.mapper.FileContentMapper;
@ -58,10 +57,13 @@ public class FileMetadataService {
@Resource
private FileAssociationMapper fileAssociationMapper;
@Lazy
@Resource
private TemporaryFileUtil temporaryFileUtil;
public FileMetadataService() {
super();
temporaryFileUtil = new TemporaryFileUtil(TemporaryFileUtil.MS_FILE_FOLDER);
}
public List<FileMetadata> create(FileMetadataCreateRequest fileMetadata, List<MultipartFile> files) {
List<FileMetadata> result = new ArrayList<>();
if (fileMetadata == null) {
@ -612,7 +614,6 @@ public class FileMetadataService {
}
public void downloadByAttachmentBodyFileList(List<AttachmentBodyFile> downloadFileList) {
LogUtil.info(JSON.toJSONString(downloadFileList) + " 获取执行文件开始");
List<FileRequest> downloadFileRequest = new ArrayList<>();
downloadFileList.forEach(attachmentBodyFile -> {