自动化代码可选不使用官方global.Model结构 (#1637)

* 自动化代码可自行选择默认结构

* 调整自动化模板

* 增加自动化模板中对timer的处理
This commit is contained in:
奇淼(piexlmax
2024-01-22 17:37:03 +08:00
committed by GitHub
parent 07cde689b1
commit 379b63275a
15 changed files with 311 additions and 125 deletions

View File

@@ -66,6 +66,7 @@ func (a *autoCodeSqlite) GetColumn(businessDB string, tableName string, dbName s
var columnInfos []struct {
Name string `gorm:"column:name"`
Type string `gorm:"column:type"`
Pk int `gorm:"column:pk"`
}
if businessDB == "" {
err = global.GVA_DB.Raw(sql).Scan(&columnInfos).Error
@@ -76,6 +77,7 @@ func (a *autoCodeSqlite) GetColumn(businessDB string, tableName string, dbName s
entities = append(entities, response.Column{
ColumnName: columnInfo.Name,
DataType: columnInfo.Type,
PrimaryKey: columnInfo.Pk == 1,
})
}
return entities, err