Commit b8c3b5a7150c3337f2c4d437a067e5d62fc7262c

Authored by 王明元
1 parent 66420a7b

2022年7月26日17:49:38 测试删除文件夹

fw-dalaran-server/src/main/java/cn/fw/dalaran/server/controller/app/OtherController.java
... ... @@ -85,7 +85,7 @@ public class OtherController {
85 85 @GetMapping("/mkdir")
86 86 public Message<Boolean> mkdir(@NotBlank(message = "请必须指定路径") String dir, @NotNull(message = "请必须指定操作类型") Integer type) {
87 87 File file = new File(dir);
88   - boolean result = false;
  88 + Boolean result = null;
89 89 String handleType = "";
90 90 if (Objects.equals(type, 1)) {
91 91 handleType = "创建";
... ... @@ -96,7 +96,7 @@ public class OtherController {
96 96 if (file.exists())
97 97 result = file.delete();
98 98 }
99   - log.info(String.format("%s文件夹, 路径为: %s, 结果为: %s", handleType, dir, result ? "成功" : "失败"));
  99 + log.info(String.format("%s文件夹, 路径为: %s, 结果为: %s", handleType, dir, Objects.isNull(result) ? "未执行" : (result ? "成功" : "失败")));
100 100 return success(result);
101 101 }
102 102  
... ...