示例#1
0
// PutUser saves a user in the datastore.
func (db *Userstore) PutUser(user *model.User) error {
	if user.Created == 0 {
		user.Created = time.Now().UTC().Unix()
	}
	user.Updated = time.Now().UTC().Unix()
	return meddler.Save(db, userTable, user)
}
示例#2
0
文件: user.go 项目: zankard/drone
// PostUser saves a User in the datastore.
func (db *Userstore) PostUser(user *model.User) error {
	user.Created = time.Now().UTC().Unix()
	user.Updated = time.Now().UTC().Unix()
	return meddler.Insert(db, userTable, user)
}