🐛 Fixing a bug. 代码生成模块服务监控状态一直显示不正常

This commit is contained in:
lbw committed 2022-12-01 20:25:33 +08:00
1 parent e80216eef0
commit c281b6972d
4 files changed
+12 -12

No files matched your search

@@ -277,7 +277,7 @@ public interface GenCodeService {
Map<String, Map> resultMap = new LinkedHashMap<>(8);
for (String template : templates) {
Map<String,String> templatesData = new HashMap<>();
Map<String, String> templatesData = new HashMap<>();
// 渲染模板
StringWriter sw = new StringWriter();
Template tpl = Velocity.getTemplate(template, CharsetUtil.UTF_8);
@@ -287,8 +287,8 @@ public interface GenCodeService {
String fileName = getFileName(template, tableEntity.getCaseClassName(), map.get("package").toString(),
map.get("moduleName").toString());
templatesData.put("codePath",fileName);
templatesData.put("code",sw.toString());
templatesData.put("codePath", fileName);
templatesData.put("code", sw.toString());
if (zip != null) {
try {
@@ -95,7 +95,7 @@ public class GenDynamicServiceImpl implements GenDynamicService {
ApiInfo apiInfo = new ApiInfo();
apiInfo.setId(id + "_query");
Map<String,String> script = templates.get("template/magic/query.magic.vm");
Map<String, String> script = templates.get("template/magic/query.magic.vm");
apiInfo.setScript(script.get("code"));
apiInfo.setName("分页");
apiInfo.setPath("/list");
@@ -105,7 +105,7 @@ public class GenDynamicServiceImpl implements GenDynamicService {
ApiInfo delApiInfo = new ApiInfo();
delApiInfo.setId(id + "_del");
Map<String,String> delScript = templates.get("template/magic/del.magic.vm");
Map<String, String> delScript = templates.get("template/magic/del.magic.vm");
delApiInfo.setScript(delScript.get("code"));
delApiInfo.setName("删除");
delApiInfo.setPath("/delete");
@@ -115,7 +115,7 @@ public class GenDynamicServiceImpl implements GenDynamicService {
ApiInfo addApiInfo = new ApiInfo();
addApiInfo.setId(id + "_add");
Map<String,String> addScript = templates.get("template/magic/add.magic.vm");
Map<String, String> addScript = templates.get("template/magic/add.magic.vm");
addApiInfo.setScript(addScript.get("code"));
addApiInfo.setName("添加");
addApiInfo.setPath("/save");
@@ -125,7 +125,7 @@ public class GenDynamicServiceImpl implements GenDynamicService {
ApiInfo updateApiInfo = new ApiInfo();
updateApiInfo.setId(id + "_update");
Map<String,String> updateScript = templates.get("template/magic/update.magic.vm");
Map<String, String> updateScript = templates.get("template/magic/update.magic.vm");
updateApiInfo.setScript(updateScript.get("code"));
updateApiInfo.setName("修改");
updateApiInfo.setPath("/update");
@@ -135,7 +135,7 @@ public class GenDynamicServiceImpl implements GenDynamicService {
ApiInfo metadataApiInfo = new ApiInfo();
metadataApiInfo.setId(id + "metadata");
Map<String,String> metadataScript = templates.get("template/magic/metadata.magic.vm");
Map<String, String> metadataScript = templates.get("template/magic/metadata.magic.vm");
metadataApiInfo.setScript(metadataScript.get("code"));
metadataApiInfo.setName("元数据");
metadataApiInfo.setPath("/metadata");
@@ -87,15 +87,15 @@ public class AvueGenCodeServiceImpl implements GenCodeService {
Map<String, Map> resultMap = new HashMap<>();
if (Objects.nonNull(formConf)) {
Map<String,String> templatesData = new HashMap<>();
Map<String, String> templatesData = new HashMap<>();
// 存在 curd 存在设计好的JSON 则使用Json 覆盖
String crudTempName = "template/avue/crud.js.vm";
String fileName = getFileName(crudTempName, tableEntity.getCaseClassName(), map.get("package").toString(),
map.get("moduleName").toString());
String contents = CRUD_PREFIX + formConf.getFormInfo();
templatesData.put("codePath",fileName);
templatesData.put("code",contents);
templatesData.put("codePath", fileName);
templatesData.put("code", contents);
if (zip != null) {
zip.putNextEntry(new ZipEntry(Objects.requireNonNull(fileName)));