2 Commits 9d2d403bb2 ... 2e5c508d24

Author SHA1 Message Date
  liyang 2e5c508d24 Merge remote-tracking branch 'origin/develop' into develop 3 years ago
  liyang f370d1318a feat(adm-diagram): 增加系统图重置接口 3 years ago

+ 19 - 0
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -226,6 +226,25 @@ public class DiagramController {
     }
 
     /**
+     * 重置模板、图数据
+     *
+     * @return 重置后的系统图数据
+     */
+    @ApiOperation("重置模板、图数据")
+    @PostMapping("/reset")
+    public CommonResult<Diagram> reset(@RequestBody Diagram diagram) {
+        if (diagram == null || StrUtil.isBlank(diagram.getId())) {
+            throw new BusinessException(ResponseCode.A0400.getCode(), "系统图id不存在");
+        }
+        diagram = dataStrategy.getDiagram(diagram.getId());
+        if (diagram == null) {
+            throw new BusinessException(ResponseCode.A0400.getCode(), "数据不存在");
+        }
+        diagramManager.resetDiagram(diagram);
+        return ResultHelper.single(diagramManager.loadData(diagram));
+    }
+
+    /**
      * 系统图状态变更
      *
      * @return 是否成功