提交 | 用户 | age
|
d1f230
|
1 |
package com.hx.phip; |
F |
2 |
|
|
3 |
|
|
4 |
import com.hx.auto.GeneratorUtil; |
|
5 |
import com.hx.auto.common.UrlData; |
2a45d4
|
6 |
import com.hx.phiappt.model.consume.ConsumePay; |
C |
7 |
import com.hx.phiappt.model.consume.ConsumePayItem; |
|
8 |
import com.hx.phiappt.model.consume.ConsumePayItemSon; |
227b3e
|
9 |
import com.hx.phiappt.model.project.ProjectShopPrice; |
2a45d4
|
10 |
import com.hx.phiappt.model.refund.*; |
c531bf
|
11 |
import com.hx.phiappt.model.user.UserProjectDirectRecord; |
a4078b
|
12 |
import com.hx.phiappt.model.user.UserProjectItem; |
2252d0
|
13 |
import com.hx.phiappt.model.user.UserProjectUsed; |
d1f230
|
14 |
|
F |
15 |
/** |
|
16 |
* 自动生成工具 |
|
17 |
* 2019-08-29 |
|
18 |
* @author cjh |
|
19 |
* |
|
20 |
*/ |
|
21 |
public class AutoDomeUtil { |
|
22 |
|
|
23 |
public static void main(String[] args) throws Exception { |
|
24 |
|
|
25 |
System.out.println("开始"); |
|
26 |
String packageName = AutoDomeUtil.class.getPackage().getName(); |
|
27 |
|
|
28 |
String commonPackRoot = "phi_platform_common.src.main.java"; |
|
29 |
String commonPackRootResourse = "phi_platform_common.src.main.resources"; |
|
30 |
|
|
31 |
String controllerPackRoot = "phi_platform_common.src.main.java"; |
|
32 |
String controllerPackRootResourse = "phi_platform_common.src.main.resources"; |
|
33 |
|
|
34 |
UrlData urlData = new UrlData(); |
|
35 |
urlData.setTotalUrl(packageName); |
|
36 |
urlData.actionUrlData(controllerPackRoot,packageName + ".controller"); |
|
37 |
urlData.daoUrlData(commonPackRoot,packageName + ".dao.mapper"); |
|
38 |
urlData.serviceUrlData(controllerPackRoot,packageName + ".service"); |
|
39 |
urlData.serviceImplUrlData(controllerPackRoot,packageName + ".service.impl"); |
|
40 |
urlData.mapperUrlData(commonPackRootResourse, "mapper.platform"); |
|
41 |
|
2a45d4
|
42 |
Class<?> clas = RefundRecordItemMethod.class; |
d1f230
|
43 |
//dao |
F |
44 |
GeneratorUtil.generatorDao(clas,urlData); |
|
45 |
//mapper |
|
46 |
GeneratorUtil.generatorMapper(clas, urlData); |
|
47 |
// 生成service |
|
48 |
//GeneratorUtil.generatorService(clas,urlData); |
|
49 |
|
|
50 |
//通过实体类的包获取所有的表,直接全部生成 |
|
51 |
//GeneratorUtil.generatorTableByPackUrl("com.hx.model", urlData); |
|
52 |
//generatorTableByPackUrl(packPath, urlData); |
|
53 |
|
|
54 |
/*Class cl = TestM2.class; |
|
55 |
Field[] fields = cl.getDeclaredFields(); |
|
56 |
for(Field field:fields) { |
|
57 |
System.out.println("field.getName():"+field.getName()); |
|
58 |
System.out.println("field.getType():"+field.getType()); |
|
59 |
System.out.println("field.getGenericType():"+field.getGenericType()); |
|
60 |
System.out.println("field.getModifiers():"+field.getModifiers()); |
|
61 |
}*/ |
|
62 |
|
|
63 |
//StringBuffer stringBuffer = SimpleToolUtil.getFileContent("com/cjh/auto/file/test.txt"); |
|
64 |
//System.out.println("stringBuffer:"+stringBuffer); |
|
65 |
|
|
66 |
//System.out.println(AesUtil.aesEncryp("88.88")); |
|
67 |
} |
|
68 |
|
|
69 |
} |