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/01 03:17:48 UTC

[GitHub] [incubator-devlake] warren830 commented on a diff in pull request #2641: fix(framework): update code generator templates

warren830 commented on code in PR #2641:
URL: https://github.com/apache/incubator-devlake/pull/2641#discussion_r934107936


##########
generator/template/plugin/tasks/api_client.go-template:
##########
@@ -26,47 +26,59 @@ import (
 )
 
 // TODO add what host would want to requist
-const ENDPOINT = "{{ .Endpoint }}"
 
-func New{{ .PluginName }}ApiClient(taskCtx core.TaskContext) (*helper.ApiAsyncClient, error) {
-	// load and process configuration
-	token := taskCtx.GetConfig("{{ .PLUGIN_NAME }}_TOKEN")
-	if token == "" {
-		println("invalid {{ .PLUGIN_NAME }}_TOKEN, but ignore this error now")
+import (
+	"fmt"
+	"net/http"
+	"strconv"
+	"time"
+
+	"github.com/apache/incubator-devlake/plugins/{{ .pluginName }}/models"

Review Comment:
   fixed
   



##########
generator/template/plugin/tasks/api_client.go-template:
##########
@@ -26,47 +26,59 @@ import (
 )
 
 // TODO add what host would want to requist
-const ENDPOINT = "{{ .Endpoint }}"
 
-func New{{ .PluginName }}ApiClient(taskCtx core.TaskContext) (*helper.ApiAsyncClient, error) {
-	// load and process configuration
-	token := taskCtx.GetConfig("{{ .PLUGIN_NAME }}_TOKEN")
-	if token == "" {
-		println("invalid {{ .PLUGIN_NAME }}_TOKEN, but ignore this error now")
+import (

Review Comment:
   fixed
   



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