|
@@ -5,34 +5,11 @@
|
|
|
*/
|
|
|
package com.aizuda.generator;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
-
|
|
|
-import java.util.Scanner;
|
|
|
-
|
|
|
public class TestCodeGenerator {
|
|
|
- /**
|
|
|
- * 读取控制台输入内容
|
|
|
- */
|
|
|
- private static final Scanner scanner = new Scanner(System.in);
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
// 代码生成
|
|
|
- CodeGenerator.execute("jdbc:postgresql://8.142.167.145:5432/aizuda-boot",
|
|
|
- "postgres", "baomidou", "com.aizuda.boot.modules." + scannerNext("请输入模块名称"));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 控制台输入内容读取并打印提示信息
|
|
|
- *
|
|
|
- * @param message 提示信息
|
|
|
- */
|
|
|
- public static String scannerNext(String message) {
|
|
|
- System.out.println(message);
|
|
|
- String nextLine = scanner.nextLine();
|
|
|
- if (StringUtils.isBlank(nextLine)) {
|
|
|
- // 如果输入空行继续等待
|
|
|
- return scanner.next();
|
|
|
- }
|
|
|
- return nextLine;
|
|
|
+ CodeGenerator.execute("jdbc:postgresql://127.0.0.1:5432/aizuda",
|
|
|
+ "postgres", "123456", "com.aizuda.generate");
|
|
|
}
|
|
|
}
|