liguotian commented on code in PR #10998:
URL: https://github.com/apache/dolphinscheduler/pull/10998#discussion_r922670042


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/BaseService.java:
##########
@@ -76,6 +76,14 @@ public interface BaseService {
      */
     void putMsg(Result<Object> result, Status status, Object... statusParams);
 
+    /**
+     * copy result msg from source to target
+     *
+     * @param        source source result
+     * @param        target target result
+     */
+    void copyMsg(Result source, Result target);
+

Review Comment:
   I  use this for copy msg Result from one service-method to another 
Result,because i think the result should declare  generic type ,but we usually 
have different generic type ,and the msg is must delived by result ,the code 
below show this,
   ```java
           Result<Resource> result = new  Result<>();
          ........
          .......
          Result<Object> verifyPidResult = verifyPid(loginUser, pid);
           if (!verifyPidResult.getCode().equals(Status.SUCCESS.getCode())) {
               copyMsg(verifyPidResult, result);
               return result;
           }
   ```
   of course i can set /get code and msg in every time



-- 
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