code refactor

This commit is contained in:
MaysWind
2020-12-26 00:14:58 +08:00
parent f058d62920
commit 823ed89612
2 changed files with 20 additions and 20 deletions
+18 -18
View File
@@ -48,73 +48,73 @@ func updateAllDatabaseTablesStructure() error {
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] user table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] user table maintained successfully")
err = datastore.Container.UserStore.SyncStructs(new(models.TwoFactor))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] two factor table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] two factor table maintained successfully")
err = datastore.Container.UserStore.SyncStructs(new(models.TwoFactorRecoveryCode))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] two factor recovery code table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] two factor recovery code table maintained successfully")
err = datastore.Container.TokenStore.SyncStructs(new(models.TokenRecord))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] token record table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] token record table maintained successfully")
err = datastore.Container.UserDataStore.SyncStructs(new(models.Account))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] account table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] account table maintained successfully")
err = datastore.Container.UserDataStore.SyncStructs(new(models.Transaction))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction table maintained successfully")
err = datastore.Container.UserDataStore.SyncStructs(new(models.TransactionCategory))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction category table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction category table maintained successfully")
err = datastore.Container.UserDataStore.SyncStructs(new(models.TransactionTag))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction tag table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction tag table maintained successfully")
err = datastore.Container.UserDataStore.SyncStructs(new(models.TransactionTagIndex))
if err != nil {
return err
} else {
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction tag index table maintained successfully")
}
log.BootInfof("[database.updateAllDatabaseTablesStructure] transaction tag index table maintained successfully")
return nil
}
+2 -2
View File
@@ -192,8 +192,8 @@ func (a *UsersApi) UserUpdateProfileHandler(c *core.Context) (interface{}, *errs
log.InfofWithRequestId(c, "[users.UserUpdateProfileHandler] user \"uid:%d\" token refreshed, new token will be expired at %d", user.Uid, claims.ExpiresAt)
return resp, nil
} else {
return resp, nil
}
return resp, nil
}