示例#1
0
func (r *AccountRepository) Update(account *core.Account) error {
	_, err := dat.Update(r, account.ID(), account)
	if err != nil {
		log.Printf("Error updating account: %s", err)
	}

	return err
}
示例#2
0
func (r *AccountRepository) Save(account *core.Account) error {
	result, err := dat.Create(r, account)
	if err != nil {
		log.Printf("Error creating new account: %s", err)
	}
	account.SetID(result.GeneratedKeys[0])

	return err
}