xiangpei
2025-04-18 ccadf9480d4e6a9dcc227a2a0b1f9ae0612e36fd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//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");
//    }
//}