全部
This commit is contained in:
@ -81,22 +81,22 @@ public class MilitaryLibraryController {
|
||||
if (!parentDir.exists()) {
|
||||
boolean mkdirsSuccess = parentDir.mkdirs();
|
||||
if (!mkdirsSuccess) {
|
||||
return ApiResponse.failure("创建父目录失败:" + folderPath);
|
||||
return ApiResponse.failure("创建父目录失败: " + folderPath);
|
||||
}
|
||||
}
|
||||
|
||||
// 校验军标库文件是否已存在
|
||||
if (militaryFile.exists()) {
|
||||
if (militaryFile.isDirectory()) {
|
||||
return ApiResponse.failure("同名目录已存在、无法创建文件:" + militaryPath);
|
||||
return ApiResponse.failure("同名目录已存在、无法创建文件: " + militaryPath);
|
||||
}
|
||||
return ApiResponse.failure("军标库文件已存在:" + militaryPath);
|
||||
return ApiResponse.failure("军标库文件已存在: " + militaryPath);
|
||||
}
|
||||
|
||||
// 创建SQLite文件
|
||||
boolean createFileSuccess = militaryFile.createNewFile();
|
||||
if (!createFileSuccess) {
|
||||
return ApiResponse.failure("创建军标库文件失败:" + militaryPath);
|
||||
return ApiResponse.failure("创建军标库文件失败: " + militaryPath);
|
||||
}
|
||||
|
||||
// 初始化军标库表结构
|
||||
@ -105,7 +105,7 @@ public class MilitaryLibraryController {
|
||||
addMilitaryLibrary(militaryPath);
|
||||
return ApiResponse.success(null);
|
||||
} catch (Exception e) {
|
||||
return ApiResponse.failure("创建军标库失败:" + e.getMessage());
|
||||
return ApiResponse.failure("创建军标库失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,13 +117,13 @@ public class MilitaryLibraryController {
|
||||
// 校验路径是否存在
|
||||
File militaryFile = new File(militaryPath);
|
||||
if (!militaryFile.exists() || !militaryFile.isFile()) {
|
||||
return ApiResponse.failure("军标库文件不存在:" + militaryPath);
|
||||
return ApiResponse.failure("军标库文件不存在: " + militaryPath);
|
||||
}
|
||||
// 添加到配置表并启用
|
||||
addMilitaryLibrary(militaryPath);
|
||||
return ApiResponse.success(null);
|
||||
} catch (Exception e) {
|
||||
return ApiResponse.failure("导入军标库失败:" + e.getMessage());
|
||||
return ApiResponse.failure("导入军标库失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ public class MilitaryLibraryController {
|
||||
militaryPath, checkParentSql, parentParams, MilitaryType.class
|
||||
);
|
||||
if (parentType == null) {
|
||||
return ApiResponse.failure("父级军标类型不存在:" + parentId);
|
||||
return ApiResponse.failure("父级军标类型不存在: " + parentId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user