Example #1
0
File: account.go Project: rcijov/go
// Modify Account - old and new changes
func ModifyAccount(oldAcc *entities.Account, newAcc entities.Account) {
	if newAcc.Email != "" {
		oldAcc.Email = newAcc.Email
	}
	if newAcc.Phone != "" {
		oldAcc.Phone = newAcc.Phone
	}
	if newAcc.Type != "" {
		oldAcc.Type = newAcc.Type
	}
	if newAcc.Password != "" {
		oldAcc.Password = newAcc.Password
	}
}
Example #2
0
File: account.go Project: rcijov/go
// Account to Entities Account
func AccToEnt(account Account) entities.Account {
	a := entities.Account{}
	a.Name = account.Name
	a.Email = account.Email
	a.Phone = account.Phone
	a.Password = account.Password
	a.Type = account.Type
	a.Date = account.Date
	return a
}