fix: issues
This commit is contained in:
@@ -45,7 +45,7 @@ func commandGenRouteE(cmd *cobra.Command, args []string) error {
|
|||||||
|
|
||||||
routes := []route.RouteDefinition{}
|
routes := []route.RouteDefinition{}
|
||||||
|
|
||||||
modulePath := filepath.Join(path, "modules")
|
modulePath := filepath.Join(path, "app/http")
|
||||||
if _, err := os.Stat(modulePath); os.IsNotExist(err) {
|
if _, err := os.Stat(modulePath); os.IsNotExist(err) {
|
||||||
log.Fatal("modules dir not exist, ", modulePath)
|
log.Fatal("modules dir not exist, ", modulePath)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ func commandNewModuleE(cmd *cobra.Command, args []string) error {
|
|||||||
modulePath = strings.Join(module, "/modules/")
|
modulePath = strings.Join(module, "/modules/")
|
||||||
}
|
}
|
||||||
moduleName := module[len(module)-1]
|
moduleName := module[len(module)-1]
|
||||||
modulePath = filepath.Join("modules", modulePath)
|
modulePath = filepath.Join("app/http", modulePath)
|
||||||
log.Infof("new module: %s", modulePath)
|
log.Infof("new module: %s", modulePath)
|
||||||
|
|
||||||
force, _ := cmd.Flags().GetBool("force")
|
force, _ := cmd.Flags().GetBool("force")
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
package {{.ModuleName}}
|
|
||||||
|
|
||||||
import (
|
|
||||||
"git.ipao.vip/rogeecn/atom/utils/opt"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Provide(opts ...opt.Option) error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package {{.ModuleName}}
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "git.ipao.vip/rogeecn/atom"
|
|
||||||
_ "git.ipao.vip/rogeecn/atom/contracts"
|
|
||||||
"github.com/gofiber/fiber/v3"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
|
||||||
|
|
||||||
// @provider:except contracts.HttpRoute atom.GroupRoutes
|
|
||||||
type Router struct {
|
|
||||||
log *log.Entry `inject:"false"`
|
|
||||||
|
|
||||||
controller *Controller
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Router) Name() string {
|
|
||||||
return "{{.ModuleName}}"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Router) Prepare() error {
|
|
||||||
r.log = log.WithField("http.group", r.Name())
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *Router) Register(router fiber.Router) {
|
|
||||||
group := router.Group(r.Name())
|
|
||||||
_ = group
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user