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/09/23 00:36:46 UTC

[GitHub] [inlong] healchow commented on a diff in pull request #5993: [INLONG-5967][Manager] OpenAPI of cluster management

healchow commented on code in PR #5993:
URL: https://github.com/apache/inlong/pull/5993#discussion_r978183745


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java:
##########
@@ -90,6 +91,16 @@ public interface InlongClusterService {
      */
     Integer save(ClusterRequest request, String operator);
 
+    /**
+     * Save raw cluster info.
+     *
+     * This method should be repeatable.
+     *
+     * @param request raw inlong cluster info
+     * @return cluster id after saving
+     */
+    Integer saveRaw(InlongClusterEntity request);

Review Comment:
   Please re-use the above save method.



##########
inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenClusterController.java:
##########
@@ -57,4 +59,17 @@ public Response<PageResult<ClusterInfo>> list(@RequestBody ClusterPageRequest re
         return Response.success(clusterService.list(request));
     }
 
+    @PostMapping(value = "/cluster/insert")
+    @ApiOperation(value = "insert raw cluster info")
+    public Response<Integer> insert(@RequestBody InlongClusterEntity request) {

Review Comment:
   The controller layer should not use the entity from the dao layer directly.



##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/InlongClusterService.java:
##########
@@ -90,6 +91,16 @@ public interface InlongClusterService {
      */
     Integer save(ClusterRequest request, String operator);
 
+    /**
+     * Save raw cluster info.
+     *
+     * This method should be repeatable.
+     *
+     * @param request raw inlong cluster info
+     * @return cluster id after saving
+     */
+    Integer saveRaw(InlongClusterEntity request);

Review Comment:
   Please re-use the above save method.



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