You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "castorqin (via GitHub)" <gi...@apache.org> on 2023/07/05 07:58:40 UTC

[GitHub] [inlong] castorqin opened a new pull request, #8428: [Manager] Manager client support tenant operation

castorqin opened a new pull request, #8428:
URL: https://github.com/apache/inlong/pull/8428

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title Example: [INLONG-XYZ][Component] Title of the pull request
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes #8423  
   
   ### Motivation
   add two clients in mangaer client
   
   - InlongTenant client 
   - InlongTenantRole client
   
   ### Modifications
   The details can be found at [#8423  ](https://github.com/apache/inlong/issues/8423).
   


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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1252960462


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantClient.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.PageResult;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantInfo;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantPageRequest;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantRequest;
+
+/**
+ * Client for {@link InlongTenantApi}.
+ */
+public class InlongTenantClient {
+
+    private final InlongTenantApi inlongTenantApi;
+
+    public InlongTenantClient(ClientConfiguration configuration) {
+        inlongTenantApi = ClientUtils.createRetrofit(configuration).create(InlongTenantApi.class);
+    }
+
+    /**
+     * get inlong tenant by tenant name

Review Comment:
   Get inlong tenant by tenant name



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantClient.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.PageResult;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantInfo;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantPageRequest;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantRequest;
+
+/**
+ * Client for {@link InlongTenantApi}.
+ */
+public class InlongTenantClient {
+
+    private final InlongTenantApi inlongTenantApi;
+
+    public InlongTenantClient(ClientConfiguration configuration) {
+        inlongTenantApi = ClientUtils.createRetrofit(configuration).create(InlongTenantApi.class);
+    }
+
+    /**
+     * get inlong tenant by tenant name
+     *
+     * @param name tenant name
+     * @return {@link InlongTenantInfo}
+     */
+    public InlongTenantInfo getTenantByName(String name) {
+        Response<InlongTenantInfo> inlongTenantInfoResponse = ClientUtils.executeHttpCall(inlongTenantApi.get(name));
+        ClientUtils.assertRespSuccess(inlongTenantInfoResponse);
+        return inlongTenantInfoResponse.getData();
+    }
+
+    /**
+     * create inlong tenant

Review Comment:
   Create inlong tenant



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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1253847053


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {
+        Response<PageInfo<TenantRoleInfo>> pageInfoResponse = ClientUtils.executeHttpCall(
+                inlongTenantRoleApi.listByCondition(request));
+        ClientUtils.assertRespSuccess(pageInfoResponse);
+        return pageInfoResponse.getData();
+    }
+
+    /**
+     * Save  tenant role
+     *
+     * @param record tenant role info
+     *
+     * @return tenant id

Review Comment:
   * @param record tenant role info
   * @return tenant id



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info

Review Comment:
   * @param request tenant page info



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}

Review Comment:
   * @return {@link PageInfo<TenantRoleInfo>}



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


[GitHub] [inlong] castorqin commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "castorqin (via GitHub)" <gi...@apache.org>.
castorqin commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1252957547


##########
inlong-manager/manager-client/pom.xml:
##########
@@ -71,6 +71,12 @@
             <artifactId>junit-jupiter</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper</artifactId>
+            <version>5.3.0</version>

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

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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1253846777


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info

Review Comment:
   `* @param request tenant page info`



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}

Review Comment:
   `* @return {@link PageInfo<TenantRoleInfo>}`



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


[GitHub] [inlong] dockerzhang merged pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #8428:
URL: https://github.com/apache/inlong/pull/8428


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


[GitHub] [inlong] fuweng11 commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "fuweng11 (via GitHub)" <gi...@apache.org>.
fuweng11 commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1252967930


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {
+        Response<PageInfo<TenantRoleInfo>> pageInfoResponse = ClientUtils.executeHttpCall(
+                inlongTenantRoleApi.listByCondition(request));
+        ClientUtils.assertRespSuccess(pageInfoResponse);
+        return pageInfoResponse.getData();
+    }
+
+    /**
+     * Save one tenant role
+     *
+     * @param record tenant role info
+     *
+     * @return tenant id
+     */
+    public int save(TenantRoleRequest record) {
+        Response<Integer> saveResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.save(record));
+        ClientUtils.assertRespSuccess(saveResult);
+        return saveResult.getData();
+    }
+
+    /**
+     * Update one tenant role

Review Comment:
   Update tenant role



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {
+        Response<PageInfo<TenantRoleInfo>> pageInfoResponse = ClientUtils.executeHttpCall(
+                inlongTenantRoleApi.listByCondition(request));
+        ClientUtils.assertRespSuccess(pageInfoResponse);
+        return pageInfoResponse.getData();
+    }
+
+    /**
+     * Save one tenant role
+     *
+     * @param record tenant role info
+     *
+     * @return tenant id
+     */
+    public int save(TenantRoleRequest record) {
+        Response<Integer> saveResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.save(record));
+        ClientUtils.assertRespSuccess(saveResult);
+        return saveResult.getData();
+    }
+
+    /**
+     * Update one tenant role
+     *
+     * @param  record tenant role info
+     * @return true/false
+     */
+    public boolean update(TenantRoleRequest record) {
+        Response<Boolean> updateResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.update(record));
+        ClientUtils.assertRespSuccess(updateResult);
+        return updateResult.getData();
+    }
+
+    /**
+     * Get one tenant role by id

Review Comment:
   Get tenant role by id



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


[GitHub] [inlong] dockerzhang commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1252930914


##########
inlong-manager/manager-client/pom.xml:
##########
@@ -71,6 +71,12 @@
             <artifactId>junit-jupiter</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper</artifactId>
+            <version>5.3.0</version>

Review Comment:
   Please move the version definition to the root pom.xml.



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


[GitHub] [inlong] healchow commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1253877112


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     * @param request tenant page info
+     * @return {@link PageInfo}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {

Review Comment:
   Client not need the use of `PageHelper. PageInfo `, please change this interface to use the `PageResult` in manaber-web, thanks.



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


[GitHub] [inlong] castorqin commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "castorqin (via GitHub)" <gi...@apache.org>.
castorqin commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1253838634


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {
+        Response<PageInfo<TenantRoleInfo>> pageInfoResponse = ClientUtils.executeHttpCall(
+                inlongTenantRoleApi.listByCondition(request));
+        ClientUtils.assertRespSuccess(pageInfoResponse);
+        return pageInfoResponse.getData();
+    }
+
+    /**
+     * Save one tenant role
+     *
+     * @param record tenant role info
+     *
+     * @return tenant id
+     */
+    public int save(TenantRoleRequest record) {
+        Response<Integer> saveResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.save(record));
+        ClientUtils.assertRespSuccess(saveResult);
+        return saveResult.getData();
+    }
+
+    /**
+     * Update one tenant role
+     *
+     * @param  record tenant role info
+     * @return true/false
+     */
+    public boolean update(TenantRoleRequest record) {
+        Response<Boolean> updateResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.update(record));
+        ClientUtils.assertRespSuccess(updateResult);
+        return updateResult.getData();
+    }
+
+    /**
+     * Get one tenant role by id

Review Comment:
   done



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantRoleClient.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantRoleApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.user.TenantRoleInfo;
+import org.apache.inlong.manager.pojo.user.TenantRolePageRequest;
+import org.apache.inlong.manager.pojo.user.TenantRoleRequest;
+
+import com.github.pagehelper.PageInfo;
+
+public class InlongTenantRoleClient {
+
+    private final InlongTenantRoleApi inlongTenantRoleApi;
+
+    public InlongTenantRoleClient(ClientConfiguration configuration) {
+        this.inlongTenantRoleApi = ClientUtils.createRetrofit(configuration).create(InlongTenantRoleApi.class);
+    }
+
+    /**
+     * List all tenant role by paginating
+     *
+     *@param request tenant page info
+     *@return {@link PageInfo<TenantRoleInfo>}
+     */
+    public PageInfo<TenantRoleInfo> listByCondition(TenantRolePageRequest request) {
+        Response<PageInfo<TenantRoleInfo>> pageInfoResponse = ClientUtils.executeHttpCall(
+                inlongTenantRoleApi.listByCondition(request));
+        ClientUtils.assertRespSuccess(pageInfoResponse);
+        return pageInfoResponse.getData();
+    }
+
+    /**
+     * Save one tenant role
+     *
+     * @param record tenant role info
+     *
+     * @return tenant id
+     */
+    public int save(TenantRoleRequest record) {
+        Response<Integer> saveResult = ClientUtils.executeHttpCall(inlongTenantRoleApi.save(record));
+        ClientUtils.assertRespSuccess(saveResult);
+        return saveResult.getData();
+    }
+
+    /**
+     * Update one tenant role

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

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


[GitHub] [inlong] castorqin commented on a diff in pull request #8428: [INLONG-8423][Manager] Manager client support tenant operation

Posted by "castorqin (via GitHub)" <gi...@apache.org>.
castorqin commented on code in PR #8428:
URL: https://github.com/apache/inlong/pull/8428#discussion_r1253838762


##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantClient.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.PageResult;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantInfo;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantPageRequest;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantRequest;
+
+/**
+ * Client for {@link InlongTenantApi}.
+ */
+public class InlongTenantClient {
+
+    private final InlongTenantApi inlongTenantApi;
+
+    public InlongTenantClient(ClientConfiguration configuration) {
+        inlongTenantApi = ClientUtils.createRetrofit(configuration).create(InlongTenantApi.class);
+    }
+
+    /**
+     * get inlong tenant by tenant name
+     *
+     * @param name tenant name
+     * @return {@link InlongTenantInfo}
+     */
+    public InlongTenantInfo getTenantByName(String name) {
+        Response<InlongTenantInfo> inlongTenantInfoResponse = ClientUtils.executeHttpCall(inlongTenantApi.get(name));
+        ClientUtils.assertRespSuccess(inlongTenantInfoResponse);
+        return inlongTenantInfoResponse.getData();
+    }
+
+    /**
+     * create inlong tenant

Review Comment:
   done



##########
inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongTenantClient.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.client.api.inner.client;
+
+import org.apache.inlong.manager.client.api.ClientConfiguration;
+import org.apache.inlong.manager.client.api.service.InlongTenantApi;
+import org.apache.inlong.manager.client.api.util.ClientUtils;
+import org.apache.inlong.manager.pojo.common.PageResult;
+import org.apache.inlong.manager.pojo.common.Response;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantInfo;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantPageRequest;
+import org.apache.inlong.manager.pojo.tenant.InlongTenantRequest;
+
+/**
+ * Client for {@link InlongTenantApi}.
+ */
+public class InlongTenantClient {
+
+    private final InlongTenantApi inlongTenantApi;
+
+    public InlongTenantClient(ClientConfiguration configuration) {
+        inlongTenantApi = ClientUtils.createRetrofit(configuration).create(InlongTenantApi.class);
+    }
+
+    /**
+     * get inlong tenant by tenant name

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

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