From 4795ddcbfd22f1720b02809e16e7fe9d083222a7 Mon Sep 17 00:00:00 2001 From: yxh Date: Thu, 26 Aug 2021 14:56:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B3=A8=E5=86=8C=E6=A8=A1=E5=9D=97=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=EF=BC=8C=E6=8F=92=E4=BB=B6=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/system/service/tools_gen_table.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/system/service/tools_gen_table.go b/app/system/service/tools_gen_table.go index ddc294c..71eece3 100644 --- a/app/system/service/tools_gen_table.go +++ b/app/system/service/tools_gen_table.go @@ -724,11 +724,11 @@ func (s *toolsGenTable) writeDb(path string, ctx context.Context) (err error) { // GenModuleRouter 生成模块路由 func (s *toolsGenTable) genModuleRouter(curDir, moduleName, packageName string) (err error) { - routerFilePath := strings.Join([]string{curDir, "/router/", gstr.CaseSnake(moduleName), ".go"}, "") - if gstr.ContainsI(packageName, "plugins") { - routerFilePath = strings.Join([]string{curDir, "/plugins/router/", gstr.CaseSnake(moduleName), ".go"}, "") - } if gstr.CaseSnake(moduleName) != "system" { + routerFilePath := strings.Join([]string{curDir, "/router/", gstr.CaseSnake(moduleName), ".go"}, "") + if gstr.ContainsI(packageName, "plugins") { + routerFilePath = strings.Join([]string{curDir, "/plugins/router/", gstr.CaseSnake(moduleName), ".go"}, "") + } code := fmt.Sprintf(`package router%simport _ "%s/router"`, "\n", packageName) s.createFile(routerFilePath, code, false) }