diff --git a/tools/goctl/api/gogen/genhandlers.go b/tools/goctl/api/gogen/genhandlers.go index f3e0b7a6..64c3e186 100644 --- a/tools/goctl/api/gogen/genhandlers.go +++ b/tools/goctl/api/gogen/genhandlers.go @@ -28,9 +28,9 @@ func {{.HandlerName}}(ctx *svc.ServiceContext) http.HandlerFunc { if err := httpx.Parse(r, &req); err != nil { httpx.Error(w, err) return - }{{end}} + } - l := logic.New{{.LogicType}}(r.Context(), ctx) + {{end}}l := logic.New{{.LogicType}}(r.Context(), ctx) {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}req{{end}}) if err != nil { httpx.Error(w, err)