Kaynağa Gözat

feat(adm-diagram): 新增状态默认值

liyang 2 yıl önce
ebeveyn
işleme
c3b9eac725

+ 2 - 3
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -1,6 +1,5 @@
 package com.persagy.adm.diagram.controller;
 
-import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.diagram.core.ContentParser;
 import com.persagy.adm.diagram.core.DataStrategy;
@@ -227,7 +226,7 @@ public class DiagramController {
      */
     @ApiOperation("系统图状态变更")
     @PostMapping("/update/state")
-    public CommonResult<Boolean> updateState(@RequestBody Map<String,String> params) {
-        return ResultHelper.single(dataStrategy.updateState(params.get("state"),params.get("id")));
+    public CommonResult<Boolean> updateState(@RequestBody Map<String, String> params) {
+        return ResultHelper.single(dataStrategy.updateState(params.get("state"), params.get("id")));
     }
 }

+ 1 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/core/impl/DataStrategyImpl.java

@@ -338,6 +338,7 @@ public class DataStrategyImpl implements DataStrategy {
             }
         }
         diagram.setId(IdUtil.simpleUUID());
+        diagram.setExtraProp("state","Draft");
         diagramMapper.saveDiagram(modelAdapter.toDiagramEntity(diagram));
         return diagram;
     }