chore: remove legacy code (#1766)

master
Kevin Wan 3 years ago committed by GitHub
parent 4e48286838
commit 9fe868ade9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,14 +47,10 @@ func genHandler(dir, rootPkg string, cfg *config.Config, group spec.Group, route
return err return err
} }
goctlVersion := version.GetGoctlVersion()
// todo(anqiansong): This will be removed after a certain number of production versions of goctl (probably 5)
after1_1_10 := version.IsVersionGreaterThan(goctlVersion, "1.1.10")
return doGenToFile(dir, handler, cfg, group, route, handlerInfo{ return doGenToFile(dir, handler, cfg, group, route, handlerInfo{
PkgName: pkgName, PkgName: pkgName,
ImportPackages: genHandlerImports(group, route, parentPkg), ImportPackages: genHandlerImports(group, route, parentPkg),
HandlerName: handler, HandlerName: handler,
After1_1_10: after1_1_10,
RequestType: util.Title(route.RequestTypeName()), RequestType: util.Title(route.RequestTypeName()),
LogicName: logicName, LogicName: logicName,
LogicType: strings.Title(getLogicName(route)), LogicType: strings.Title(getLogicName(route)),

@ -3,7 +3,7 @@ package {{.PkgName}}
import ( import (
"net/http" "net/http"
{{if .After1_1_10}}"github.com/zeromicro/go-zero/rest/httpx"{{end}} "github.com/zeromicro/go-zero/rest/httpx"
{{.ImportPackages}} {{.ImportPackages}}
) )

Loading…
Cancel
Save