From 42e550f0fd65afc6505036886725f7a93a6e119d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=BB=84?= <1520752231@qq.com> Date: Fri, 9 Apr 2021 12:25:17 +0800 Subject: [PATCH] bug: add test --- servicegen/tpl/api_task.tpl | 2 -- servicegen/tpl/api_test.tpl | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/servicegen/tpl/api_task.tpl b/servicegen/tpl/api_task.tpl index 443e303..7566639 100644 --- a/servicegen/tpl/api_task.tpl +++ b/servicegen/tpl/api_task.tpl @@ -2,9 +2,7 @@ package hasaki_{{.app_name}} import ( "errors" - "fmt" "git.ouxuan.net/hasaki-service/hasaki-service-ticker-task/hasaki_ticker_task" - "time" ) const TestTaskType = "test_task_type" diff --git a/servicegen/tpl/api_test.tpl b/servicegen/tpl/api_test.tpl index 418f3c5..be16610 100644 --- a/servicegen/tpl/api_test.tpl +++ b/servicegen/tpl/api_test.tpl @@ -1,16 +1,17 @@ -package hasaki_{{.app_name}} +package hasaki_{{.app_name}}_test import ( "log" "testing" + "hasaki-service-{{.app_name}}/hasaki_{{.app_name}}" "git.ouxuan.net/hasaki-service/hasaki-sdk/hskconfig" "git.ouxuan.net/hasaki-service/hasaki-sdk/hskdb" ) var branch interface{} = "branch_brand_63" -var api *Api +var api hasaki_{{.app}}.*Api func init() { @@ -18,8 +19,8 @@ func init() { hskconfig.SetGolbalConfigFileName("E:\test.json") hskdb.IsAsyncToXormSync2 = false - api = NewApi(hskdb.GetXormAuto(branch)) - err := InitDbByConfig(branch) + api = hasaki_{{.app_name}}.NewApi(hskdb.GetXormAuto(branch)) + err := hasaki_{{.app_name}}.InitDbByConfig(branch) if err != nil { log.Fatalln(err) }