|
|
@ -8,7 +8,6 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/api/spec"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/api/spec"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/config"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/config"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/pkg/golang"
|
|
|
|
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util/format"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util/format"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
|
|
|
|
"github.com/zeromicro/go-zero/tools/goctl/util/pathx"
|
|
|
@ -41,14 +40,10 @@ func genHandler(dir, rootPkg string, cfg *config.Config, group spec.Group, route
|
|
|
|
handler = strings.Title(handler)
|
|
|
|
handler = strings.Title(handler)
|
|
|
|
logicName = pkgName
|
|
|
|
logicName = pkgName
|
|
|
|
}
|
|
|
|
}
|
|
|
|
parentPkg, err := golang.GetParentPackage(dir)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, rootPkg),
|
|
|
|
HandlerName: handler,
|
|
|
|
HandlerName: handler,
|
|
|
|
RequestType: util.Title(route.RequestTypeName()),
|
|
|
|
RequestType: util.Title(route.RequestTypeName()),
|
|
|
|
LogicName: logicName,
|
|
|
|
LogicName: logicName,
|
|
|
|