33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
|
package repository
|
||
|
|
||
|
import (
|
||
|
"code.30cm.net/digimon/app-cloudep-wallet-service/pkg/domain/entity"
|
||
|
"code.30cm.net/digimon/app-cloudep-wallet-service/pkg/domain/wallet"
|
||
|
"context"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type TransactionRepository interface {
|
||
|
FindByOrderID(ctx context.Context, orderID string) (entity.Transaction, error)
|
||
|
Insert(ctx context.Context, tx *entity.Transaction) error
|
||
|
BatchInsert(ctx context.Context, txs []*entity.Transaction) error
|
||
|
List(ctx context.Context, query TransactionQuery) ([]entity.Transaction, int64, error)
|
||
|
FindByDueTimeRange(ctx context.Context, start time.Time, txType []wallet.TxType) ([]entity.Transaction, error)
|
||
|
UpdateStatusByID(ctx context.Context, id int64, status int) error
|
||
|
ListWalletTransactions(ctx context.Context, uid string, orderIDs []string, walletType wallet.Types) ([]entity.WalletTransaction, error)
|
||
|
}
|
||
|
|
||
|
type TransactionQuery struct {
|
||
|
UID *string
|
||
|
OrderID *string
|
||
|
Brand *string
|
||
|
Assets *string
|
||
|
WalletType *wallet.Types
|
||
|
TxTypes []wallet.TxType
|
||
|
BusinessType []int8
|
||
|
StartTime *int64
|
||
|
EndTime *int64
|
||
|
PageIndex int64
|
||
|
PageSize int64
|
||
|
}
|