add runner
This commit is contained in:
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user