Skip to content

Commit

Permalink
update > optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
lihengming committed Jun 29, 2017
1 parent 87ed848 commit a70333b
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/test/java/CodeGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public static void main(String[] args) {
genCode("输入表名");
}


public static void genCode(String... tableNames) {
for (String tableName : tableNames) {
//根据需求生成,不需要的注掉,模板有问题的话可以自己修改。
Expand All @@ -48,7 +47,6 @@ public static void genCode(String... tableNames) {
}
}


public static void genModelAndMapper(String tableName) {
Context context = new Context(ModelType.FLAT);
context.setId("Potato");
Expand Down Expand Up @@ -155,7 +153,6 @@ public static void genController(String tableName) {
data.put("modelNameLowerCamel", tableNameConvertLowerCamel(tableName));
data.put("basePackage", ProjectConstant.BASE_PACKAGE);


File file = new File(PROJECT_PATH + JAVA_PATH + PACKAGE_PATH_CONTROLLER + modelNameUpperCamel + "Controller.java");
if (!file.getParentFile().exists()) {
file.getParentFile().mkdirs();
Expand All @@ -178,7 +175,6 @@ private static freemarker.template.Configuration getConfiguration() throws IOExc
return cfg;
}


private static String tableNameConvertLowerCamel(String tableName) {
StringBuilder result = new StringBuilder();
if (tableName != null && tableName.length() > 0) {
Expand Down Expand Up @@ -206,7 +202,6 @@ private static String tableNameConvertUpperCamel(String tableName) {

}


private static String tableNameConvertMappingPath(String tableName) {
return "/" + (tableName.contains("_") ? tableName.replaceAll("_", "/") : tableName);
}
Expand Down

0 comments on commit a70333b

Please sign in to comment.