ruanwenjun opened a new pull request, #18236:
URL: https://github.com/apache/dolphinscheduler/pull/18236

   <!--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 19 methods from Map<String, Object> returns to typed returns or void 
with ServiceException, following the established pattern.
   
   Methods migrated:
   - createWorkflowDefinition / updateWorkflowDefinition -> WorkflowDefinition
   - queryWorkflowDefinitionList / queryAllWorkflowDefinitionByProjectCode -> 
List<DagData>
   - queryWorkflowDefinitionSimpleList -> ArrayNode
   - queryWorkflowDefinitionByCode / queryWorkflowDefinitionByName -> DagData
   - getTaskNodeListByDefinitionCode -> List<TaskDefinition>
   - getNodeListMapByDefinitionCodes -> Map<Long, List<TaskDefinition>>
   - queryWorkflowDefinitionListByProjectCode -> 
List<DependentSimplifyDefinition>
   - queryTaskDefinitionListByWorkflowDefinitionCode -> 
List<DependentSimplifyDefinition>
   - viewTree -> TreeViewDto
   - viewVariables -> WorkflowDefinitionVariablesDTO (new DTO)
   - verifyWorkflowDefinitionName -> void (throws on NAME_EXIST)
   - checkWorkflowNodeList -> void (throws on validation failure)
   - switchWorkflowDefinitionVersion -> void
   - batchCopyWorkflowDefinition / batchMoveWorkflowDefinition -> void
   - batchDeleteWorkflowDefinitionByCodes -> void
   
   A new private requireProjectAndWritePerm helper unwraps the Map-style 
permission check from ProjectService into ServiceException.
   
   Cascading caller updates:
   - WorkflowDefinitionController: 25+ endpoints updated to forward typed 
returns via Result.success / Result.success(...)
   - PythonGateway.createWorkflowDefinition: simplified to direct typed return; 
errors auto-throw via ServiceException
   - PythonGateway.getWorkflow: replaced Map status check with try/catch on 
ServiceException to detect WORKFLOW_DEFINITION_NAME_EXIST
   - WorkflowInstanceServiceImpl.updateWorkflowInstance: drops Map result check 
around checkWorkflowNodeList - validation failures propagate via 
ServiceException
   - doBatchOperateWorkflowDefinition: switches per-workflow Map status 
inspection to try/catch + failedWorkflowList accumulation
   
   Full module test suite: 682 tests, 0 failures.
   
   ## 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]

Reply via email to