You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/06/19 03:32:53 UTC

[GitHub] [incubator-dolphinscheduler] zixi0825 commented on a change in pull request #2884: batch copy or move process #2753

zixi0825 commented on a change in pull request #2884:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2884#discussion_r442612804



##########
File path: dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ProcessDefinitionController.java
##########
@@ -95,27 +95,33 @@ public Result createProcessDefinition(@ApiIgnore @RequestAttribute(value = Const
     }
 
     /**
-     * copy process definition
+     * copy or move process definition
      *
      * @param loginUser   login user
      * @param projectName project name
-     * @param processId   process definition id
+     * @param isCopy  isCopy
+     * @param processDefinitionIds   process definition ids
+     * @param targetProjectName target project name
      * @return copy result code
      */
-    @ApiOperation(value = "copyProcessDefinition", notes= "COPY_PROCESS_DEFINITION_NOTES")
+    @ApiOperation(value = "copyOrMoveProcessDefinition", notes= "COPY_OR_MOVE_PROCESS_DEFINITION_NOTES")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "processId", value = "PROCESS_DEFINITION_ID", required = true, dataType = "Int", example = "100")
+            @ApiImplicitParam(name = "processDefinitionIds", value = "PROCESS_DEFINITION_IDS", required = true, dataType = "String", example = "3,4")
     })
-    @PostMapping(value = "/copy")
+    @PostMapping(value = "/copy-or-move")
     @ResponseStatus(HttpStatus.OK)
-    @ApiException(COPY_PROCESS_DEFINITION_ERROR)
-    public Result copyProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
-                                        @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
-                                        @RequestParam(value = "processId", required = true) int processId) throws JsonProcessingException {
-        logger.info("copy process definition, login user:{}, project name:{}, process definition id:{}",
-                loginUser.getUserName(), projectName, processId);
-        Map<String, Object> result = processDefinitionService.copyProcessDefinition(loginUser, projectName, processId);
-        return returnDataList(result);
+    @ApiException(COPY_OR_MOVE_PROCESS_DEFINITION_ERROR)
+    public Result copyOrMoveProcessDefinition(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
+                                              @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
+                                              @RequestParam(value = "processDefinitionIds", required = true) String processDefinitionIds,
+                                              @RequestParam(value = "targetProjectName",required = true) String targetProjectName,
+                                              @RequestParam(value = "isCopy", required = true) boolean isCopy)  {

Review comment:
       problem fixed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org