mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-10-09 03:26:42 +08:00
* 增强代码生成
This commit is contained in:
parent
b05f1fac36
commit
f27241251c
@ -186,9 +186,17 @@ func (l *gCurd) loadView(ctx context.Context, in *CurdPreviewInput) (err error)
|
|||||||
importInput := gstr.Replace(temp.InputPath, "./", modName+"/")
|
importInput := gstr.Replace(temp.InputPath, "./", modName+"/")
|
||||||
importController := gstr.Replace(temp.ControllerPath, "./", modName+"/")
|
importController := gstr.Replace(temp.ControllerPath, "./", modName+"/")
|
||||||
importService := "hotgo/internal/service"
|
importService := "hotgo/internal/service"
|
||||||
|
importDao := "hotgo/internal/dao"
|
||||||
|
importEntity := "hotgo/internal/model/entity"
|
||||||
if temp.IsAddon {
|
if temp.IsAddon {
|
||||||
importService = "hotgo/addons/" + in.In.AddonName + "/service"
|
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)
|
importWebApi := "@/api/" + gstr.LcFirst(in.In.VarName)
|
||||||
if temp.IsAddon {
|
if temp.IsAddon {
|
||||||
@ -221,6 +229,8 @@ func (l *gCurd) loadView(ctx context.Context, in *CurdPreviewInput) (err error)
|
|||||||
"importWebApi": importWebApi, // 导入webApi
|
"importWebApi": importWebApi, // 导入webApi
|
||||||
"apiPrefix": in.options.ApiPrefix, // api前缀
|
"apiPrefix": in.options.ApiPrefix, // api前缀
|
||||||
"componentPrefix": componentPrefix, // vue子组件前缀
|
"componentPrefix": componentPrefix, // vue子组件前缀
|
||||||
|
"importDao": importDao, // vue子组件前缀
|
||||||
|
"importEntity": importEntity, // vue子组件前缀
|
||||||
})
|
})
|
||||||
|
|
||||||
in.view = view
|
in.view = view
|
||||||
|
@ -15,8 +15,8 @@ import (
|
|||||||
"github.com/gogf/gf/v2/frame/g"
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
"hotgo/internal/consts"
|
"hotgo/internal/consts"
|
||||||
"hotgo/internal/model/entity"
|
"@{.importEntity}"
|
||||||
"hotgo/internal/model/input/form"
|
"@{.importInput}"
|
||||||
"hotgo/utility/validate"
|
"hotgo/utility/validate"
|
||||||
)
|
)
|
||||||
@{ if eq .options.Step.HasEdit true }
|
@{ if eq .options.Step.HasEdit true }
|
||||||
|
@ -16,13 +16,13 @@ import (
|
|||||||
"github.com/gogf/gf/v2/os/gctx"
|
"github.com/gogf/gf/v2/os/gctx"
|
||||||
"github.com/gogf/gf/v2/os/gtime"
|
"github.com/gogf/gf/v2/os/gtime"
|
||||||
"github.com/gogf/gf/v2/util/gconv"
|
"github.com/gogf/gf/v2/util/gconv"
|
||||||
"hotgo/internal/dao"
|
|
||||||
"hotgo/internal/library/contexts"
|
"hotgo/internal/library/contexts"
|
||||||
"hotgo/internal/library/hgorm"
|
"hotgo/internal/library/hgorm"
|
||||||
"hotgo/internal/library/hgorm/handler"
|
"hotgo/internal/library/hgorm/handler"
|
||||||
"@{.importInput}"
|
|
||||||
"hotgo/internal/model/input/form"
|
"hotgo/internal/model/input/form"
|
||||||
"@{.importService}"
|
"@{.importService}"
|
||||||
|
"@{.importDao}"
|
||||||
|
"@{.importInput}"
|
||||||
"hotgo/utility/convert"
|
"hotgo/utility/convert"
|
||||||
"hotgo/utility/excel"
|
"hotgo/utility/excel"
|
||||||
"hotgo/utility/validate"
|
"hotgo/utility/validate"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
>
|
>
|
||||||
<n-form ref="formRef" :model="formValue">
|
<n-form ref="formRef" :model="formValue">
|
||||||
<n-row :gutter="24">
|
<n-row :gutter="24">
|
||||||
<n-col :span="6" style="min-width: 200px">
|
<n-col :span="4" style="min-width: 200px">
|
||||||
<n-form-item label="生成类型" path="title">
|
<n-form-item label="生成类型" path="title">
|
||||||
<n-select
|
<n-select
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
@ -20,12 +20,18 @@
|
|||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-col>
|
</n-col>
|
||||||
|
|
||||||
<n-col :span="6" style="min-width: 200px">
|
<n-col :span="4" style="min-width: 200px">
|
||||||
<n-form-item label="实体命名" path="varName">
|
<n-form-item label="实体命名" path="varName">
|
||||||
<n-input placeholder="请输入" v-model:value="formValue.varName" />
|
<n-input placeholder="请输入" v-model:value="formValue.varName" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-col>
|
</n-col>
|
||||||
|
|
||||||
|
<n-col :span="4" style="min-width: 200px">
|
||||||
|
<n-form-item label="模型命名" path="daoName">
|
||||||
|
<n-input placeholder="请输入" v-model:value="formValue.daoName" />
|
||||||
|
</n-form-item>
|
||||||
|
</n-col>
|
||||||
|
|
||||||
<n-col :span="6" style="min-width: 200px">
|
<n-col :span="6" style="min-width: 200px">
|
||||||
<n-form-item
|
<n-form-item
|
||||||
label="数据库"
|
label="数据库"
|
||||||
|
@ -129,6 +129,11 @@
|
|||||||
<n-form-item label="实体命名" path="varName">
|
<n-form-item label="实体命名" path="varName">
|
||||||
<n-input placeholder="请输入" v-model:value="formParams.varName" />
|
<n-input placeholder="请输入" v-model:value="formParams.varName" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
|
||||||
|
<n-form-item label="实体模型" path="daoName">
|
||||||
|
<n-input placeholder="请输入" v-model:value="formParams.daoName" />
|
||||||
|
</n-form-item>
|
||||||
|
|
||||||
</n-form>
|
</n-form>
|
||||||
|
|
||||||
<template #action>
|
<template #action>
|
||||||
|
Loading…
Reference in New Issue
Block a user