コード例 #1
0
ファイル: account.go プロジェクト: 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
	}
}
コード例 #2
0
ファイル: account.go プロジェクト: 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
}