You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/08/11 03:18:35 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #2720: Table info

klesh commented on code in PR #2720:
URL: https://github.com/apache/incubator-devlake/pull/2720#discussion_r943065263


##########
plugins/gitlab/api/connection.go:
##########
@@ -161,3 +163,35 @@ func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, error
 	err := connectionHelper.First(connection, input.Params)
 	return &core.ApiResourceOutput{Body: connection}, err
 }
+
+// @Summary get table info
+// @Description Get table info map
+// @Tags plugins/gitlab
+// @Success 200
+// @Router /plugins/gitlab/table [GET]
+func GetTableInfo(input *core.ApiResourceInput) (*core.ApiResourceOutput, error) {

Review Comment:
   What we need is to provide an API on Framework level to describe meta information for all plugin including `Subtasks/Models`.
   Not on Plugin API level, please remove it.
   



##########
plugins/core/plugin_info.go:
##########
@@ -0,0 +1,218 @@
+/*
+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 core
+
+import (
+	"fmt"
+	"reflect"
+	"sync"
+
+	"gorm.io/gorm/schema"
+)
+
+type TableInfo struct {

Review Comment:
   Lets call it `Model` instead of `Table`



##########
plugins/core/plugin_info.go:
##########
@@ -0,0 +1,218 @@
+/*
+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 core
+
+import (
+	"fmt"
+	"reflect"
+	"sync"
+
+	"gorm.io/gorm/schema"
+)
+
+type TableInfo struct {
+	name     string
+	describe string
+	table    schema.Tabler

Review Comment:
   Do NOT depends on `gorm` directly



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

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