diff --git a/tools/goctl/api/gogen/genhandlers.go b/tools/goctl/api/gogen/genhandlers.go index 9248a3b4..9bd7920a 100644 --- a/tools/goctl/api/gogen/genhandlers.go +++ b/tools/goctl/api/gogen/genhandlers.go @@ -24,7 +24,7 @@ import ( {{.ImportPackages}} ) -func {{.HandlerName}}(ctx *svc.ServiceContext) http.HandlerFunc { +func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { {{if .HasRequest}}var req types.{{.RequestType}} if err := httpx.Parse(r, &req); err != nil { @@ -32,7 +32,7 @@ func {{.HandlerName}}(ctx *svc.ServiceContext) http.HandlerFunc { return } - {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), ctx) + {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx) {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}req{{end}}) if err != nil { httpx.Error(w, err) diff --git a/tools/goctl/api/parser/g4/gen/api/apiparser_parser.go b/tools/goctl/api/parser/g4/gen/api/apiparser_parser.go index 64f31005..ac37580a 100755 --- a/tools/goctl/api/parser/g4/gen/api/apiparser_parser.go +++ b/tools/goctl/api/parser/g4/gen/api/apiparser_parser.go @@ -628,5 +628,3 @@ func NewSyntaxLitContext(parser antlr.Parser, parent antlr.ParserRuleContext, in return p } - -