【fix】对方法和局部变量重新命名
This commit is contained in:
+7
-7
@@ -54,12 +54,12 @@ public class CreateFileConfig {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder var1 = new StringBuilder();
|
||||
var1.append("{\"templateRootDirs\":\"");
|
||||
var1.append(this.fileList);
|
||||
var1.append("\",\"stylePath\":\"");
|
||||
var1.append(this.stylePath);
|
||||
var1.append("\"} ");
|
||||
return var1.toString();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("{\"templateRootDirs\":\"");
|
||||
sb.append(this.fileList);
|
||||
sb.append("\",\"stylePath\":\"");
|
||||
sb.append(this.stylePath);
|
||||
sb.append("\"} ");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
+12
-11
@@ -82,21 +82,22 @@ public class CodeGenerateOne extends BaseCodeGenerate implements IGenerate {
|
||||
return var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> generateCodeFile(String stylePath) throws Exception {
|
||||
log.debug("----jero---Code----Generation----[单表模型:" + this.tableVo.getTableName() + "]------- 生成中。。。");
|
||||
String var2 = com.jero.codegenerate.properties.CodeConfigProperties.f;
|
||||
Map var3 = this.getCodeGenerateConfig();
|
||||
String var4 = com.jero.codegenerate.properties.CodeConfigProperties.templateUrl;
|
||||
if (a(var4, "/").equals("jero/code-template")) {
|
||||
var4 = "/" + a(var4, "/") + "/one";
|
||||
com.jero.codegenerate.properties.CodeConfigProperties.b(var4);
|
||||
String projectPath = com.jero.codegenerate.properties.CodeConfigProperties.projectPath;
|
||||
Map codeGenerateConfig = this.getCodeGenerateConfig();
|
||||
String templateUrl = com.jero.codegenerate.properties.CodeConfigProperties.templateUrl;
|
||||
if (dealAndGetTemplateUrl(templateUrl, "/").equals("jero/code-template")) {
|
||||
templateUrl = "/" + dealAndGetTemplateUrl(templateUrl, "/") + "/one";
|
||||
com.jero.codegenerate.properties.CodeConfigProperties.b(templateUrl);
|
||||
}
|
||||
|
||||
CreateFileConfig var5 = new CreateFileConfig(var4);
|
||||
var5.setStylePath(stylePath);
|
||||
this.a(var5, var2, var3);
|
||||
CreateFileConfig createFileConfig = new CreateFileConfig(templateUrl);
|
||||
createFileConfig.setStylePath(stylePath);
|
||||
this.a(createFileConfig, projectPath, codeGenerateConfig);
|
||||
log.info(" ----- jero-boot ---- generate code success =======> 表名:" + this.tableVo.getTableName() + " ");
|
||||
return this.d;
|
||||
return this.list;
|
||||
}
|
||||
|
||||
public List<String> generateCodeFile(String projectPath, String templatePath, String stylePath) throws Exception {
|
||||
@@ -109,7 +110,7 @@ public class CodeGenerateOne extends BaseCodeGenerate implements IGenerate {
|
||||
}
|
||||
|
||||
this.generateCodeFile(stylePath);
|
||||
return this.d;
|
||||
return this.list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -124,11 +124,11 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
}
|
||||
|
||||
public List<String> generateCodeFile(String stylePath) throws Exception {
|
||||
String var2 = com.jero.codegenerate.properties.CodeConfigProperties.f;
|
||||
String var2 = com.jero.codegenerate.properties.CodeConfigProperties.projectPath;
|
||||
Map var3 = this.getCodeGenerateConfig();
|
||||
String var4 = com.jero.codegenerate.properties.CodeConfigProperties.templateUrl;
|
||||
if (a(var4, "/").equals("jero/code-template")) {
|
||||
var4 = "/" + a(var4, "/") + "/onetomany";
|
||||
if (dealAndGetTemplateUrl(var4, "/").equals("jero/code-template")) {
|
||||
var4 = "/" + dealAndGetTemplateUrl(var4, "/") + "/onetomany";
|
||||
com.jero.codegenerate.properties.CodeConfigProperties.b(var4);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
var5.setStylePath(stylePath);
|
||||
this.a(var5, var2, var3);
|
||||
log.info("----- jero-boot ---- generate code success =======> 主表名:" + this.mainTableVo.getTableName());
|
||||
return this.d;
|
||||
return this.list;
|
||||
}
|
||||
|
||||
public List<String> generateCodeFile(String projectPath, String templatePath, String stylePath) throws Exception {
|
||||
@@ -149,6 +149,6 @@ public class CodeGenerateOneToMany extends BaseCodeGenerate implements IGenerate
|
||||
}
|
||||
|
||||
this.generateCodeFile(stylePath);
|
||||
return this.d;
|
||||
return this.list;
|
||||
}
|
||||
}
|
||||
+24
-24
@@ -23,18 +23,18 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class BaseCodeGenerate {
|
||||
|
||||
protected static String c = "UTF-8";
|
||||
protected List<String> d = new ArrayList();
|
||||
protected static String charcterSet = "UTF-8";
|
||||
protected List<String> list = new ArrayList();
|
||||
|
||||
public BaseCodeGenerate() {
|
||||
}
|
||||
|
||||
protected void a(CreateFileConfig var1, String var2, Map<String, Object> var3) throws Exception {
|
||||
log.debug("--------generate----projectPath--------" + var2);
|
||||
protected void a(CreateFileConfig createFileConfig, String projectPath, Map<String, Object> var3) throws Exception {
|
||||
log.debug("--------generate----projectPath--------" + projectPath);
|
||||
|
||||
for(int var4 = 0; var4 < var1.listFile().size(); ++var4) {
|
||||
File var5 = (File)var1.listFile().get(var4);
|
||||
this.a(var2, var5, var3, var1);
|
||||
for(int i = 0; i < createFileConfig.listFile().size(); ++i) {
|
||||
File file = (File)createFileConfig.listFile().get(i);
|
||||
this.a(projectPath, file, var3, createFileConfig);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class BaseCodeGenerate {
|
||||
if (var2 == null) {
|
||||
throw new IllegalStateException("'templateRootDir' must be not null");
|
||||
} else {
|
||||
log.info(" load template from templateRootDir = '" + var2.getAbsolutePath() + "',stylePath ='" + var4.getStylePath() + "', out GenerateRootDir:" + com.jero.codegenerate.properties.CodeConfigProperties.f);
|
||||
log.info(" load template from templateRootDir = '" + var2.getAbsolutePath() + "',stylePath ='" + var4.getStylePath() + "', out GenerateRootDir:" + com.jero.codegenerate.properties.CodeConfigProperties.projectPath);
|
||||
List var5 = FileHelper.a(var2);
|
||||
log.debug("----srcFiles----size-----------" + var5.size());
|
||||
log.debug("----srcFiles----list------------" + var5.toString());
|
||||
@@ -95,12 +95,12 @@ public class BaseCodeGenerate {
|
||||
}
|
||||
|
||||
Template var5 = this.a(var1, var4);
|
||||
var5.setOutputEncoding(c);
|
||||
var5.setOutputEncoding(charcterSet);
|
||||
File var6 = FileHelper.c(var2);
|
||||
log.info("[generate]\t template:" + var1 + " ==> " + var2);
|
||||
FreemarkerHelper.a(var5, var3, var6, c);
|
||||
FreemarkerHelper.a(var5, var3, var6, charcterSet);
|
||||
if (!this.a(var6)) {
|
||||
this.d.add("生成成功:" + var2);
|
||||
this.list.add("生成成功:" + var2);
|
||||
}
|
||||
|
||||
if (this.a(var6)) {
|
||||
@@ -110,7 +110,7 @@ public class BaseCodeGenerate {
|
||||
}
|
||||
|
||||
protected Template a(String var1, CreateFileConfig var2) throws IOException {
|
||||
return FreemarkerHelper.a(var2.listFile(), c, var1).getTemplate(var1);
|
||||
return FreemarkerHelper.a(var2.listFile(), charcterSet, var1).getTemplate(var1);
|
||||
}
|
||||
|
||||
protected boolean a(File var1) {
|
||||
@@ -143,7 +143,7 @@ public class BaseCodeGenerate {
|
||||
log.info("[generate]\t split file:" + var1.getAbsolutePath() + " ==> " + var9);
|
||||
var8 = new OutputStreamWriter(new FileOutputStream(var9), "UTF-8");
|
||||
var5.add(var8);
|
||||
this.d.add("生成成功:" + var9);
|
||||
this.list.add("生成成功:" + var9);
|
||||
var7 = true;
|
||||
} else if (var7) {
|
||||
var8.append(var6 + "\r\n");
|
||||
@@ -280,7 +280,7 @@ public class BaseCodeGenerate {
|
||||
}
|
||||
}
|
||||
|
||||
Configuration var10 = FreemarkerHelper.a(var2.listFile(), c, "/");
|
||||
Configuration var10 = FreemarkerHelper.a(var2.listFile(), charcterSet, "/");
|
||||
var3 = FreemarkerHelper.a(var3, var0, var10);
|
||||
String var11 = var2.getStylePath();
|
||||
if (var11 != null && var11 != "") {
|
||||
@@ -303,18 +303,18 @@ public class BaseCodeGenerate {
|
||||
return var1;
|
||||
}
|
||||
|
||||
protected static String a(String var0, String var1) {
|
||||
boolean var2 = true;
|
||||
boolean var3 = true;
|
||||
protected static String dealAndGetTemplateUrl(String templateUrl, String separator) {
|
||||
boolean flag1 = true;
|
||||
boolean flag2 = true;
|
||||
|
||||
do {
|
||||
int var4 = var0.indexOf(var1) == 0 ? 1 : 0;
|
||||
int var5 = var0.lastIndexOf(var1) + 1 == var0.length() ? var0.lastIndexOf(var1) : var0.length();
|
||||
var0 = var0.substring(var4, var5);
|
||||
var2 = var0.indexOf(var1) == 0;
|
||||
var3 = var0.lastIndexOf(var1) + 1 == var0.length();
|
||||
} while(var2 || var3);
|
||||
int start = templateUrl.indexOf(separator) == 0 ? 1 : 0;
|
||||
int end = templateUrl.lastIndexOf(separator) + 1 == templateUrl.length() ? templateUrl.lastIndexOf(separator) : templateUrl.length();
|
||||
templateUrl = templateUrl.substring(start, end);
|
||||
flag1 = templateUrl.indexOf(separator) == 0;
|
||||
flag2 = templateUrl.lastIndexOf(separator) + 1 == templateUrl.length();
|
||||
} while(flag1 || flag2);
|
||||
|
||||
return var0;
|
||||
return templateUrl;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -21,7 +21,7 @@ public class CodeConfigProperties {
|
||||
public static String databaseUrl;
|
||||
public static String username;
|
||||
public static String password;
|
||||
public static String f;
|
||||
public static String projectPath;
|
||||
public static String packageName;
|
||||
public static String h;
|
||||
public static String i;
|
||||
@@ -117,17 +117,17 @@ public class CodeConfigProperties {
|
||||
return configDatasourcePropties.getString("page_field_required_num");
|
||||
}
|
||||
|
||||
public static String m() {
|
||||
public static String getProjectPath() {
|
||||
String var0 = configDatasourcePropties.getString("project_path");
|
||||
if (var0 != null && !"".equals(var0)) {
|
||||
f = var0;
|
||||
projectPath = var0;
|
||||
}
|
||||
|
||||
return f;
|
||||
return projectPath;
|
||||
}
|
||||
|
||||
public static void a(String var0) {
|
||||
f = var0;
|
||||
projectPath = var0;
|
||||
}
|
||||
|
||||
public static void b(String var0) {
|
||||
@@ -148,7 +148,7 @@ public class CodeConfigProperties {
|
||||
databaseUrl = "jdbc:mysql://localhost:3306/jero-boot?useUnicode=true&characterEncoding=UTF-8";
|
||||
username = "root";
|
||||
password = "root";
|
||||
f = "c:/workspace/jero";
|
||||
projectPath = "c:/workspace/jero";
|
||||
packageName = "com.jero";
|
||||
h = "src";
|
||||
i = "WebRoot";
|
||||
@@ -165,7 +165,7 @@ public class CodeConfigProperties {
|
||||
i = h();
|
||||
packageName = o();
|
||||
templateUrl = getTemplateUrl();
|
||||
f = m();
|
||||
projectPath = getProjectPath();
|
||||
dbTableId = getDBTableId();
|
||||
dbFiledConvert = getDbFiledConvert();
|
||||
pageFilterFields = getPageFilterFields();
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ public class OnlCgformHeadController {
|
||||
|
||||
List var14 = CgformEnum.getJspModelList(var13);
|
||||
var3.put("jspModeList", var14);
|
||||
var3.put("projectPath", com.jero.codegenerate.properties.CodeConfigProperties.m());
|
||||
var3.put("projectPath", com.jero.codegenerate.properties.CodeConfigProperties.getProjectPath());
|
||||
return Result.OK(var3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user