You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "vernedeng (via GitHub)" <gi...@apache.org> on 2023/01/29 06:11:39 UTC

[GitHub] [inlong] vernedeng commented on a diff in pull request #7279: [INLONG-7278][Manager] Optimize OpenInLongClusterController implementation

vernedeng commented on code in PR #7279:
URL: https://github.com/apache/inlong/pull/7279#discussion_r1089874293


##########
inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/OpenInLongClusterController.java:
##########
@@ -68,93 +70,115 @@ public class OpenInLongClusterController {
     @ApiOperation(value = "Get cluster tag by id")
     @ApiImplicitParam(name = "id", value = "Cluster ID", dataTypeClass = Integer.class, required = true)
     public Response<ClusterTagResponse> getTag(@PathVariable Integer id) {
+        Preconditions.checkNull(id, ErrorCodeEnum.INVALID_PARAMETER, "tag id cannot be null");
+        Preconditions.checkNull(LoginUserUtils.getLoginUser(), ErrorCodeEnum.LOGIN_USER_EMPTY);
         return Response.success(clusterService.getTag(id, LoginUserUtils.getLoginUser()));
     }
 
     @PostMapping(value = "/cluster/tag/list")
     @ApiOperation(value = "List cluster tags")
     public Response<List<ClusterTagResponse>> listTag(@RequestBody ClusterTagPageRequest request) {
+        Preconditions.checkNull(request, ErrorCodeEnum.INVALID_PARAMETER, "request cannot be null");

Review Comment:
   I think it should be Preconditions.checkNotNull



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