锁定关键信息ID

This commit is contained in:
piexlmax
2022-02-14 14:59:22 +08:00
parent 9426049095
commit d7222c8e31
2 changed files with 31 additions and 31 deletions
+6 -6
View File
@@ -19,12 +19,12 @@ func (d *dictionary) Initialize() error {
status := new(bool)
*status = true
entities := []system.SysDictionary{
{Name: "性别", Type: "gender", Status: status, Desc: "性别字典"},
{Name: "数据库int类型", Type: "int", Status: status, Desc: "int类型对应的数据库类型"},
{Name: "数据库时间日期类型", Type: "time.Time", Status: status, Desc: "数据库时间日期类型"},
{Name: "数据库浮点型", Type: "float64", Status: status, Desc: "数据库浮点型"},
{Name: "数据库字符串", Type: "string", Status: status, Desc: "数据库字符串"},
{Name: "数据库bool类型", Type: "bool", Status: status, Desc: "数据库bool类型"},
{GVA_MODEL: global.GVA_MODEL{ID: 1}, Name: "性别", Type: "gender", Status: status, Desc: "性别字典"},
{GVA_MODEL: global.GVA_MODEL{ID: 2}, Name: "数据库int类型", Type: "int", Status: status, Desc: "int类型对应的数据库类型"},
{GVA_MODEL: global.GVA_MODEL{ID: 3}, Name: "数据库时间日期类型", Type: "time.Time", Status: status, Desc: "数据库时间日期类型"},
{GVA_MODEL: global.GVA_MODEL{ID: 4}, Name: "数据库浮点型", Type: "float64", Status: status, Desc: "数据库浮点型"},
{GVA_MODEL: global.GVA_MODEL{ID: 5}, Name: "数据库字符串", Type: "string", Status: status, Desc: "数据库字符串"},
{GVA_MODEL: global.GVA_MODEL{ID: 6}, Name: "数据库bool类型", Type: "bool", Status: status, Desc: "数据库bool类型"},
}
if err := global.GVA_DB.Create(&entities).Error; err != nil {
return errors.Wrap(err, d.TableName()+"表数据初始化失败!")