haifxu commented on code in PR #6206:
URL: https://github.com/apache/inlong/pull/6206#discussion_r998081416


##########
inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/UpdateCommand.java:
##########
@@ -160,4 +165,40 @@ void run() {
             }
         }
     }
+
+    @Parameters(commandDescription = "Update User")
+    private static class UpdateUser extends AbstractCommandRunner {
+
+        @Parameter()
+        private List<String> params;
+
+        @Parameter(names = {"-u", "--username"}, description = "username to be 
modify")
+        private String username;
+
+        @Parameter(names = {"-d", "--days"}, description = "new valid days")
+        private Integer validDays;
+
+        @Override
+        void run() {
+            try {
+                UserRequest request = new UserRequest();
+                request.setName(username);
+                ClientUtils.initClientFactory();
+                UserClient userClient = 
ClientUtils.clientFactory.getUserClient();
+                List<UserInfo> userInfo = userClient.list(request).getList();
+                if (userInfo == null) {
+                    throw new BusinessException(username + " not exist, please 
check.");
+                }
+                request.setId(userInfo.get(0).getId());
+                request.setAccountType(userInfo.get(0).getAccountType());

Review Comment:
   Done.



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