自动化代码可分包 (#982)

* [style] 修改右上角图标,选择统一风格的iconfont

* 增加路由排错处理

* 未输入tablename时前端自动生成下划线表名方式回滚误删表

* 支持自动化生成package功能

Co-authored-by: bypanghu <bypanghu@163.com>
Co-authored-by: songzhibin97 <718428482@qq.com>
This commit is contained in:
奇淼(piexlmax
2022-03-26 14:13:26 +08:00
committed by GitHub
co-authored by bypanghu songzhibin97
parent 8003603ffd
commit 429353fa54
47 changed files with 1069 additions and 699 deletions
-12
View File
@@ -1,12 +0,0 @@
// 自动生成模板SysDictionaryDetail
package autocode
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
// 如果含有time.Time 请自行import time包
type AutoCodeExample struct {
global.GVA_MODEL
AutoCodeExampleField string `json:"autoCodeExampleField" form:"autoCodeExampleField" gorm:"column:auto_code_example_field;comment:仅作示例条目无实际作用"` // 展示值
}
@@ -1,13 +0,0 @@
// 自动生成模板SysDictionaryDetail
package request
import (
"github.com/flipped-aurora/gin-vue-admin/server/model/autocode"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
)
// 如果含有time.Time 请自行import time包
type AutoCodeExampleSearch struct {
autocode.AutoCodeExample
request.PageInfo
}
+13 -1
View File
@@ -1,6 +1,9 @@
package system
import "errors"
import (
"errors"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
// AutoCodeStruct 初始版本自动化代码工具
type AutoCodeStruct struct {
@@ -14,6 +17,8 @@ type AutoCodeStruct struct {
AutoMoveFile bool `json:"autoMoveFile"` // 是否自动移动文件
Fields []*Field `json:"fields"`
DictTypes []string `json:"-"`
Package string `json:"package"`
PackageT string `json:"-"`
}
type Field struct {
@@ -29,3 +34,10 @@ type Field struct {
}
var AutoMoveErr error = errors.New("创建代码成功并移动文件成功")
type SysAutoCode struct {
global.GVA_MODEL
PackageName string `json:"packageName" gorm:"comment:包名"`
Label string `json:"label" gorm:"comment:展示名"`
Desc string `json:"desc" gorm:"comment:描述"`
}