-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenMP.java
More file actions
60 lines (54 loc) · 2.41 KB
/
GenMP.java
File metadata and controls
60 lines (54 loc) · 2.41 KB
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
package com.spzx.product;
public class GenMP {
public static void main(String[] args) {
FastAutoGenerator.create("jdbc:mysql://192.168.100.131:3306/spzx-product?characterEncoding=utf-8&useSSL=false", "root", "root")
.globalConfig(builder -> builder
.author("atguigu")
.outputDir("D:/Code/javaCode/spzx/spzx-parent/spzx-modules/spzx-product/src/main/java")
.commentDate("yyyy-MM-dd")
.dateType(DateType.ONLY_DATE)
)
.packageConfig(builder -> builder
.parent("com.spzx.product")
.entity("domain")
.mapper("mapper")
.xml("mapper.product")
.service("service")
.serviceImpl("service.impl")
.controller("controller")
)
.strategyConfig(builder -> builder
.addInclude(
"brand",
"category",
"category_brand",
"product",
"product_details",
"product_sku",
"product_spec",
"product_unit",
"sku_stock") // 设置需要生成的表名
.entityBuilder()
.enableLombok()
.superClass(BaseEntity.class)
.addSuperEntityColumns(
"id",
"create_by",
"create_time",
"update_by",
"update_time",
"remark",
"del_flag")
//.enableFileOverride()
.serviceBuilder()
.formatServiceFileName("I%sService")
//.enableFileOverride()
.controllerBuilder()
.superClass(BaseController.class)
.enableRestStyle()
//.enableFileOverride()
)
.templateEngine(new FreemarkerTemplateEngine())
.execute();
}
}