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


##########
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:
   This is not a problem, the implementation of this function is to check 
whether the target is null, and throw an exception when the target is null.
   
   There is no problem with the implementation, but the API naming needs to be 
modified:
   Check only expresses the action, not the expected result, so there is 
ambiguity. A issue will be mentioned later to modify the naming problem



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