chenjiahe
2023-04-02 2a45d42cebd76d0f0add392c0e06d2cbbb36c63f
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.hx.phip;
 
 
import com.hx.auto.GeneratorUtil;
import com.hx.auto.common.UrlData;
import com.hx.phiappt.model.consume.ConsumePay;
import com.hx.phiappt.model.consume.ConsumePayItem;
import com.hx.phiappt.model.consume.ConsumePayItemSon;
import com.hx.phiappt.model.project.ProjectShopPrice;
import com.hx.phiappt.model.refund.*;
import com.hx.phiappt.model.user.UserProjectDirectRecord;
import com.hx.phiappt.model.user.UserProjectItem;
import com.hx.phiappt.model.user.UserProjectUsed;
 
/**
 * 自动生成工具 
 * 2019-08-29
 * @author cjh
 *
 */
public class AutoDomeUtil {
    
    public static void main(String[] args) throws Exception {
 
        System.out.println("开始");
        String packageName = AutoDomeUtil.class.getPackage().getName();
 
        String commonPackRoot = "phi_platform_common.src.main.java";
        String commonPackRootResourse = "phi_platform_common.src.main.resources";
 
        String controllerPackRoot = "phi_platform_common.src.main.java";
        String controllerPackRootResourse = "phi_platform_common.src.main.resources";
 
        UrlData urlData = new UrlData();
        urlData.setTotalUrl(packageName);
        urlData.actionUrlData(controllerPackRoot,packageName + ".controller");
        urlData.daoUrlData(commonPackRoot,packageName + ".dao.mapper");
        urlData.serviceUrlData(controllerPackRoot,packageName + ".service");
        urlData.serviceImplUrlData(controllerPackRoot,packageName + ".service.impl");
        urlData.mapperUrlData(commonPackRootResourse, "mapper.platform");
 
        Class<?> clas = RefundRecordItemMethod.class;
        //dao
         GeneratorUtil.generatorDao(clas,urlData);
        //mapper
         GeneratorUtil.generatorMapper(clas, urlData);
        // 生成service
        //GeneratorUtil.generatorService(clas,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);
 
        //System.out.println(AesUtil.aesEncryp("88.88"));
    }
 
}