feat:完善项目信息

This commit is contained in:
henry
2022-01-05 18:40:08 +08:00
parent 53c1f3912b
commit 7488e9526b
15 changed files with 317 additions and 313 deletions

View File

@ -30,9 +30,9 @@ func (this *Instance) Handle() {
if !db.Migrator().HasTable(v.iModel) {
err := db.Migrator().CreateTable(v.iModel)
if err != nil {
successCount++
} else {
failureCount++
} else {
successCount++
}
if v.iValues != nil && v.iValues() != nil {
db.Table(v.iModel.TableName()).Create(v.iValues())
@ -47,8 +47,9 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewSysConfig()},
&synchronized{iModel: model.NewSysMenu()}, &synchronized{iModel: model.NewSysAuth()},
&synchronized{iModel: model.NewSysUser(), iValues: func() interface{} {
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888", Password: utils.Md5String("123456"),
IsAdmin: model.SysUserAdministratorForAdmin, Remark: "超级管理员"}
return &model.SysUser{Account: "admin", Name: "商挈智能", Mobile: "13888888888",
Password: utils.Md5String("123456"),
IsAdmin: model.SysUserAdministratorForAdmin, Remark: "超级管理员"}
}},
&synchronized{iModel: model.NewSysUserRole()}, &synchronized{iModel: model.NewSysUserTenant()},
&synchronized{iModel: model.NewSysDepartment()},
@ -141,7 +142,10 @@ func (this *Instance) Handle() {
&synchronized{iModel: model.NewActivityInstance()}, &synchronized{iModel: model.NewActivityApply()},
&synchronized{iModel: model.NewActivityExamine()}, &synchronized{iModel: model.NewActivityJoin()},
)
fmt.Printf("========================\n=== 数据迁移,成功【%d】失败【%d】 ===\n========================\n", successCount, failureCount)
fmt.Println("=== 数据迁移 ===")
fmt.Printf("=== 成功【%d】 ===\n", successCount)
fmt.Printf("=== 失败【%d】 ===\n", failureCount)
fmt.Println("========================")
}
func WithGormDBOption(db *gorm.DB) Option {