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 2022/10/14 02:05:58 UTC

[GitHub] [dolphinscheduler] ruanwenjun commented on a diff in pull request #12158: [Feature][Api] Refactor api.controller.EnvironmentV2Controller

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: commits-unsubscribe@dolphinscheduler.apache.org

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