ruanwenjun commented on code in PR #12158:
URL: https://github.com/apache/dolphinscheduler/pull/12158#discussion_r995269510


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/EnvironmentServiceImpl.java:
##########
@@ -106,8 +106,8 @@ public Map<String, Object> createEnvironment(User 
loginUser, String name, String
             putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR);
             return result;
         }
-        Map<String, Object> checkResult = checkParams(name, config, 
workerGroups);
-        if (checkResult.get(Constants.STATUS) != Status.SUCCESS) {
+        Result checkResult = checkParams(name, config, workerGroups);
+        if (checkResult.getCode() != Status.SUCCESS.getCode()) {

Review Comment:
   We can directly throw ServiceException in service, use Result is not 
convenient.



##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/EnvironmentService.java:
##########
@@ -50,7 +50,7 @@ public interface EnvironmentService {
      *
      * @param code environment code
      */
-    Map<String, Object> queryEnvironmentByCode(Long code);
+    Result queryEnvironmentByCode(Long code);

Review Comment:
   ```suggestion
       Environment queryEnvironmentByCode(Long code);
   ```
   
   Please remove the Result in service.



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