//package com.monkeylessey.gen.gen;
|
//
|
//
|
//import com.monkeylessey.gen.utils.GenUtil;
|
//
|
//import java.io.IOException;
|
//import java.util.ArrayList;
|
//
|
///**
|
// * @author 29443
|
// * @date 2022/5/3
|
// */
|
//public class Test {
|
// public static void main(String[] args) throws IOException {
|
//// Properties prop = new Properties();
|
//// // 设置velocity模板的加载类
|
//// prop.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
|
//// // 初始化引擎
|
//// Velocity.init(prop);
|
//// // 获取velocity容器
|
//// VelocityContext velocityContext = new VelocityContext();
|
//// // 放入数据
|
//// velocityContext.put("packageName", "com.monkeylessey.xp");
|
//// velocityContext.put("className", "Xp");
|
//// ArrayList<String> strings = new ArrayList<>();
|
//// strings.add("name");
|
//// strings.add("age");
|
//// strings.add("sex");
|
//// velocityContext.put("columns", strings);
|
//// velocityContext.put("author", "29443");
|
//// velocityContext.put("dateTime", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
//// // 加载模板引擎
|
//// Template template = Velocity.getTemplate("templates/pojo.java.vm", "utf-8");
|
////
|
//// // 合并数据
|
//// FileWriter fileWriter = new FileWriter(System.getProperty("user.dir") + "\\xpstart-generator\\src\\main\\java\\com\\monkeylessey\\testgen\\Xp.java");
|
//// template.merge(velocityContext, fileWriter);
|
//// fileWriter.close();
|
// ArrayList<String> strings = new ArrayList<>();
|
// strings.add("sys_menu");
|
// GenUtil.plusGener(strings, "gen-demo");
|
// }
|
//}
|