|
@@ -6,6 +6,7 @@ import com.persagy.adm.diagram.core.model.Diagram;
|
|
|
import com.persagy.adm.diagram.core.model.template.DiagramTemplate;
|
|
|
import com.persagy.adm.diagram.frame.BdtpRequest;
|
|
|
import com.persagy.dmp.common.model.response.CommonResult;
|
|
|
+import com.persagy.dmp.common.utils.ResultHelper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
@@ -43,8 +44,11 @@ public class DiagramController {
|
|
|
BdtpRequest current = BdtpRequest.getCurrent();
|
|
|
String groupCode = current.getGroupCode();
|
|
|
String projectId = current.getProjectId();
|
|
|
- return CommonResult.success(dataStrategy.getDiagrams(null, projectId, diagram.getSystemId(),
|
|
|
- groupCode, diagram.getName()));
|
|
|
+
|
|
|
+ List<Diagram> diagramList = dataStrategy.getDiagrams(null, projectId,
|
|
|
+ diagram.getSystemId(), groupCode, diagram.getName());
|
|
|
+
|
|
|
+ return ResultHelper.multi(diagramList);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -55,7 +59,7 @@ public class DiagramController {
|
|
|
*/
|
|
|
@PostMapping("/newDiagram")
|
|
|
public CommonResult<Diagram> newDiagram(@RequestBody Diagram diagram) {
|
|
|
- return CommonResult.success(dataStrategy.saveDiagram(diagram));
|
|
|
+ return ResultHelper.single(dataStrategy.saveDiagram(diagram));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -66,7 +70,7 @@ public class DiagramController {
|
|
|
*/
|
|
|
@GetMapping("/deleteDiagram")
|
|
|
public CommonResult<Boolean> deleteDiagram(String diagramId) {
|
|
|
- return CommonResult.success(dataStrategy.deleteDiagram(diagramId));
|
|
|
+ return ResultHelper.single(dataStrategy.deleteDiagram(diagramId));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -77,7 +81,7 @@ public class DiagramController {
|
|
|
*/
|
|
|
@GetMapping("/getDiagram")
|
|
|
public CommonResult<Diagram> getDiagram(String diagramId) {
|
|
|
- return CommonResult.success(dataStrategy.getDiagram(diagramId));
|
|
|
+ return ResultHelper.single(dataStrategy.getDiagram(diagramId));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -90,7 +94,7 @@ public class DiagramController {
|
|
|
BdtpRequest current = BdtpRequest.getCurrent();
|
|
|
String groupCode = current.getGroupCode();
|
|
|
String projectId = current.getProjectId();
|
|
|
- return CommonResult.success(dataStrategy.loadSystemInstance(projectId, groupCode));
|
|
|
+ return ResultHelper.multi(dataStrategy.loadSystemInstance(projectId, groupCode));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -101,7 +105,7 @@ public class DiagramController {
|
|
|
*/
|
|
|
@GetMapping("/getTemplates/ByType")
|
|
|
public CommonResult<List<DiagramTemplate>> getTemplatesByType(String diagramType) {
|
|
|
- return CommonResult.success(dataStrategy.getTemplates(diagramType));
|
|
|
+ return ResultHelper.multi(dataStrategy.getTemplates(diagramType));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -112,7 +116,7 @@ public class DiagramController {
|
|
|
*/
|
|
|
@GetMapping("/getTemplate/ById")
|
|
|
public CommonResult<DiagramTemplate> getTemplateById(String templateId) {
|
|
|
- return CommonResult.success(dataStrategy.getTemplate(templateId));
|
|
|
+ return ResultHelper.single(dataStrategy.getTemplate(templateId));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -122,6 +126,6 @@ public class DiagramController {
|
|
|
*/
|
|
|
@GetMapping("/getTemplates")
|
|
|
public CommonResult<List<DiagramTemplate>> getTemplates() {
|
|
|
- return CommonResult.success(dataStrategy.getTemplates());
|
|
|
+ return ResultHelper.multi(dataStrategy.getTemplates());
|
|
|
}
|
|
|
}
|