You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2022/07/22 03:05:06 UTC

[incubator-devlake] branch main updated: fix: feishu api (#2575)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 3b91562b fix: feishu api (#2575)
3b91562b is described below

commit 3b91562b16fe9e0dcd68a27dd6566d77b6b8b88e
Author: mappjzc <zh...@merico.dev>
AuthorDate: Fri Jul 22 11:05:03 2022 +0800

    fix: feishu api (#2575)
    
    fix feishu api lost
    
    Nddtfjiang <zh...@merico.dev>
---
 plugins/feishu/api/connection.go |  2 +-
 plugins/feishu/impl/impl.go      | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/plugins/feishu/api/connection.go b/plugins/feishu/api/connection.go
index 668c8fe1..e4facba6 100644
--- a/plugins/feishu/api/connection.go
+++ b/plugins/feishu/api/connection.go
@@ -112,7 +112,7 @@ func DeleteConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, er
 /*
 GET /plugins/feishu/connections
 */
-func ListConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, error) {
+func ListConnections(_ *core.ApiResourceInput) (*core.ApiResourceOutput, error) {
 	var connections []models.FeishuConnection
 	err := connectionHelper.List(&connections)
 	if err != nil {
diff --git a/plugins/feishu/impl/impl.go b/plugins/feishu/impl/impl.go
index be72a418..e987077d 100644
--- a/plugins/feishu/impl/impl.go
+++ b/plugins/feishu/impl/impl.go
@@ -123,7 +123,20 @@ func (plugin Feishu) MigrationScripts() []migration.Script {
 }
 
 func (plugin Feishu) ApiResources() map[string]map[string]core.ApiResourceHandler {
-	return map[string]map[string]core.ApiResourceHandler{}
+	return map[string]map[string]core.ApiResourceHandler{
+		"test": {
+			"POST": api.TestConnection,
+		},
+		"connections": {
+			"POST": api.PostConnections,
+			"GET":  api.ListConnections,
+		},
+		"connections/:connectionId": {
+			"PATCH":  api.PatchConnection,
+			"DELETE": api.DeleteConnection,
+			"GET":    api.GetConnection,
+		},
+	}
 }
 
 func (plugin Feishu) Close(taskCtx core.TaskContext) error {