feat:完善项目信息
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user