Finish db update sync.

This commit is contained in:
Yang Luo
2021-05-09 15:44:12 +08:00
parent e2f6efd1ab
commit 6e5aa2bc40
4 changed files with 88 additions and 9 deletions

View File

@ -105,6 +105,15 @@ func UpdateUser(id string, user *User) bool {
return affected != 0
}
func UpdateUserForOriginal(user *User) bool {
affected, err := adapter.Engine.ID(core.PK{user.Owner, user.Name}).Cols("displayName", "password", "phone", "avatar", "isForbidden").Update(user)
if err != nil {
panic(err)
}
return affected != 0
}
func AddUser(user *User) bool {
user.Id = util.GenerateId()
user.UpdateUserHash()