删除没有用到的代码
This commit is contained in:
parent
987e3be922
commit
0fd99a4dda
|
@ -4,18 +4,11 @@ import io.metersphere.base.domain.*;
|
||||||
import io.metersphere.base.mapper.FileContentMapper;
|
import io.metersphere.base.mapper.FileContentMapper;
|
||||||
import io.metersphere.base.mapper.FileMetadataMapper;
|
import io.metersphere.base.mapper.FileMetadataMapper;
|
||||||
import io.metersphere.base.mapper.LoadTestFileMapper;
|
import io.metersphere.base.mapper.LoadTestFileMapper;
|
||||||
import org.springframework.core.io.InputStreamResource;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@ -27,17 +20,6 @@ public class FileService {
|
||||||
@Resource
|
@Resource
|
||||||
private FileContentMapper fileContentMapper;
|
private FileContentMapper fileContentMapper;
|
||||||
|
|
||||||
// 将上传的文件保存在内存,方便测试
|
|
||||||
private Map<String, MultipartFile> fileMap = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
public void upload(String name, MultipartFile file) throws IOException {
|
|
||||||
String result = new BufferedReader(new InputStreamReader(file.getInputStream()))
|
|
||||||
.lines().collect(Collectors.joining("\n"));
|
|
||||||
System.out.println(String.format("upload file: %s, content: \n%s", name, result));
|
|
||||||
|
|
||||||
fileMap.put(name, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
public byte[] loadFileAsBytes(String id) {
|
public byte[] loadFileAsBytes(String id) {
|
||||||
FileContent fileContent = fileContentMapper.selectByPrimaryKey(id);
|
FileContent fileContent = fileContentMapper.selectByPrimaryKey(id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue