|
@@ -77,6 +77,20 @@ public abstract class AbstractTemplateEngine {
|
|
|
Map<String, Object> objectMap = this.getObjectMap(tableInfo);
|
|
|
Map<String, String> pathInfo = this.getConfigBuilder().getPathInfo();
|
|
|
TemplateConfig template = this.getConfigBuilder().getTemplate();
|
|
|
+ // 自定义内容
|
|
|
+ InjectionConfig injectionConfig = this.getConfigBuilder().getInjectionConfig();
|
|
|
+ if (null != injectionConfig) {
|
|
|
+ injectionConfig.initMap();
|
|
|
+ objectMap.put("cfg" , injectionConfig.getMap());
|
|
|
+ List<FileOutConfig> focList = injectionConfig.getFileOutConfigList();
|
|
|
+ if (CollectionUtils.isNotEmpty(focList)) {
|
|
|
+ for (FileOutConfig foc : focList) {
|
|
|
+ if (this.isCreate(foc.outputFile(tableInfo))) {
|
|
|
+ this.writer(objectMap, foc.getTemplatePath(), foc.outputFile(tableInfo));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// Mp.java
|
|
|
String entityName = tableInfo.getEntityName();
|
|
|
if (null != entityName) {
|
|
@@ -120,20 +134,6 @@ public abstract class AbstractTemplateEngine {
|
|
|
this.writer(objectMap, this.templateFilePath(template.getController()), controllerFile);
|
|
|
}
|
|
|
}
|
|
|
- // 自定义内容
|
|
|
- InjectionConfig injectionConfig = this.getConfigBuilder().getInjectionConfig();
|
|
|
- if (null != injectionConfig) {
|
|
|
- injectionConfig.initMap();
|
|
|
- objectMap.put("cfg" , injectionConfig.getMap());
|
|
|
- List<FileOutConfig> focList = injectionConfig.getFileOutConfigList();
|
|
|
- if (CollectionUtils.isNotEmpty(focList)) {
|
|
|
- for (FileOutConfig foc : focList) {
|
|
|
- if (this.isCreate(foc.outputFile(tableInfo))) {
|
|
|
- this.writer(objectMap, foc.getTemplatePath(), foc.outputFile(tableInfo));
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
logger.error("无法创建文件,请检查配置信息!" , e);
|