chenjiahe
2024-01-19 d83d729f80576bb4c7e73bcfff5c403a23f23b82
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
70
71
72
73
74
75
package com.hx.phip;
 
 
import com.hx.auto.GeneratorUtil;
import com.hx.auto.common.UrlData;
import com.hx.phiappt.model.ComparePhotoRecord;
import com.hx.phiappt.model.ComparePhotoRecordPictures;
import com.hx.phiappt.model.appeal.AppealType;
import com.hx.phiappt.model.appeal.AppealTypeRelate;
import com.hx.phiappt.model.cardItem.CardEquity;
import com.hx.phiappt.model.consume.ConsumeNotify;
import com.hx.phiappt.model.consume.PayNo;
import com.hx.phiappt.model.market.system.MarketSystem;
import com.hx.phiappt.model.market.system.MarketSystemProject;
import com.hx.phiappt.model.order.*;
import com.hx.phiappt.model.project.ProjectShopPrice;
import com.hx.phiappt.model.refund.*;
import com.hx.phiappt.model.user.*;
import com.hx.phiappt.model.user.club.UserClubMember;
 
/**
 * 自动生成工具 
 * 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 = UserClubMember.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"));
    }
 
}