From 5ac7c3bd5d42b5409953137657276618f2d634b1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 30 Mar 2022 21:54:45 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=20ProjectReactor=20=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/cn/iocoder/yudao/ProjectReactor.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index c92c4cb1b..e31eb4b67 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -31,7 +31,7 @@ public class ProjectReactor { String projectBaseDir = getProjectBaseDir(); // ========== 配置,需要你手动修改 ========== - String groupIdNew = "cn.huwing.boot"; + String groupIdNew = "cn.huwing.boot"; // TODO @seeker:这几个参数改回去原来的哈。 String artifactIdNew = "zdm"; String packageNameNew = "cn.huwing.zdm"; String titleNew = "测试名管理系统"; @@ -47,8 +47,8 @@ public class ProjectReactor { String content = replaceFileContent(file, groupIdNew, artifactIdNew, packageNameNew, titleNew); writeFile(file, content, projectBaseDir, projectBaseDirNew, packageNameNew, artifactIdNew); }); - long end = System.currentTimeMillis(); - log.info("[main][重写完成]共耗时:" + (end - start) / 1000 + "秒"); + long end = System.currentTimeMillis(); // TODO @seeker:直接减,不用增加变量 + log.info("[main][重写完成]共耗时:" + (end - start) / 1000 + "秒"); // TODO @seeker:logger 不要拼接字符串,用占位符 } private static String getProjectBaseDir() { @@ -59,7 +59,7 @@ public class ProjectReactor { Collection files = FileUtils.listFiles(new File(projectBaseDir), null, true); // 移除 IDEA Git GitHub 自身的文件; Node 编译出来的文件 files = files.stream() - .filter(file -> !file.getPath().contains("\\target\\") + .filter(file -> !file.getPath().contains("\\target\\") // TODO @seeker:使用 File.separator,也要考虑 mac && !file.getPath().contains("\\node_modules\\") && !file.getPath().contains("\\.idea\\") && !file.getPath().contains("\\.git\\") @@ -91,4 +91,4 @@ public class ProjectReactor { .replaceAll(StrUtil.upperFirst(ARTIFACT_ID), StrUtil.upperFirst(artifactIdNew)); FileUtil.writeUtf8String(fileContent, newPath); } -} \ No newline at end of file +}