You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/09/16 12:01:19 UTC

[GitHub] [incubator-seatunnel] ashulin commented on a diff in pull request #2757: [Feature][Connector2] Add DingTalk Source #2684

ashulin commented on code in PR #2757:
URL: https://github.com/apache/incubator-seatunnel/pull/2757#discussion_r972948457


##########
seatunnel-connectors-v2/connector-dingtalk/pom.xml:
##########
@@ -48,6 +48,19 @@
         </exclusion>
       </exclusions>
     </dependency>
+
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>dingtalk</artifactId>
+      <version>1.4.26</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.seatunnel</groupId>
+      <artifactId>connector-http-base</artifactId>
+      <version>2.1.3-SNAPSHOT</version>

Review Comment:
   the dependency is not used.



##########
seatunnel-connectors-v2/connector-dingtalk/pom.xml:
##########
@@ -48,6 +48,19 @@
         </exclusion>
       </exclusions>
     </dependency>
+
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>dingtalk</artifactId>
+      <version>1.4.26</version>
+    </dependency>

Review Comment:
   I checked the DingTalk documentation, this is the new version of the sdk; so can the old version of the sdk(`alibaba-dingtalk-service-sdk`) be removed?



##########
seatunnel-connectors-v2/connector-dingtalk/pom.xml:
##########
@@ -48,6 +48,19 @@
         </exclusion>
       </exclusions>
     </dependency>
+
+    <dependency>
+      <groupId>com.aliyun</groupId>
+      <artifactId>dingtalk</artifactId>
+      <version>1.4.26</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.seatunnel</groupId>
+      <artifactId>connector-http-base</artifactId>
+      <version>2.1.3-SNAPSHOT</version>

Review Comment:
   ```suggestion
         <version>${project.version}</version>
   ```



##########
seatunnel-connectors-v2/connector-dingtalk/src/main/java/org/apache/seatunnel/connectors/seatunnel/source/DingTalkSourceReader.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * 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.seatunnel.connectors.seatunnel.source;
+
+import org.apache.seatunnel.api.serialization.DeserializationSchema;
+import org.apache.seatunnel.api.source.Boundedness;
+import org.apache.seatunnel.api.source.Collector;
+import org.apache.seatunnel.api.table.type.SeaTunnelRow;
+import org.apache.seatunnel.common.utils.JsonUtils;
+import org.apache.seatunnel.connectors.seatunnel.common.DingTalkConstant;
+import org.apache.seatunnel.connectors.seatunnel.common.DingTalkParameter;
+import org.apache.seatunnel.connectors.seatunnel.common.source.AbstractSingleSplitReader;
+import org.apache.seatunnel.connectors.seatunnel.common.source.SingleSplitReaderContext;
+
+import com.dingtalk.api.DefaultDingTalkClient;
+import com.dingtalk.api.DingTalkClient;
+import com.dingtalk.api.request.OapiV2DepartmentListsubRequest;
+import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
+import com.fasterxml.jackson.databind.JsonNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+
+public class DingTalkSourceReader extends AbstractSingleSplitReader<SeaTunnelRow> {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(DingTalkSourceReader.class);
+    protected final SingleSplitReaderContext context;
+    protected final DingTalkParameter dtParameter;
+    protected DingTalkClient dtClient;
+    protected OapiV2DepartmentListsubRequest dtRequest;
+    protected final DeserializationSchema<SeaTunnelRow> deserializationSchema;

Review Comment:
   The filed is not used.



-- 
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@seatunnel.apache.org

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