|
@@ -19,29 +19,74 @@ public class DemoDiagramController {
|
|
|
@Autowired
|
|
|
private DemoDiagramManager diagramManager;
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询系统图
|
|
|
+ * @param projectId 项目id
|
|
|
+ * @param systemId 系统实例id
|
|
|
+ * @param groupCode 集团编码
|
|
|
+ * @return 树形结构数据(专业-系统-类型-图)
|
|
|
+ */
|
|
|
@RequestMapping("getDiagrams")
|
|
|
- public CommonResult<List<Folder>> getDiagrams(@RequestParam String projectId, @RequestParam(required = false) String systemId, @RequestParam(required = false) String groupCode){
|
|
|
+ public CommonResult<List<Folder>> getDiagrams(@RequestParam String projectId,
|
|
|
+ @RequestParam(required = false) String systemId,
|
|
|
+ @RequestParam(required = false) String groupCode){
|
|
|
return CommonResult.success(diagramManager.getDiagrams(projectId, systemId, groupCode));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新建系统图
|
|
|
+ * @param params 新建参数,对象类型,包含字段 name:名称, type:系统图类型编码
|
|
|
+ * @param projectId 项目id
|
|
|
+ * @param systemId 系统实例id
|
|
|
+ * @param groupCode 集团编码
|
|
|
+ * @return 新建的系统图对象
|
|
|
+ */
|
|
|
@RequestMapping("newDiagram")
|
|
|
- public CommonResult<Diagram> newDiagram(@RequestBody Map<String, String> params, @RequestParam String projectId, @RequestParam(required = false) String systemId, @RequestParam(required = false) String groupCode){
|
|
|
+ public CommonResult<Diagram> newDiagram(@RequestBody Map<String, String> params,
|
|
|
+ @RequestParam String projectId,
|
|
|
+ @RequestParam(required = false) String systemId,
|
|
|
+ @RequestParam(required = false) String groupCode){
|
|
|
return CommonResult.success(diagramManager.createDiagram(params.get("name"), params.get("type"), projectId, systemId, groupCode));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除系统图
|
|
|
+ * @param params 删除参数,对象类型,包含字段 id:系统图id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping("delDiagram")
|
|
|
public CommonResult<Boolean> delDiagram(@RequestBody Map<String, String> params){
|
|
|
return CommonResult.success(diagramManager.deleteDiagram(params.get("id")));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置(修改)系统图使用的模板
|
|
|
+ * @param req 编辑参数,对象类型,包含字段 diagramId:系统图id, templateId:使用的模板id
|
|
|
+ * @return 系统图对象
|
|
|
+ */
|
|
|
@RequestMapping("setTemplate")
|
|
|
public CommonResult<Diagram> setTemplate(@RequestBody EditRequest req){
|
|
|
return CommonResult.success(diagramManager.setTemplate(req.getDiagramId(), req.getTemplateId()));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 自动加载数据
|
|
|
+ * @param req 编辑参数,对象类型,包含字段 diagramId:系统图id
|
|
|
+ * @return 系统图对象
|
|
|
+ */
|
|
|
@RequestMapping("loadData")
|
|
|
public CommonResult<Diagram> loadData(@RequestBody EditRequest req) {
|
|
|
return CommonResult.success(diagramManager.loadData(req.getDiagramId(), true));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存系统图
|
|
|
+ * @param req 编辑参数,对象类型,包含字段 diagram:系统图对象
|
|
|
+ * @return 保存后的系统图对象
|
|
|
+ */
|
|
|
+ @RequestMapping("saveDiagram")
|
|
|
+ public CommonResult<Diagram> saveDiagram(@RequestBody EditRequest req) {
|
|
|
+ return CommonResult.success(diagramManager.saveDiagram(req.getDiagram()));
|
|
|
+ }
|
|
|
+
|
|
|
}
|