@@ -38,7 +38,6 @@ public static void main(String[] args) {
38
38
genCode ("输入表名" );
39
39
}
40
40
41
-
42
41
public static void genCode (String ... tableNames ) {
43
42
for (String tableName : tableNames ) {
44
43
//根据需求生成,不需要的注掉,模板有问题的话可以自己修改。
@@ -48,7 +47,6 @@ public static void genCode(String... tableNames) {
48
47
}
49
48
}
50
49
51
-
52
50
public static void genModelAndMapper (String tableName ) {
53
51
Context context = new Context (ModelType .FLAT );
54
52
context .setId ("Potato" );
@@ -155,7 +153,6 @@ public static void genController(String tableName) {
155
153
data .put ("modelNameLowerCamel" , tableNameConvertLowerCamel (tableName ));
156
154
data .put ("basePackage" , ProjectConstant .BASE_PACKAGE );
157
155
158
-
159
156
File file = new File (PROJECT_PATH + JAVA_PATH + PACKAGE_PATH_CONTROLLER + modelNameUpperCamel + "Controller.java" );
160
157
if (!file .getParentFile ().exists ()) {
161
158
file .getParentFile ().mkdirs ();
@@ -178,7 +175,6 @@ private static freemarker.template.Configuration getConfiguration() throws IOExc
178
175
return cfg ;
179
176
}
180
177
181
-
182
178
private static String tableNameConvertLowerCamel (String tableName ) {
183
179
StringBuilder result = new StringBuilder ();
184
180
if (tableName != null && tableName .length () > 0 ) {
@@ -206,7 +202,6 @@ private static String tableNameConvertUpperCamel(String tableName) {
206
202
207
203
}
208
204
209
-
210
205
private static String tableNameConvertMappingPath (String tableName ) {
211
206
return "/" + (tableName .contains ("_" ) ? tableName .replaceAll ("_" , "/" ) : tableName );
212
207
}
0 commit comments