解决已知问题
This commit is contained in:
parent
ad39488e94
commit
5f52e7f020
|
|
@ -20,5 +20,5 @@ public interface FileSystemService {
|
|||
|
||||
boolean writeStringToFile(String filePath, String contents);
|
||||
|
||||
boolean deleteFile(String filePath);
|
||||
boolean deleteFile(String... filePaths);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,6 +417,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
|||
String tmpDir = uploadDataDir + currentUserId + File.separator + uuid + File.separator;
|
||||
ZipUtil.unzip(zipDirPath, tmpDir);
|
||||
update2Database(zipDirPath);
|
||||
fileSystemService.deleteFile(zipDirPath, destColibPath);
|
||||
return ElectromagneticResultUtil.success(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,10 @@ public class FileSystemServiceImpl implements FileSystemService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteFile(String filePath) {
|
||||
public boolean deleteFile(String... filePaths) {
|
||||
for (String filePath : filePaths) {
|
||||
FileUtil.del(filePath);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
//import cn.hutool.crypto.symmetric.AES;
|
||||
//import com.electromagnetic.industry.software.common.util.UserThreadLocal;
|
||||
//import com.electromagnetic.industry.software.manage.Application;
|
||||
//import com.electromagnetic.industry.software.manage.service.FileSystemService;
|
||||
//import com.electromagnetic.industry.software.manage.service.serviceimpl.EdFileInfoServiceImpl;
|
||||
//import org.junit.jupiter.api.Test;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
|
|
@ -24,6 +25,8 @@
|
|||
//
|
||||
// @Resource
|
||||
// private EdFileInfoServiceImpl edFileInfoServiceImpl;
|
||||
// @Resource
|
||||
// private FileSystemService fileSystemService;
|
||||
//
|
||||
// @Value("${file.security.passwd}")
|
||||
// private String password;
|
||||
|
|
@ -44,7 +47,7 @@
|
|||
// @Test
|
||||
// public void testImport() {
|
||||
// String currentUserId = UserThreadLocal.getUserId();
|
||||
// String destColibPath = "E:/tmp/C92934test.colib";
|
||||
// String destColibPath = "E:/tmp/测试沿用.colib";
|
||||
// String mainName = FileUtil.mainName(destColibPath);
|
||||
// String parentDir = FileUtil.getParent(destColibPath, 1);
|
||||
// String zipDirPath = parentDir + File.separator + mainName + ".zip";
|
||||
|
|
@ -64,6 +67,7 @@
|
|||
// ZipUtil.unzip(zipDirPath, tmpDir);
|
||||
//
|
||||
// edFileInfoServiceImpl.update2Database(tmpDir);
|
||||
// fileSystemService.deleteFile(zipDirPath, destColibPath);
|
||||
//
|
||||
// }
|
||||
//
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ public class UserThreadLocal {
|
|||
return userThread.get().getUserId();
|
||||
}
|
||||
|
||||
public static String getAdminType() {return userThread.get().getAdminType();}
|
||||
public static String getAdminType() {
|
||||
return userThread.get().getAdminType();
|
||||
}
|
||||
|
||||
public static void remove() {
|
||||
userThread.remove();
|
||||
|
|
|
|||
Loading…
Reference in New Issue