biz

package
v0.0.0-...-370980d Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type TranscationRepo

type TranscationRepo interface {
	// SaveTranscation 交易持久化
	SaveTranscation(ctx context.Context, ts *types.Transcation) error
}

type WalletRepo

type WalletRepo interface {
	// GetVirtualWallet 获取虚拟钱包模型
	GetVirtualWallet(ctx context.Context, userID uint) (*types.VirtualWallet, error)

	// UpdateBalance 更新虚拟钱包余额
	UpdateBalance(ctx context.Context, id uint, amount decimal.Decimal) error
}

type WalletUseCase

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

func NewWalletUseCase

func NewWalletUseCase(walletRepo WalletRepo, transcationRepo TranscationRepo) *WalletUseCase

func (*WalletUseCase) Debit

func (w *WalletUseCase) Debit(ctx context.Context, userID uint, amount decimal.Decimal) error

Debit 付款

func (*WalletUseCase) GetVirtualWallet

func (w *WalletUseCase) GetVirtualWallet(ctx context.Context, id uint) (*types.VirtualWallet, error)

GetVirtualWallet 获取用户虚拟钱包

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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