|
@@ -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 是否成功
|