|
@@ -105,6 +105,32 @@ public class ModelerController extends BaseController {
|
|
|
logger.info("创建模型结束,返回模型ID:{}", model.getId());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 创建模型
|
|
|
+ *
|
|
|
+ * @param response
|
|
|
+ * @param name 模型名称
|
|
|
+ * @param key 模型key
|
|
|
+ */
|
|
|
+ @RequestMapping("/create/ajax")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxEntityVo createajax(HttpServletResponse response, String name, String key, String description) throws IOException {
|
|
|
+ logger.info("创建模型入参name:{},key:{}", name, key);
|
|
|
+ Model model = repositoryService.newModel();
|
|
|
+ ObjectNode modelNode = objectMapper.createObjectNode();
|
|
|
+ //模型名称
|
|
|
+ modelNode.put(ModelDataJsonConstants.MODEL_NAME, name);
|
|
|
+ //模型备注
|
|
|
+ modelNode.put(ModelDataJsonConstants.MODEL_DESCRIPTION, description);
|
|
|
+ modelNode.put(ModelDataJsonConstants.MODEL_REVISION, 1);
|
|
|
+ model.setName(name);
|
|
|
+ model.setKey(key);
|
|
|
+ model.setMetaInfo(modelNode.toString());
|
|
|
+ repositoryService.saveModel(model);
|
|
|
+ createObjectNode(model.getId());
|
|
|
+ return success();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 创建模型时完善ModelEditorSource
|
|
|
*
|