Use signup table in Signup API.

This commit is contained in:
Yang Luo
2021-06-17 00:49:02 +08:00
parent 3274bd0c7c
commit b11b3b6021
5 changed files with 161 additions and 75 deletions

View File

@ -114,6 +114,20 @@ func GetMaskedUsers(users []*User) []*User {
return users
}
func GetLastUser(owner string) *User {
user := User{Owner: owner}
existed, err := adapter.Engine.Desc("created_time", "id").Get(&user)
if err != nil {
panic(err)
}
if existed {
return &user
} else {
return nil
}
}
func UpdateUser(id string, user *User) bool {
owner, name := util.GetOwnerAndNameFromId(id)
if getUser(owner, name) == nil {