ruanwenjun opened a new pull request, #18232: URL: https://github.com/apache/dolphinscheduler/pull/18232
<!--Thanks very much for contributing to Apache DolphinScheduler, we are happy that you want to help us improve DolphinScheduler! --> ## Was this PR generated or assisted by AI? YES, ops 4.7 ## Purpose of the pull request Migrate 9 service methods from Map<String,Object> returns to typed returns or void with ServiceException, following the EnvironmentService pattern. Methods migrated: - queryTopNLongestRunningWorkflowInstance -> List<WorkflowInstance> - queryWorkflowInstanceById -> WorkflowInstance - queryTaskListByWorkflowInstanceId -> WorkflowInstanceTaskListDTO (new) - querySubWorkflowInstanceByTaskId -> Map<String,Integer> (single-key) - updateWorkflowInstance -> WorkflowDefinition - queryParentInstanceBySubId -> Map<String,Integer> (single-key) - viewVariables -> WorkflowInstanceVariablesDTO (new) - viewGantt -> GanttDto - queryByTriggerCode -> List<WorkflowInstance> Two new DTOs encapsulate the multi-field payloads: - WorkflowInstanceTaskListDTO (workflowInstanceState + taskList) - WorkflowInstanceVariablesDTO (globalParams + localParams) The single-field nested-id payloads (subWorkflowInstanceId, parentWorkflowInstance) keep their wire shape via Map<String,Integer>. Error paths uniformly throw ServiceException; the HTTP wire format is preserved by ApiExceptionHandler converting the exception to the same Result(code, msg) shape that putMsg produced. WorkflowInstanceController forwards typed values through Result.success; batchDeleteWorkflowInstanceByIds uses Result.errorWithArgs for the deleteFailed branch. WorkflowInstanceService and WorkflowInstanceController have no PythonGateway / cross-service callers, so the migration is fully contained within these files plus the two test updates. ## Brief change log <!--*(for example:)* - *Add maven-checkstyle-plugin to root pom.xml* --> ## Verify this pull request <!--*(Please pick either of the following options)*--> This pull request is code cleanup without any test coverage. *(or)* This pull request is already covered by existing tests, such as *(please describe tests)*. (or) This change added tests and can be verified as follows: <!--*(example:)* - *Added dolphinscheduler-dao tests for end-to-end.* - *Added CronUtilsTest to verify the change.* - *Manually verified the change by testing locally.* --> (or) ## Pull Request Notice [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) If your pull request contains incompatible change, you should also add it to `docs/docs/en/guide/upgrade/incompatible.md` -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
