From c007f0ca1785db093d48f4846cda82fe8e955765 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期三, 27 五月 2020 09:59:29 +0800
Subject: [PATCH] merage

---
 src/main/java/com/highdatas/mdm/controller/ActivitiDesignerController.java |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/controller/ActivitiDesignerController.java b/src/main/java/com/highdatas/mdm/controller/ActivitiDesignerController.java
index 90efffb..0751119 100644
--- a/src/main/java/com/highdatas/mdm/controller/ActivitiDesignerController.java
+++ b/src/main/java/com/highdatas/mdm/controller/ActivitiDesignerController.java
@@ -1,6 +1,8 @@
 package com.highdatas.mdm.controller;
 
 import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.highdatas.mdm.pojo.CodeMsg;
+import com.highdatas.mdm.pojo.Result;
 import com.highdatas.mdm.service.ModelEditorService;
 import com.highdatas.mdm.service.act.IdentityService;
 import com.highdatas.mdm.service.act.RepositoryService;
@@ -15,7 +17,7 @@
 
 /**
  * @author kimi
- * @description
+ * @description 娴佺▼璁捐鍣ㄦ帴鍙�
  * @date 2019-12-11 11:00
  */
 
@@ -29,13 +31,26 @@
     @Autowired
     IdentityService identityService;
 
-
+    /**
+     *
+     * @description:  鍒涘缓涓�涓柊娴佺▼
+     * @return: Result 杩斿洖鍒涘缓鐨刴odel id
+     *
+     */
     @RequestMapping(value = "/create", method = RequestMethod.GET)
     public String createModel() {
         String modelId = modelEditorService.createModel();
         return modelId;
     }
 
+    /**
+     *
+     * @description:  杩斿洖甯︽湁model淇℃伅鐨勭紪杈戝櫒鐣岄潰
+     * @param: modelId  model Id
+     * @param: userId  鐢ㄦ埛id
+     * @return:  娴佺▼缂栬緫鍣ㄩ〉闈�
+     *
+     */
     @RequestMapping(value = "/edit", method = RequestMethod.GET)
     public String getModel(HttpServletResponse response, String modelId) throws IOException {
         if (StringUtils.isEmpty(modelId)) {
@@ -44,12 +59,30 @@
         return "./process/modeler.html?modelId=" + modelId;
     }
 
+    /**
+     *
+     * @description:  淇濆瓨model淇℃伅
+     * @param: modelId  model Id
+     * @return: Result 鏄惁淇濆瓨鎴愬姛
+     *
+     */
     @RequestMapping(value="/model/{modelId}/save", method = RequestMethod.PUT)
 
-    public void saveModel(@PathVariable String modelId, HttpServletRequest request) {
-        repositoryService.saveModel(modelId, request);
+    public Result saveModel(@PathVariable String modelId, HttpServletRequest request) {
+        boolean saved = repositoryService.saveModel(modelId, request);
+        if (saved) {
+            return Result.success(null);
+        } else {
+            return Result.error(new CodeMsg(1000, "鏈娴嬪埌浠讳竴鏍囩"));
+        }
     }
-
+    /**
+     *
+     * @description:  鍒犻櫎model淇℃伅
+     * @param: modelId  model Id
+     * @return: Result 鏄惁鍒犻櫎model淇℃伅
+     *
+     */
     @RequestMapping(value="/model/{modelId}/delete", method = RequestMethod.PUT)
     @ResponseStatus(value = HttpStatus.OK)
     public void deleteModel(@PathVariable String modelId) {
@@ -57,11 +90,24 @@
     }
 
 
-        @RequestMapping(value="/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
+    /**
+     *
+     * @description:  閫氳繃model ID 鑾峰彇娴佺▼缂栬緫鍣ㄤ娇鐢ㄧ殑 Edit json淇℃伅
+     * @param: modelId  model Id
+     * @return: Result Edit json淇℃伅
+     *
+     */
+    @RequestMapping(value="/model/{modelId}/json", method = RequestMethod.GET, produces = "application/json")
     public ObjectNode getEditorJson(@PathVariable String modelId) {
         return modelEditorService.getEditorJson(modelId);
     }
 
+    /**
+     *
+     * @description:  鑾峰彇stencilset.json 娴佺▼缂栬緫鍣ㄤ娇鐢�
+     * @return:   杩斿洖stencilset.json
+     *
+     */
     @RequestMapping(value="/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
     public @ResponseBody
     String getStencilset() {

--
Gitblit v1.8.0