You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/02/19 02:50:52 UTC

[GitHub] [incubator-inlong] dockerzhang commented on a change in pull request #2589: [INLONG-2588][Manager] Support cluster management

dockerzhang commented on a change in pull request #2589:
URL: https://github.com/apache/incubator-inlong/pull/2589#discussion_r810436749



##########
File path: inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java
##########
@@ -58,6 +59,37 @@
         return Response.success(clusterInfoService.list(request));
     }
 
+    @RequestMapping(value = "/common/save", method = RequestMethod.GET)
+    @ApiOperation(value = "Add a cluster info")
+    @OperationLog(operation = OperationType.CREATE)
+    public Response<Integer> saveCluster(@RequestBody ClusterInfo clusterInfo) {
+        String currentUser = LoginUserUtil.getLoginUserDetail().getUserName();
+        return Response.success(clusterInfoService.save(clusterInfo, currentUser));
+    }
+
+    @RequestMapping(value = "/common/get/{id}")

Review comment:
       ditto

##########
File path: inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java
##########
@@ -58,6 +59,37 @@
         return Response.success(clusterInfoService.list(request));
     }
 
+    @RequestMapping(value = "/common/save", method = RequestMethod.GET)

Review comment:
       what does the `common` stand for? it's better to use an explicit name.

##########
File path: inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/ClusterController.java
##########
@@ -58,6 +59,37 @@
         return Response.success(clusterInfoService.list(request));
     }
 
+    @RequestMapping(value = "/common/save", method = RequestMethod.GET)
+    @ApiOperation(value = "Add a cluster info")
+    @OperationLog(operation = OperationType.CREATE)
+    public Response<Integer> saveCluster(@RequestBody ClusterInfo clusterInfo) {
+        String currentUser = LoginUserUtil.getLoginUserDetail().getUserName();
+        return Response.success(clusterInfoService.save(clusterInfo, currentUser));
+    }
+
+    @RequestMapping(value = "/common/get/{id}")
+    @ApiOperation(value = "Query cluster information of the common")
+    @ApiImplicitParam(name = "id", value = "common cluster ID", dataTypeClass = Integer.class, required = true)
+    public Response<ClusterInfo> getCluster(@PathVariable Integer id) {
+        return Response.success(clusterInfoService.get(id));
+    }
+
+    @RequestMapping(value = "/common/update", method = RequestMethod.POST)

Review comment:
       ditto




-- 
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@inlong.apache.org

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