chenjiahe
2024-09-23 826b66207dafbce24f441cb83fed1b241a6fba27
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
44
45
46
47
48
49
50
51
52
53
package com.hx.auto;
 
import com.hx.auto.common.UrlData;
 
import java.util.Map;
 
/**
 * 自动生成工具 
 * 2019-08-29
 * @author cjh
 *
 */
public class AutoDomeUtil {
    
    public static void main(String[] args) throws Exception {
        System.out.println("开始");
        UrlData urlData = new UrlData();
        urlData.setTotalUrl("com.hx");
        urlData.actionUrlData("hx-web.src.main.java","com.hx.controller.admin");
        urlData.daoUrlData("hx-web.src.main.java","com.hx.dao.mapper");
        urlData.serviceUrlData("hx-web.src.main.java","com.hx.service");
        urlData.serviceImplUrlData("hx-web.src.main.java","com.hx.service.impl");
        urlData.mapperUrlData("hx-web.src.main.java", "com.hx.dao.mapperXml");
 
    /*
        //dao
        GeneratorUtil.generatorDao(SysAdmin.class,urlData);
        //mapper
        GeneratorUtil.generatorMapper(SysAdmin.class, urlData);
        //action
        GeneratorUtil.generatorAction(SysAdmin.class,urlData);
        // 生成service
        GeneratorUtil.generatorService(SysAdmin.class,urlData);
 
        //通过实体类的包获取所有的表,直接全部生成
        //GeneratorUtil.generatorTableByPackUrl("com.hx.model", urlData);
        */
        //generatorTableByPackUrl(packPath, urlData);
        
        /*Class cl = TestM2.class;
        Field[] fields = cl.getDeclaredFields();
        for(Field field:fields) {
            System.out.println("field.getName():"+field.getName());
            System.out.println("field.getType():"+field.getType());
            System.out.println("field.getGenericType():"+field.getGenericType());
            System.out.println("field.getModifiers():"+field.getModifiers());
        }*/
        
        //StringBuffer stringBuffer = SimpleToolUtil.getFileContent("com/cjh/auto/file/test.txt");
        //System.out.println("stringBuffer:"+stringBuffer);
    }
 
}