add runner

This commit is contained in:
kim
2020-08-08 15:16:59 +08:00
committed by Kevin Wan
parent 760d3c8c4b
commit b1e8dd62da
8 changed files with 25 additions and 16 deletions

View File

@@ -11,6 +11,7 @@ import (
"zero/tools/goctl/api/spec"
apiutil "zero/tools/goctl/api/util"
"zero/tools/goctl/util"
"zero/tools/goctl/vars"
)
const (
@@ -19,7 +20,6 @@ const (
import (
"net/http"
"zero/rest/httpx"
{{.importPackages}}
)
@@ -162,6 +162,7 @@ func genHandlers(dir string, api *spec.ApiSpec) error {
func genHandlerImports(group spec.Group, route spec.Route, parentPkg string) string {
var imports []string
imports = append(imports, fmt.Sprintf("\"%s/rest/httpx\"", vars.ProjectOpenSourceUrl))
imports = append(imports, fmt.Sprintf("\"%s\"", path.Join(parentPkg, contextDir)))
if len(route.RequestType.Name) > 0 || len(route.ResponseType.Name) > 0 {
imports = append(imports, fmt.Sprintf("\"%s\"", path.Join(parentPkg, typesDir)))