chenjiahe
2024-09-23 826b66207dafbce24f441cb83fed1b241a6fba27
提交 | 用户 | age
826b66 1 package com.hx.auto;
C 2
3 import com.hx.auto.common.UrlData;
4
5 import java.util.Map;
6
7 /**
8  * 自动生成工具 
9  * 2019-08-29
10  * @author cjh
11  *
12  */
13 public class AutoDomeUtil {
14     
15     public static void main(String[] args) throws Exception {
16         System.out.println("开始");
17         UrlData urlData = new UrlData();
18         urlData.setTotalUrl("com.hx");
19         urlData.actionUrlData("hx-web.src.main.java","com.hx.controller.admin");
20         urlData.daoUrlData("hx-web.src.main.java","com.hx.dao.mapper");
21         urlData.serviceUrlData("hx-web.src.main.java","com.hx.service");
22         urlData.serviceImplUrlData("hx-web.src.main.java","com.hx.service.impl");
23         urlData.mapperUrlData("hx-web.src.main.java", "com.hx.dao.mapperXml");
24
25     /*
26         //dao
27         GeneratorUtil.generatorDao(SysAdmin.class,urlData);
28         //mapper
29         GeneratorUtil.generatorMapper(SysAdmin.class, urlData);
30         //action
31         GeneratorUtil.generatorAction(SysAdmin.class,urlData);
32         // 生成service
33         GeneratorUtil.generatorService(SysAdmin.class,urlData);
34
35         //通过实体类的包获取所有的表,直接全部生成
36         //GeneratorUtil.generatorTableByPackUrl("com.hx.model", urlData);
37         */
38         //generatorTableByPackUrl(packPath, urlData);
39         
40         /*Class cl = TestM2.class;
41         Field[] fields = cl.getDeclaredFields();
42         for(Field field:fields) {
43             System.out.println("field.getName():"+field.getName());
44             System.out.println("field.getType():"+field.getType());
45             System.out.println("field.getGenericType():"+field.getGenericType());
46             System.out.println("field.getModifiers():"+field.getModifiers());
47         }*/
48         
49         //StringBuffer stringBuffer = SimpleToolUtil.getFileContent("com/cjh/auto/file/test.txt");
50         //System.out.println("stringBuffer:"+stringBuffer);
51     }
52
53 }