* 增强代码生成

This commit is contained in:
Kevin
2023-10-06 16:38:46 +08:00
parent b05f1fac36
commit f27241251c
5 changed files with 27 additions and 6 deletions

View File

@@ -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