forked from github/dataease
fix(应用): 应用保存增加判断,防止保存为空
This commit is contained in:
parent
53c43967e3
commit
cbca61f0b5
@ -81,11 +81,13 @@ public class PanelAppTemplateService {
|
|||||||
if (StringUtils.isEmpty(requestTemplate.getNodeType())) {
|
if (StringUtils.isEmpty(requestTemplate.getNodeType())) {
|
||||||
requestTemplate.setNodeType("template");
|
requestTemplate.setNodeType("template");
|
||||||
}
|
}
|
||||||
//Store static resource into the server
|
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
//Store static resource into the server
|
||||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||||
panelAppTemplateMapper.insertSelective(requestTemplate);
|
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||||
|
panelAppTemplateMapper.insertSelective(requestTemplate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -96,9 +98,11 @@ public class PanelAppTemplateService {
|
|||||||
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
|
PanelAppTemplateWithBLOBs requestTemplate = new PanelAppTemplateWithBLOBs();
|
||||||
BeanUtils.copyBean(requestTemplate, request);
|
BeanUtils.copyBean(requestTemplate, request);
|
||||||
//Store static resource into the server
|
//Store static resource into the server
|
||||||
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
if(StringUtils.isNotEmpty(request.getSnapshot())){
|
||||||
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
String snapshotName = "app-template-" + request.getId() + ".jpeg";
|
||||||
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
|
||||||
|
requestTemplate.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
|
||||||
|
}
|
||||||
panelAppTemplateMapper.updateByPrimaryKeySelective(requestTemplate);
|
panelAppTemplateMapper.updateByPrimaryKeySelective(requestTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user