26 lines
514 B
Go
26 lines
514 B
Go
package objects
|
|
|
|
import (
|
|
"fmt"
|
|
"mvc/interfaces"
|
|
)
|
|
|
|
type BankAccountView struct {
|
|
model BankAccountModel
|
|
}
|
|
|
|
var _ interfaces.IObserver = &BankAccountView{}
|
|
|
|
func NewBankAccountView(model BankAccountModel) BankAccountView {
|
|
return BankAccountView{
|
|
model: model,
|
|
}
|
|
}
|
|
|
|
func (bv *BankAccountView) Update() error {
|
|
fmt.Print("\033[H\033[2J")
|
|
fmt.Printf("Kontostand: %v\n", bv.model.GetBalance())
|
|
fmt.Println("Bitte Kontobewegung eingeben: [+ = Einzahlung / - = Abhebung] + Betrag (ex. +100.0)")
|
|
return nil
|
|
}
|