22 lines
791 B
Go
22 lines
791 B
Go
package repository
|
|
|
|
import (
|
|
"app-cloudep-trade-service/internal/domain/wallet"
|
|
"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, balanceType []wallet.BalanceType, opts ...WalletOperatorOption) ([]model.Wallet, error)
|
|
// LocalBalance 取得本地錢包的數額
|
|
LocalBalance(balanceType wallet.BalanceType) decimal.Decimal
|
|
// GetBalancesByID 取得錢包的數額 ByID
|
|
GetBalancesByID(ctx context.Context, ids []int64, opts ...WalletOperatorOption) ([]model.Wallet, error)
|
|
}
|