mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-25 18:36:48 +08:00
* 增强代码生成
This commit is contained in:
@@ -186,9 +186,17 @@ func (l *gCurd) loadView(ctx context.Context, in *CurdPreviewInput) (err error)
|
||||
importInput := gstr.Replace(temp.InputPath, "./", modName+"/")
|
||||
importController := gstr.Replace(temp.ControllerPath, "./", modName+"/")
|
||||
importService := "hotgo/internal/service"
|
||||
importDao := "hotgo/internal/dao"
|
||||
importEntity := "hotgo/internal/model/entity"
|
||||
if temp.IsAddon {
|
||||
importService = "hotgo/addons/" + in.In.AddonName + "/service"
|
||||
}
|
||||
if temp.IsAddon {
|
||||
importDao = "hotgo/addons/" + in.In.AddonName + "/dao"
|
||||
}
|
||||
if temp.IsAddon {
|
||||
importEntity = "hotgo/addons/" + in.In.AddonName + "/model/entity"
|
||||
}
|
||||
|
||||
importWebApi := "@/api/" + gstr.LcFirst(in.In.VarName)
|
||||
if temp.IsAddon {
|
||||
@@ -221,6 +229,8 @@ func (l *gCurd) loadView(ctx context.Context, in *CurdPreviewInput) (err error)
|
||||
"importWebApi": importWebApi, // 导入webApi
|
||||
"apiPrefix": in.options.ApiPrefix, // api前缀
|
||||
"componentPrefix": componentPrefix, // vue子组件前缀
|
||||
"importDao": importDao, // vue子组件前缀
|
||||
"importEntity": importEntity, // vue子组件前缀
|
||||
})
|
||||
|
||||
in.view = view
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"@{.importEntity}"
|
||||
"@{.importInput}"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
@{ if eq .options.Step.HasEdit true }
|
||||
|
||||
@@ -16,13 +16,13 @@ import (
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/internal/dao"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/library/hgorm"
|
||||
"hotgo/internal/library/hgorm/handler"
|
||||
"@{.importInput}"
|
||||
"hotgo/internal/model/input/form"
|
||||
"@{.importService}"
|
||||
"@{.importDao}"
|
||||
"@{.importInput}"
|
||||
"hotgo/utility/convert"
|
||||
"hotgo/utility/excel"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
Reference in New Issue
Block a user