app-cloudep-trade-service/internal/domain/repository/user_wallet.go

22 lines
768 B
Go

package repository
import (
"app-cloudep-trade-service/internal/domain"
"app-cloudep-trade-service/internal/model"
"context"
"github.com/shopspring/decimal"
)
// 如果有需要Select for update 的話,請在 Option 當中加上鎖並且傳入 sqlx.conn)
// UserWalletOperator 針對使用者的錢包基本操作接口
type UserWalletOperator interface {
// Balances 取得多種類別餘額
Balances(ctx context.Context, kind []domain.WalletType, opts ...WalletOperatorOption) ([]model.Wallet, error)
// LocalBalance 取得本地錢包的數額
LocalBalance(kind domain.WalletType) decimal.Decimal
// GetBalancesByID 取得錢包的數額 ByID
GetBalancesByID(ctx context.Context, ids []int64, opts ...WalletOperatorOption) ([]model.Wallet, error)
}