Bladeren bron

feat(adm-diagram): 请求参数和方法方式变更

liyang 3 jaren geleden
bovenliggende
commit
881651aec6

+ 15 - 13
adm-business/adm-diagram/src/main/java/com/persagy/adm/diagram/controller/DiagramController.java

@@ -4,10 +4,16 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.diagram.core.DataStrategy;
 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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 
@@ -28,21 +34,17 @@ public class DiagramController {
 
     /**
      * 系统图列表接口
-     * 根据系统图类型、项目id、系统实例id、集团code、系统图名称查询
      *
-     * @param projectId 项目id
-     * @param systemId  系统实例id
-     * @param groupCode 集团code
-     * @param name      系统图名称
+     * @param diagram 请求参数
      * @return 系统图列表
      */
-    @RequestMapping("/getDiagrams")
-    public CommonResult<List<Diagram>> getDiagrams(@RequestParam String projectId,
-                                                   @RequestParam(required = false) String systemId,
-                                                   @RequestParam(required = false) String groupCode,
-                                                   @RequestParam(required = false) String name) {
-        return CommonResult.success(dataStrategy.getDiagrams(null, projectId, systemId,
-                groupCode, name));
+    @PostMapping("/getDiagrams")
+    public CommonResult<List<Diagram>> getDiagrams(@RequestBody Diagram diagram) {
+        BdtpRequest current = BdtpRequest.getCurrent();
+        String groupCode = current.getGroupCode();
+        String projectId = current.getProjectId();
+        return CommonResult.success(dataStrategy.getDiagrams(null, projectId, diagram.getSystemId(),
+                groupCode, diagram.getName()));
     }
 
     /**