fix(模板管理): 模板管理不能创建分类问题

This commit is contained in:
wangjiahao 2022-08-03 13:59:44 +08:00
parent 7b9a7a2aba
commit 557b2f306f

View File

@ -80,11 +80,14 @@ public class PanelTemplateService {
exampleDelete.createCriteria().andPidEqualTo(request.getPid()).andNameEqualTo(request.getName()); exampleDelete.createCriteria().andPidEqualTo(request.getPid()).andNameEqualTo(request.getName());
panelTemplateMapper.deleteByExample(exampleDelete); panelTemplateMapper.deleteByExample(exampleDelete);
} }
//Store static resource into the server if ("template".equals(request.getNodeType())) {
staticResourceService.saveFilesToServe(request.getStaticResource()); //Store static resource into the server
String snapshotName = "template-" + request.getId() + ".jpeg"; staticResourceService.saveFilesToServe(request.getStaticResource());
staticResourceService.saveSingleFileToServe(snapshotName,request.getSnapshot().replace("data:image/jpeg;base64,","") ); String snapshotName = "template-" + request.getId() + ".jpeg";
request.setSnapshot("/"+UPLOAD_URL_PREFIX+'/'+snapshotName); staticResourceService.saveSingleFileToServe(snapshotName, request.getSnapshot().replace("data:image/jpeg;base64,", ""));
request.setSnapshot("/" + UPLOAD_URL_PREFIX + '/' + snapshotName);
}
panelTemplateMapper.insert(request); panelTemplateMapper.insert(request);
} else { } else {
String nameCheckResult = this.nameCheck(CommonConstants.OPT_TYPE.UPDATE, request.getName(), request.getPid(), request.getId()); String nameCheckResult = this.nameCheck(CommonConstants.OPT_TYPE.UPDATE, request.getName(), request.getPid(), request.getId());