actualCombat

package
v0.0.0-...-8d22ec3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

账户

func NewAccount

func NewAccount(accountName string) *Account

创建账户

func (*Account) CheckAccount

func (a *Account) CheckAccount(accountName string) error

检查账户

type Ledger

type Ledger struct {
}

分类帐

func (*Ledger) MakeEntry

func (s *Ledger) MakeEntry(accountID, txnType string, amount int)

生成分类帐条目

type Notification

type Notification struct {
}

通知

func (*Notification) SendWalletCreditNotification

func (n *Notification) SendWalletCreditNotification()

发送信用通知

func (*Notification) SendWalletDebitNotification

func (n *Notification) SendWalletDebitNotification()

发送借款通知

type VerificationCode

type VerificationCode struct {
	// contains filtered or unexported fields
}

验证码

func NewVerificationCode

func NewVerificationCode(code int) *VerificationCode

创建验证码

func (*VerificationCode) CheckCode

func (s *VerificationCode) CheckCode(incomingCode int) error

检查验证码

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

钱包

func NewWallet

func NewWallet() *Wallet

创建钱包

func (*Wallet) AddBalance

func (w *Wallet) AddBalance(amount int)

添加金额

func (*Wallet) DebitBalance

func (w *Wallet) DebitBalance(amount int) error

借款金额

type WalletFacade

type WalletFacade struct {
	Account          *Account
	Wallet           *Wallet
	VerificationCode *VerificationCode
	Notification     *Notification
	Ledger           *Ledger
}

定义钱包的外观类

func NewWalletFacade

func NewWalletFacade(accountID string, code int) *WalletFacade

创建钱包的外观类

func (*WalletFacade) AddMoneyToWallet

func (w *WalletFacade) AddMoneyToWallet(accountID string, securityCode int, amount int) error

添加钱到钱包

func (*WalletFacade) DeductMoneyFromWallet

func (w *WalletFacade) DeductMoneyFromWallet(accountID string, securityCode int, amount int) error

从钱包里扣款

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL