Parcourir la source

代码生成到非system模块细节修复

yxh il y a 4 ans
Parent
commit
9f706c366f

+ 1 - 1
app/system/api/sys_auth_rule.go

@@ -11,7 +11,7 @@ import (
 )
 
 type authRule struct {
-	systemBase
+	SystemBase
 }
 
 var AuthRule = new(authRule)

+ 2 - 2
app/system/api/sys_base.go

@@ -7,12 +7,12 @@ import (
 	"gfast/app/system/service"
 )
 
-type systemBase struct {
+type SystemBase struct {
 	api.CommonBase
 }
 
 // GetCurrentUser 获取当前登陆用户信息
-func (c *systemBase) GetCurrentUser(ctx context.Context) *dao.CtxUser {
+func (c *SystemBase) GetCurrentUser(ctx context.Context) *dao.CtxUser {
 	context := service.Context.Get(ctx)
 	if context == nil {
 		return nil

+ 1 - 1
app/system/api/sys_config.go

@@ -18,7 +18,7 @@ import (
 )
 
 type sysConfig struct {
-	systemBase
+	SystemBase
 }
 
 var SysConfig = new(sysConfig)

+ 1 - 1
app/system/api/sys_dept.go

@@ -12,7 +12,7 @@ import (
 )
 
 type dept struct {
-	systemBase
+	SystemBase
 }
 
 var Dept = new(dept)

+ 1 - 1
app/system/api/sys_dict_data.go

@@ -18,7 +18,7 @@ import (
 )
 
 type dictData struct {
-	systemBase
+	SystemBase
 }
 
 var DictData = new(dictData)

+ 1 - 1
app/system/api/sys_dict_type.go

@@ -11,7 +11,7 @@ import (
 )
 
 type dictType struct {
-	systemBase
+	SystemBase
 }
 
 var DictType = new(dictType)

+ 1 - 1
app/system/api/sys_job.go

@@ -16,7 +16,7 @@ import (
 )
 
 type sysJob struct {
-	systemBase
+	SystemBase
 }
 
 var SysJob = new(sysJob)

+ 1 - 1
app/system/api/sys_login_log.go

@@ -16,7 +16,7 @@ import (
 )
 
 type sysLoginLog struct {
-	systemBase
+	SystemBase
 }
 
 var SysLoginLog = new(sysLoginLog)

+ 1 - 1
app/system/api/sys_monitor.go

@@ -26,7 +26,7 @@ import (
 )
 
 type sysMonitor struct {
-	systemBase
+	SystemBase
 	startTime *gtime.Time
 }
 

+ 1 - 1
app/system/api/sys_oper_log.go

@@ -19,7 +19,7 @@ import (
 )
 
 type sysOperLog struct {
-	systemBase
+	SystemBase
 }
 
 var SysOperLog = new(sysOperLog)

+ 1 - 1
app/system/api/sys_post.go

@@ -16,7 +16,7 @@ import (
 )
 
 type sysPost struct {
-	systemBase
+	SystemBase
 }
 
 var SysPost = new(sysPost)

+ 1 - 1
app/system/api/sys_role.go

@@ -11,7 +11,7 @@ import (
 )
 
 type sysRole struct {
-	systemBase
+	SystemBase
 }
 
 var SysRole = new(sysRole)

+ 1 - 1
app/system/api/sys_user.go

@@ -10,7 +10,7 @@ import (
 )
 
 type user struct {
-	systemBase
+	SystemBase
 }
 
 var User = new(user)

+ 1 - 1
app/system/api/sys_user_online.go

@@ -16,7 +16,7 @@ import (
 )
 
 type sysUserOnline struct {
-	systemBase
+	SystemBase
 }
 
 var SysUserOnline = new(sysUserOnline)

+ 1 - 1
app/system/api/sys_web_set.go

@@ -17,7 +17,7 @@ import (
 )
 
 type sysWebSet struct {
-	systemBase
+	SystemBase
 }
 
 var SysWebSet = new(sysWebSet)

+ 1 - 1
app/system/api/tools_gen_table.go

@@ -21,7 +21,7 @@ import (
 )
 
 type toolsGenTable struct {
-	systemBase
+	SystemBase
 }
 
 var ToolsGenTable = new(toolsGenTable)

+ 1 - 1
app/system/api/upload.go

@@ -14,7 +14,7 @@ import (
 )
 
 type upload struct {
-	systemBase
+	SystemBase
 }
 
 var Upload = new(upload)

+ 1 - 1
app/system/api/user_Profile.go

@@ -17,7 +17,7 @@ import (
 )
 
 type userProfile struct {
-	systemBase
+	SystemBase
 }
 
 var UserProfile = new(userProfile)

+ 10 - 3
template/vm/go/controller.template

@@ -17,8 +17,11 @@ package api
 {{end}}
 
 import (
-    "gfast/app/system/dao"
-    "gfast/app/system/service"
+    {{if ne $.table.ModuleName "system"}}
+    sysApi "gfast/app/system/api"
+    {{end}}
+    "{{.table.PackageName}}/dao"
+    "{{.table.PackageName}}/service"
     "github.com/gogf/gf/frame/g"
     "github.com/gogf/gf/net/ghttp"
     "github.com/gogf/gf/util/gvalid"
@@ -28,7 +31,11 @@ import (
 )
 
 type {{$structName}} struct {
-	{{.table.ModuleName}}Base
+    {{if ne $.table.ModuleName "system"}}
+    sysApi.SystemBase
+    {{else}}
+    SystemBase
+    {{end}}
 }
 
 var {{.table.ClassName}} = new({{$structName}})

+ 2 - 2
template/vm/go/service.template

@@ -13,8 +13,8 @@ import (
     {{if ne .table.TplCategory "tree"}}
 	comModel "gfast/app/common/model"
 	{{end}}
-	"gfast/app/system/dao"
-	"gfast/app/system/model"
+	"{{.table.PackageName}}/dao"
+	"{{.table.PackageName}}/model"
 	{{if eq .table.TplCategory "tree"}}
 	"github.com/gogf/gf/util/gconv"
 	"gfast/library"