完善问题

This commit is contained in:
wanggeng888 2021-03-12 15:17:07 +08:00
parent 407cdbdac2
commit fcccaad90d
2 changed files with 8 additions and 1 deletions

View File

@ -130,6 +130,7 @@ public class FieldService {
fields.add(fieldVO); fields.add(fieldVO);
fieldIndex++; fieldIndex++;
} }
Thread.sleep(1000);
return 0; return 0;
} }
}; };

View File

@ -1,5 +1,6 @@
package ink.wgink.code.factory.service; package ink.wgink.code.factory.service;
import freemarker.cache.ClassTemplateLoader;
import freemarker.template.Configuration; import freemarker.template.Configuration;
import freemarker.template.Template; import freemarker.template.Template;
import freemarker.template.TemplateException; import freemarker.template.TemplateException;
@ -46,7 +47,12 @@ public class GenerateService {
public GenerateService(TableView tableView) throws URISyntaxException, IOException { public GenerateService(TableView tableView) throws URISyntaxException, IOException {
this.tableView = tableView; this.tableView = tableView;
this.freemarkerConfiguration.setDirectoryForTemplateLoading(new File(getClass().getResource("/template").toURI())); // 1.加载 文件夹里的模板
// this.freemarkerConfiguration.setDirectoryForTemplateLoading(new File(getClass().getResource("/template").toURI()));
// 2.加载 jar中的模板
// this.freemarkerConfiguration.setTemplateLoader(new ClassTemplateLoader(this.getClass(), "/template"));
// 3.加载 jar中的模板
this.freemarkerConfiguration.setClassForTemplateLoading(this.getClass(), "/template");
this.freemarkerConfiguration.setDefaultEncoding("utf-8"); this.freemarkerConfiguration.setDefaultEncoding("utf-8");
} }